You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #1199 / PR #1200, prompted by review feedback there.
Gap
#1200 makes the orchestrator system prompt reference the registered short tool names, closing the rename drift. But the prompt text itself is static: when a canonical tool is not registered, the prompt still instructs the model to use it (with a runtime warning logged). One legitimate configuration hits this today: the MCP path (codebase_rag/mcp/tools.py) omits semantic_search when the vector backend is unavailable, yet the built prompt still contains the whole "WHEN TO USE SEMANTIC SEARCH FIRST" strategy section (prompts.py, the t.semantic_search sites around lines 156-183) telling the model to start with a tool that is not in its schema.
For prose-following models this is the same failure mode #1199 documented — a call to an unregistered name is dropped silently and the run burns retries on empty turns — just narrower: it needs a config where the tool is genuinely absent, rather than affecting every install.
Work
Make the prompt sections conditional on tool availability rather than interpolation-only:
extract_tool_names (or a sibling) should expose which canonical tools are actually registered, not just their names — e.g. return (ToolNames, frozenset[AgenticToolName]) or make the availability set a field.
build_rag_orchestrator_prompt builds the semantic-search strategy subsection (2a/2c workflows) only when semantic_search is registered; the graph-first guidance in 2b becomes the unconditional default in its absence.
Same treatment for any other tool that can legitimately be absent (structural_search/structural_replace are also conditional in the MCP path, though they are not in ToolNames today).
Extend test_prompt_tool_names.py: build the prompt from a tool list without semantic_search and assert the prompt neither backtick-references it nor instructs starting with semantic search; with the full list, assert the strategy section is present (guards against the section silently disappearing).
Follow-up to #1199 / PR #1200, prompted by review feedback there.
Gap
#1200 makes the orchestrator system prompt reference the registered short tool names, closing the rename drift. But the prompt text itself is static: when a canonical tool is not registered, the prompt still instructs the model to use it (with a runtime warning logged). One legitimate configuration hits this today: the MCP path (
codebase_rag/mcp/tools.py) omitssemantic_searchwhen the vector backend is unavailable, yet the built prompt still contains the whole "WHEN TO USE SEMANTIC SEARCH FIRST" strategy section (prompts.py, thet.semantic_searchsites around lines 156-183) telling the model to start with a tool that is not in its schema.For prose-following models this is the same failure mode #1199 documented — a call to an unregistered name is dropped silently and the run burns retries on empty turns — just narrower: it needs a config where the tool is genuinely absent, rather than affecting every install.
Work
Make the prompt sections conditional on tool availability rather than interpolation-only:
extract_tool_names(or a sibling) should expose which canonical tools are actually registered, not just their names — e.g. return(ToolNames, frozenset[AgenticToolName])or make the availability set a field.build_rag_orchestrator_promptbuilds the semantic-search strategy subsection (2a/2c workflows) only whensemantic_searchis registered; the graph-first guidance in 2b becomes the unconditional default in its absence.structural_search/structural_replaceare also conditional in the MCP path, though they are not inToolNamestoday).Tests
Extend
test_prompt_tool_names.py: build the prompt from a tool list withoutsemantic_searchand assert the prompt neither backtick-references it nor instructs starting with semantic search; with the full list, assert the strategy section is present (guards against the section silently disappearing).