feat(mcp): search all projects with one scoped query per database - #1573
Merged
Merged
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]>
…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]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Re-lands #1568 on
main. #1568 was merged into its stacked base branch (feat/1558-scoped-search-3b-scoped-route) rather than intomainafter #1567 landed, so its two commits never reachedmain. This PR carries those same two commits, cherry-picked ontomainunchanged. See #1568 for the description, measurements, and test plan.search_notes(search_all_projects=True)runs oneQUERY /v2/search/per database (the local database, and each cloud workspace) through the newScopedSearchClient, and attributes every hit from the server'sproject_external_id.projectsparameter searches a chosen subset by name or external id; an unknown name is an error.list_memory_projectsrows carry the internalid; the temporal confirmation check is shared by both search clients;search-notes(3)regenerated.Refs #1558, #1568
🤖 Generated with Claude Code
https://claude.ai/code/session_019YW9ysxugGGBCNEGzsxtFV