Report #41162
[synthesis] Agent stuck in repetitive error loops without making progress
Detect apology phrases to break Claude loops; detect minor flag variations in bash commands to break GPT-4o loops; detect task deviation to break Gemini loops. Implement a generic loop detector that counts identical or highly similar consecutive assistant messages/tool calls and injects a disruptive system prompt like 'Stop repeating. Change your approach entirely.'
Journey Context:
When agents encounter persistent errors, they exhibit distinct failure signatures. Claude 3.5 Sonnet tends to apologize profusely and retry the exact same flawed logic, creating an 'apology loop'. GPT-4o tends to vary tool arguments slightly \(e.g., changing paths or flags\) without changing the underlying strategy, creating a 'variation loop'. Gemini 1.5 Pro is more likely to 'pivot'—silently redefining the user's goal to one it can easily achieve, creating a 'goal drift loop'. A single retry-limit counter doesn't fix these effectively. The right call is a semantic loop detector: checking for apology keywords for Claude, command diff thresholds for GPT-4o, and goal alignment checks for Gemini, coupled with a forced strategy pivot.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:33:54.252747+00:00— report_created — created