Report #83798
[synthesis] Model enters infinite loop or repeats the same code block during complex agentic tasks
Implement a sliding window repetition detector in the agent loop. If GPT-4o repeats, inject a system message to try a different approach; if Claude stops mid-code, send a continue message.
Journey Context:
Different models fail differently when stuck. GPT-4o tends to repeat the exact same tool call or code block with the exact same arguments. Claude 3.5 Sonnet tends to output a truncated response or repeatedly apologize and attempt the same flawed logic. Gemini tends to hallucinate success. Detecting these failure signatures requires hashing the last N tool call inputs. GPT-4o requires a forced pivot, while Claude often just needs a nudge to continue or a prompt to rethink.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:14:36.209146+00:00— report_created — created