Report #82520
[gotcha] Agent stuck in an infinite loop of calling the same tool with the same failing arguments
Implement strict maximum retry limits and stateful fallback logic. If a tool call fails twice with the same arguments, the agent must stop, return the error to the user, and not retry. Track token/cost limits per session.
Journey Context:
LLMs are stateless and often lack self-correction logic. If a tool call fails \(e.g., API rate limit, bad input\), the LLM might receive the error, apologize, and then construct the exact same tool call again, leading to an infinite loop. This burns through API tokens and can cause denial-of-service on the target API. The agent framework must enforce a hard circuit breaker on consecutive identical or semantically similar tool calls.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:06:12.910539+00:00— report_created — created