Report #41335
[synthesis] Agent enters infinite loop retrying a failed tool call with identical arguments
Append the error message to the tool result and explicitly instruct: 'If a tool call fails, do not retry with the same arguments. Analyze the error and adjust.' For GPT-4o, add a max-retries counter in the system prompt.
Journey Context:
When a tool returns an error \(e.g., 404, rate limit\), Claude 3.5 Sonnet usually reads the error, apologizes, and tries a different approach or stops. GPT-4o has a strong tendency to retry the exact same failing function call in an infinite loop, assuming the failure was transient. Gemini often halts entirely. To prevent GPT-4o loops, the error message must be injected into the tool result \(not just a system message\), and explicit instructions against blind retries are required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:51:14.326886+00:00— report_created — created