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
codegraph_explore's tool description and result footer both use "Budget: make at most N calls" wording. Despite the existence of a getExploreBudget() helper, there is no actual call limit enforced at runtime — the wording creates a fictional constraint.
LLM agents reading these strings interpret them as a hard limit and abandon codegraph_explore mid-investigation, falling back to slower grep/Read chains. The "budget" framing degrades real-world agent behavior: agents stop exploring the moment they hit the displayed number, even when their initial result did not fully cover the question.
Reproduction
In an MCP-integrated agent (tested with OpenCode + oh-my-openagent):
Open a project with ~500 files
Ask a question whose answer spans more files than the displayed budget (e.g. budget=2, question needs 4 files)
Observe the agent abandon codegraph_explore after 2 calls and switch to grep/Read, even though the tool would have returned richer results on the 3rd and 4th calls
Current wording shown to the agent
Tool description:
... verbatim source grouped by file. Budget: make at most 2 calls for this project (482 files indexed).
Footer of every explore result:
> **Explore budget: 2 calls for this project (482 files indexed).** Each call covers ~6 files; if your question spans more, spend your remaining calls on the uncovered area BEFORE falling back to Read — another explore is cheaper and more complete than reading those files. Synthesize once you have used 2.
Both wordings are read as "you have at most 2 calls; stop after that." The "BEFORE falling back to Read" phrasing actually encourages the wrong behavior.
Suggested fix
Replace both strings with orientation-focused wording that:
Clarifies the number is a tip (~N calls usually orient), not a limit
Explicitly states "NO call limit — call again whenever a result does not fully cover your question"
Preserves the original intent (steer agents toward efficient explore usage) without the unintended "stop after N calls" side-effect
Proposed wording
Description:
... verbatim source grouped by file. Tip: ~2 calls usually orient you on a project this size (482 files indexed); there is NO call limit — call again whenever a result does not fully cover your question.
Footer:
> **Orientation tip: ~2 calls typically cover a project this size (482 files).** There is NO call limit — if this result did not cover your question, call again targeting the uncovered area; another explore is cheaper and more complete than Read.
Behavior impact
No runtime behavior change. No limit was enforced before; none is enforced now. The change only affects the description string shown to agents and the footer appended to codegraph_explore results.
Real-world agent behavior improves measurably. In local testing on v1.4.1, agents that previously stopped exploring after the displayed number now continue exploring when their initial result does not cover the question — matching the tool's actual (unlimited) design.
Notes
The function getExploreBudget() and its heuristic are preserved — the budget number itself is useful as an orientation hint. This issue only asks to remove the misleading "limit" framing around it.
If there is intent to add a real soft limit in the future (e.g. rate limiting), it should be implemented as an explicit runtime check, not implied via description text.
Problem
codegraph_explore's tool description and result footer both use "Budget: make at most N calls" wording. Despite the existence of agetExploreBudget()helper, there is no actual call limit enforced at runtime — the wording creates a fictional constraint.LLM agents reading these strings interpret them as a hard limit and abandon
codegraph_exploremid-investigation, falling back to slower grep/Read chains. The "budget" framing degrades real-world agent behavior: agents stop exploring the moment they hit the displayed number, even when their initial result did not fully cover the question.Reproduction
In an MCP-integrated agent (tested with OpenCode + oh-my-openagent):
budget(e.g.budget=2, question needs 4 files)codegraph_exploreafter 2 calls and switch togrep/Read, even though the tool would have returned richer results on the 3rd and 4th callsCurrent wording shown to the agent
Tool description:
Footer of every explore result:
Both wordings are read as "you have at most 2 calls; stop after that." The "BEFORE falling back to Read" phrasing actually encourages the wrong behavior.
Suggested fix
Replace both strings with orientation-focused wording that:
~N calls usually orient), not a limitProposed wording
Description:
Footer:
Behavior impact
codegraph_exploreresults.Notes
getExploreBudget()and its heuristic are preserved — the budget number itself is useful as an orientation hint. This issue only asks to remove the misleading "limit" framing around it.Related context
Verification
grep -c "Budget: make at most\\|Explore budget:" src/mcp/tools.ts→ 0 (was 2)grep -c "NO call limit" src/mcp/tools.ts→ 2 (was 0)