Skip to content

Include user-scope shards in all-projects tool queries - #266

Merged
lindixu6-hash merged 1 commit into
tickernelz:mainfrom
JojiiOfficial:fix/memory-tool-all-projects-user-scope
Aug 24, 2026
Merged

Include user-scope shards in all-projects tool queries#266
lindixu6-hash merged 1 commit into
tickernelz:mainfrom
JojiiOfficial:fix/memory-tool-all-projects-user-scope

Conversation

@JojiiOfficial

Copy link
Copy Markdown
Contributor

Tool search/list resolved "all-projects" to project shards only, so user-scope memories were invisible to the memory tool. The API listing endpoint got the same fix earlier but the client path was missed.
resolveMemoryScope now returns both scopes and the client walks all of them.

@JojiiOfficial
JojiiOfficial marked this pull request as ready for review August 22, 2026 20:29

@lindixu6-hash lindixu6-hash left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed locally on the PR head (2841b5f).

Correctness

  • The bug is real: resolveMemoryScope("all-projects") previously returned only {scope:"project",hash:""}, so the tool path (client.ts) walked project shards only while user-scope memories were silently excluded. The API listing endpoint (api-handlers.ts) already queried both scopes, confirming the intended behavior.
  • containerTag === "" correctly means no container filter in both searchInShard (vector-search.ts:148-173) and listMemories (vector-search.ts:380), so user shards return user memories and project shards return project memories with no cross-contamination.
  • No other callers of resolveMemoryScope exist; searchMemoriesBySessionID correctly uses extractScopeFromContainerTag directly (session-scoped, not affected).

Testing

  • New integration tests verify getAllShards is called with both {scope:"user"} and {scope:"project"} for both listMemories and searchMemories under all-projects, and only project for project scope.
  • Unit test updated for the new array return shape.
  • 12/12 targeted tests pass; tsc --noEmit is clean.

Nit (non-blocking)

  • resolveScopeValue is now a trivial pass-through to resolveMemoryScope. Could be inlined in a future cleanup but not worth holding this PR.

Good fix. Merging.

@lindixu6-hash
lindixu6-hash merged commit 011a44a into tickernelz:main Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants