Include user-scope shards in all-projects tool queries - #266
Merged
lindixu6-hash merged 1 commit intoAug 24, 2026
Merged
Conversation
JojiiOfficial
marked this pull request as ready for review
August 22, 2026 20:29
lindixu6-hash
approved these changes
Aug 24, 2026
lindixu6-hash
left a comment
Collaborator
There was a problem hiding this comment.
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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
resolveMemoryScopenow returns both scopes and the client walks all of them.