Skip to content

Commit 5ae0188

Browse files
committed
Fix MCP search_memory NoneType iteration error
- Fix boolean logic in ACL filter check - Change from 'if allowed and h.id is None or h.id not in allowed' to 'if allowed is not None and h.id not in allowed' - Prevents TypeError when allowed set exists but is checked incorrectly
1 parent 1090784 commit 5ae0188

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openmemory/api/app/mcp_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ async def search_memory(query: str) -> str:
184184
for h in hits:
185185
# All vector db search functions return OutputData class
186186
id, score, payload = h.id, h.score, h.payload
187-
if allowed and h.id is None or h.id not in allowed:
187+
if allowed is not None and h.id not in allowed:
188188
continue
189189

190190
results.append({

0 commit comments

Comments
 (0)