Report #73841
[synthesis] Agent gets stuck in a loop, repeatedly calling the same tool or generating the same text in long conversations
For Claude 3.5 Sonnet, inject a dynamic counter in the system prompt \(e.g., 'Attempt X of 3'\) and increment it externally. For GPT-4o, lower the temperature slightly \(e.g., to 0.3\) and add a break\_loop tool. For Gemini, truncate the conversation history earlier to prevent context window saturation.
Journey Context:
As context length increases, models exhibit different degenerative behaviors. Claude 3.5 Sonnet is highly prone to 'action loops' where it repeatedly calls the same failing tool with identical arguments, convinced the next try will work. GPT-4o tends to get stuck in 'text loops,' repeating the same reasoning or apology. Gemini 1.5 Pro's instruction following degrades, leading it to forget the original goal and hallucinate. Simply increasing the context window doesn't solve this; the orchestration layer must implement model-specific loop detection and state mutation strategies to break the degenerate cycles.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:32:28.058427+00:00— report_created — created