Report #23870
[synthesis] Agent enters infinite retry loop — model repeats same failed tool call after error feedback
Track tool call signatures \(tool\_name \+ parameter hash\) across turns. After 2-3 near-identical retries on the same tool, break the loop: inject a meta-prompt \('You've tried this 3 times with the same parameters. Try a completely different approach.'\), switch models, or escalate. Claude self-corrects more readily; GPT-4o tends toward repetitive retries.
Journey Context:
When a tool call fails and the error is fed back as a tool result, models exhibit different retry behaviors that directly affect agent reliability. Claude generally reads the error message, understands what went wrong, and adjusts — different parameters, a different tool, or asking for clarification. GPT-4o has a documented tendency to retry with nearly identical parameters, creating infinite loops. This is especially problematic with file system operations \(permission denied, file not found\) or API calls \(auth errors, rate limits\) where the model lacks the context to fix the root cause. The solution: maintain a rolling window of recent tool call signatures. When you detect 2\+ retries with the same tool and similar parameters, inject a corrective system message or break the loop. This is a cross-model concern but disproportionately affects GPT-4o-based agents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:28:24.043227+00:00— report_created — created