feat(mcp): search all projects with one scoped query per database - #1568
Merged
phernandez merged 2 commits intoSep 15, 2026
Merged
phernandez merged 2 commits into
phernandez merged 2 commits into
Conversation
`search_notes(search_all_projects=True)` used to run one project search per project and merge the pages client-side. It now groups the accessible projects by the database they live in (the local database, or one cloud workspace each) and runs one `QUERY /v2/search/` per group through the new `ScopedSearchClient`, passing the group's internal project ids. The server ranks the union in one query and attributes each hit with `project_external_id`; the tool qualifies permalinks and paths from that attribution rather than from which request a result came back on, so a name collision across workspaces can no longer route a hit to the wrong project. A new `projects` parameter searches a chosen subset by name or external id. It shares the grouping and merge with the all-projects path; an unknown name is an error before any query runs. Cross-database results are still merged by score and sliced to the requested page, a failing database is skipped with a warning and an inexact total, a retryable outage fails the merged page, and a server too old to attribute its results raises a version-skew error like the existing valid-time skew check. `list_memory_projects` now carries the internal `id` in its merged project rows, which is what the scoped route addresses projects by. The temporal confirmation check moves to a module function shared by both search clients. Refs #1558 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV Signed-off-by: phernandez <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
6 tasks
…meter `tests/test_man_pages.py` compares the rendered SYNOPSIS and PARAMETERS of search-notes(3) with the tool registry; the new `projects` parameter left the committed page stale. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV Signed-off-by: phernandez <[email protected]>
An error occurred while trying to automatically change base from
feat/1558-scoped-search-3b-scoped-route
to
feat/1558-scoped-search-3a-vector-scope
September 15, 2026 23:55
phernandez
merged commit Sep 15, 2026
c627e80
into
feat/1558-scoped-search-3b-scoped-route
30 checks passed
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.
Summary
Fifth PR in the #1558 stack, on top of #1567 (the
QUERY /v2/search/route). Movessearch_notes(search_all_projects=True)from one search per project onto the scoped route: one query per database, with the server attributing every hit to its project.QUERY /v2/search/call through the newScopedSearchClient, carrying that group's internal project ids. A local vault with twelve projects is now one query instead of twelve.project_external_idon each hit, not from which request returned it. A name collision across workspaces can no longer route a hit to the wrong project.projectssubset parameter.search_notes(projects=["beta", "<external id>"])searches a chosen set through the same grouping and merge. An unknown name is an error before any query runs.# Search Failedanswer, not an empty one. A server too old to attribute its results raises a version-skew error, the same shape as the existing valid-time skew check.project_index_required.list_memory_projectsnow includes the internalidin its merged rows, which is what the scoped route addresses projects by. The temporal-confirmation check is shared by both search clients.Cloud follow-up (after the stack lands and cloud re-pins): the cloud proxy forwards QUERY paths to the tenant Core, and the hosted factory yields the tenant client, so this path works there without further changes to the tool. Per Paul's sequencing, the cloud-side work follows the core PRs.
Test plan
just fast-checktests/mcpandtests/api(1835 passed)test_search_notes_multi_project.py: one call per workspace, local projects share one call, page prefix math across databases, opt-in, empty project list, one failing database, all failing, 503, readiness per project,projectssubset across databases, unknown name, attribution skew, ref parsingtest_search_notes_multi_project_temporal.py: valid-time filter forwarded to every database, overlap filter, malformed filter refused before any query, zero projects still confirms the filtertest_cjk_search_guidance.pyand the SPEC-82 skew test intest_tool_search_temporal.pyadapted to the scoped clienttest_tool_contracts.pysignature updated forprojectsRefs #1558
🤖 Generated with Claude Code
https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV