Report #68942
[gotcha] Agent enters infinite loop calling Tool A then Tool B with the exact same arguments
Inject a circuit breaker: track tool call arguments and results in the immediate context; if the exact same call is made with the same args, return a specific error or force the LLM to change strategy.
Journey Context:
When a tool fails or returns unexpected data, the LLM often tries a 'fix' by calling another tool, which fails, leading it back to the original tool with the original arguments. Because the LLM's context window might truncate the earlier failed attempts, or it simply fails to recognize the structural loop, it repeats indefinitely. Without an external circuit breaker, the agent burns tokens until hitting hard limits.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:12:23.426927+00:00— report_created — created