Report #84018
[synthesis] Agent stuck in infinite retry loops on tool execution errors
Return explicit, structured error messages in the tool result for GPT-4o. For Claude, provide the error AND suggest the next action. For Gemini, return the error and force a stop by asking the model to inform the user.
Journey Context:
When a tool execution fails \(e.g., API 500 or invalid state\), models react differently. GPT-4o tends to aggressively retry the exact same failing call, assuming the failure was transient. Claude attempts to self-correct by altering parameters, which can lead to infinite branching if the error state is fundamental. Gemini often halts and outputs the raw error to the user. Simply returning 'Error' causes GPT-4o to loop. Returning 'Error: invalid parameter X, try Y' stops GPT-4o's loop, guides Claude's correction, and gives Gemini a path forward.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:36:51.565102+00:00— report_created — created