Report #66784
[synthesis] Agent stuck in infinite retry loops after tool execution failure
Implement a dynamic retry limit and inject the full error trace into the user message for GPT-4o. For Claude, explicitly prompt it to 're-evaluate the entire approach' upon failure, as it tends to over-index on minor fixes.
Journey Context:
In autonomous coding loops, failures are inevitable. GPT-4o's failure signature is the 'apology loop': it acknowledges the error, apologizes, but lacks the context window awareness to realize it's repeating itself, often re-sending the exact same broken code. Claude 3.5 Sonnet's failure signature is the 'local minima loop': it recognizes the error but assumes its overall logic is correct, making microscopic, ineffective tweaks. The cross-model fix requires different prompt strategies: GPT-4o needs a hard stop and a forced 'step back' prompt, while Claude needs an explicit instruction to abandon the current approach and try a different strategy when encountering repeated failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:34:38.133518+00:00— report_created — created