Repository navigation
fix(hooks): tell subagents without MCP tools how to reach the graph via the CLI - #2839
Conversation
…ia the CLI The SubagentStart hook matches every agent type, but agents defined with an explicit tool list (e.g. tools: Read, Grep, Glob, Bash) have no MCP tools, and SubagentStart input carries no tool list to detect that. Append one sentence to the SubagentStart context only (indexed and unindexed variants) pointing such agents at `codebase-memory-mcp cli <tool> --help`. Longest variant is ~1.1 KB, well inside the 2 KB context buffer. Closes DeusData#2837 Signed-off-by: Shane McCarron <shane.mccarron@corvexconnect.com>
QA Round 1Round 1 · PR #5 · Reviewer: Claude Opus 5.5 (qa-panel, sequential single-reviewer path: tiny diff) · Contract source: upstream issue #2837 + PR acceptance criteria Verdict: clean. The change is correct; no findings. Contract Verification
Schema ChangeNo schema change (hook context string + tests). Schema gate not configured — did not run. SecuritySAST not applicable: no CI security stage is configured for this target, so no scan ran. Notes
Test run
Navigation: cmm+ctx Posted by the developer account (QA-agent token unavailable). Review performed by Claude Opus 5.5 (Anthropic) in Claude Code via qa-panel. |
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
Hook context reads best as plain facts: the SubagentStart sentence now says the same tools are also available from the shell instead of instructing the agent. The command the tests match is unchanged. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you, Shane! This is a small change with a real payoff: subagents defined with a fixed tool list (Read, Grep, Bash and similar) were being pointed at graph tools they could not call, and one sentence naming We pushed two commits to your branch (maintainer edits are on):
The cli suite passes on the merged tree (372 passed, 1 skipped), including your new assertions. We will merge once the required checks are green. Please pull before pushing again. |
|
Merged as 85a38ed - thank you, Shane! Subagents defined with a fixed tool list now learn from their SubagentStart context that the same graph tools are available through |
Summary
Tell subagents that have no MCP tools how to reach the graph through the CLI.
Closes #2837
The installed
SubagentStarthook matches every agent type ("*"), but many agents are defined with an explicit tool list that has no MCP tools (e.g.tools: Read, Grep, Glob, Bash). The SubagentStart input carries no tool list, so the hook can't detect this. Those agents can still use the graph throughcodebase-memory-mcp cli <tool>, but the reminder never said so.Change
ha_lifecycle_json_from_root(src/cli/hook_augment.c): forSubagentStartonly, append one sentence to both the indexed-project and no-project context variants:Acceptance criteria
codebase-memory-mcp cli <tool> --help.Testing
tests/test_cli.c: new assertions on the SubagentStart outputs (indexed and unindexed), plus a negative assertion on SessionStart. Red before the change, green after.cli_hook*tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01CDDUoWEZMNZ9fLvzp2pPGT