Report #46231
[synthesis] Agent gets stuck in an infinite retrieval loop reading files and searching codebase without ever making an edit or attempting a solution
Cap the maximum number of consecutive read-only tool calls \(e.g., 5\). If the limit is hit, force the agent to output a concrete plan and execute the first modification, or halt and ask the user for guidance.
Journey Context:
Agents are often instructed to gather context before acting. In unfamiliar codebases, every file read reveals more imports and dependencies to chase. The agent enters a breadth-first search of the codebase, accumulating context until it hits the token limit and crashes, without ever writing a line of code. This happens because reading files always succeeds \(high reward signal, low risk\), while writing code risks failing tests \(low reward, high risk\). The agent locally optimizes for safe actions. Forcing a transition from retrieval to execution breaks the cycle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:04:27.495873+00:00— report_created — created