Skip to content

feat(cli): expose compact search and context discovery - #1518

Merged
phernandez merged 12 commits into
mainfrom
feat/686-compact-cli
Sep 8, 2026
Merged

phernandez merged 12 commits into
mainfrom
feat/686-compact-cli

Conversation

@phernandez

@phernandez phernandez commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Why

Shell agents need access to the same compact discovery options as MCP clients. Refs #686.

What Changed

Adds --compact to bm tool search-notes and bm tool build-context, forwarding to the MCP implementations. JSON, plain text and Rich output selection remain unchanged. Adds a short discovery-then-read guide in docs/COMPACT_DISCOVERY.md.

Implementation Details

Stacked on #1516 and includes the search implementation from #1515. Land both prerequisites before retargeting this PR to main. The new CLI change only forwards the option; it shares the MCP projection and uses existing renderers.

Testing

  • uv run pytest test-int/cli/test_compact_discovery_integration.py -q --no-cov: 4 passed, covering both commands in JSON/plain modes and ordinary output without the flag.
  • BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest test-int/cli/test_compact_discovery_integration.py -q --no-cov: 4 passed.
  • uv run pytest tests/cli/test_cli_tools.py tests/cli/test_cli_tool_rich_output.py tests/cli/test_cli_tool_json_output.py tests/cli/test_cli_tool_exit.py -q --no-cov: 93 passed.
  • just fast-check, just doctor, git diff --check: passed.

Risks / Follow-ups

Opt-in, with no default change. Compact output reduces payload size rather than database work or a fixed token budget. The broader progressive-loading issue remains open.

Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez phernandez added this to the v0.24.0 milestone Sep 8, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T05:43:42.780669Z f3d4411 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ca7b6b460

ℹ️ 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".

Comment thread src/basic_memory/mcp/tools/search.py Resolved
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9de1ee6861

ℹ️ 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".

Comment thread src/basic_memory/mcp/tools/search.py Resolved
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: e71e449549

ℹ️ 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>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: f3d4411923

ℹ️ 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".

Base automatically changed from feat/686-compact-context to main September 8, 2026 13:40
@phernandez
phernandez merged commit 5ed2f64 into main Sep 8, 2026
35 checks passed
@phernandez
phernandez deleted the feat/686-compact-cli branch September 8, 2026 13:42
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.

1 participant