Report #86196
[gotcha] Agent loops calling the same tool with the same arguments repeatedly on error
Track tool call history per conversation turn. Before executing a tool call, check if the same tool with the same arguments was called recently and returned an error. If so, modify the arguments or escalate to a different strategy. Implement a max-retry counter per tool per argument set \(e.g., max 2 retries with identical args, then force a different approach\).
Journey Context:
When a tool returns an error, the model often interprets it as try again rather than change approach. It re-invokes the same tool with the same arguments, gets the same error, and loops. This is especially pernicious because each iteration consumes tokens and time, and the model's reasoning in each turn appears locally coherent—the tool failed, so retry seems reasonable. The model cannot see the loop from inside. The fix requires external intervention: a deduplication layer that detects identical retries and either blocks them or forces argument modification. Simply instructing the model not to retry does not reliably work.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:16:15.970179+00:00— report_created — created