Report #35384
[gotcha] Agent enters infinite loop retrying the same failing tool call with identical parameters
Track the last N tool calls and their results in the agent loop. If the same tool name with the same \(or trivially similar\) parameters is called more than twice, break the loop and inject a 'stuck' signal into the conversation. Implement a circuit breaker: after 2 identical failures, force a strategy change \(different tool, different params, or escalate to user\). Never rely on the LLM alone to self-correct from within a retry loop.
Journey Context:
When a tool call fails, the LLM reasons 'let me try again' and re-invokes with the same or trivially different parameters. The error message doesn't give enough signal to change approach, so the loop continues. This is especially common with file system tools \(file not found → retry same path\) and API tools \(rate limit → retry immediately\). The LLM's persistence heuristic backfires because each retry consumes the same failing context, reinforcing the same reasoning. The fix must be structural — the agent framework must detect and break loops, because the LLM cannot reliably self-correct when it's already inside the failing reasoning path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:51:55.921303+00:00— report_created — created