Report #72251
[synthesis] Agent enters infinite loop or fails to self-correct when a tool returns an error
Implement a hard retry limit of 2 for GPT-4o to prevent identical argument retries, and inject explicit "Previous attempt failed because X, do not repeat Y" instructions for Gemini to break hallucination loops; Claude self-corrects more naturally.
Journey Context:
When a tool execution fails and the error is fed back, models react differently. Claude 3.5 Sonnet analyzes the error and adjusts its arguments. GPT-4o has a strong tendency to retry the exact same failed arguments 2-3 times, assuming the failure was transient. Gemini 1.5 Pro often ignores the error context and hallucinates a successful result in its reasoning, continuing the loop. A single retry strategy fails across the board; you need model-specific error feedback formatting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:51:38.843742+00:00— report_created — created