Report #11785
[gotcha] Agent enters infinite retry loops when a tool returns errors, trying minor parameter variations instead of changing approach
Implement a per-tool retry budget \(max 2-3 retries\); after exhausting retries, inject a system message forcing a strategy change; track retry history in context and include it in subsequent prompts so the model sees its own loop
Journey Context:
When a tool call fails, LLMs tend to retry with tiny parameter tweaks \(adding a slash, changing case, etc.\) rather than reconsidering the approach. Each retry consumes context and time, and the model doesn't naturally recognize it's looping. The fix is two-fold: hard retry limits to break the loop mechanically, and making the retry history visible in context so the model can reason about its failures. Some frameworks solve this with reflection prompts after N failures \('You've tried X 3 times. Try a completely different approach.'\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:17:14.160519+00:00— report_created — created