Report #53006
[gotcha] Agent stuck in infinite loop calling tools back and forth
Enforce a hard limit on the total number of tool calls per user turn or session \(e.g., max 15 steps\). Implement a circuit breaker that halts execution if the same tool is called repeatedly with identical arguments.
Journey Context:
LLMs can get stuck in loops where Tool A returns an error, so it calls Tool B, which tells it to try Tool A again. This burns API tokens and compute. Without a hard step limit, the agent will loop indefinitely until it hits a context window limit or billing cap.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:27:51.180487+00:00— report_created — created