Report #86018
[synthesis] Agent retry loop after tool call failure causes infinite repetition on Gemini, while Claude re-approaches and GPT-4o makes minor tweaks
Implement a deduplication-aware retry budget: hash the tool call name \+ parameters, and if the same hash appears more than 2 times consecutively, inject a forced strategy-pivot system message: 'Your previous approach failed repeatedly. Use a completely different method or tool.' Set a hard cap of 3 identical retries before aborting.
Journey Context:
When a tool call fails, each model has a characteristic retry fingerprint. Claude tends to re-analyze the error and try a substantively different approach. GPT-4o tends to make small parameter tweaks \(adjusting a value, changing a flag\). Gemini has a notable tendency to repeat the exact same call with identical parameters, creating infinite loops. Standard retry logic that only counts total attempts misses this — you need to detect semantic duplication of tool calls. The forced strategy-pivot message is surprisingly effective at breaking the repetition pattern across all three providers, but is essential for Gemini.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:58:11.309738+00:00— report_created — created