Repository navigation
feat(mcp): add compact search discovery results - #1515
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review Updated the tool signature contract to include the intentional compact parameter. All 5 contract tests and just typecheck pass. Please review the latest head. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 209d9b0f11
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db6eee92df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why
#686 reports excessive search response size when agents only need to discover relevant notes. JSON results can include both note content and a matched excerpt before the agent decides what to read.
Refs #686. This is the search-discovery slice; compact graph traversal remains separate.
What Changed
Add opt-in
search_notes(compact=True)for both JSON and text output, including all-project searches. It omitscontent,matched_chunk,content_length, andcontent_truncatedwhile preserving ranked identifiers, metadata, relation fields, temporal assertions, and pagination. Observation titles use their category and permalinks use their owning file path, so labels do not repeat source prose. Agents can read selected notes afterward using their stable identifiers.Implementation Details
Apply a typed response projection after each project retrieval, before workspace qualification and account-wide merging. Normal responses remain unchanged and source response objects are not mutated. Compact observation read paths preserve case, spaces and extensions beneath the workspace/project prefix. The generated manual documents the parameter and the discovery/read workflow.
Testing
uv run pytest test-int/mcp/test_compact_search_integration.py tests/mcp/test_tool_search.py tests/mcp/tools/test_search_notes_multi_project.py -q --no-cov: 79 passed.BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest test-int/mcp/test_compact_search_integration.py -q --no-cov: 4 passed.just man-regen,just fast-check, andjust doctor: passed.Risks / Follow-ups
This reduces the model-visible MCP response, not API transfer or database retrieval work. It is not a hard token budget: titles and metadata can still be large. It does not add observation-summary levels or compact
build_contextresponses, and does not change the default search output.