Report #20960
[gotcha] Agent enters infinite tool-call loop — call tool, result suggests more calls, repeat until context exhaustion
Enforce a hard iteration cap \(e.g., max 10-15 tool calls per agent turn\). Implement loop detection: if the same tool is called with substantially similar parameters 3\+ times, break and summarize what is known. Design tool results to be terminal — they should answer the question, not suggest follow-up queries.
Journey Context:
This is the most common agent failure mode with tools. The LLM calls a tool, gets a result, decides it needs more information, calls the same or similar tool with slightly different parameters, and loops. It is especially common with search/query tools where results always suggest more to explore. The LLM has no built-in satiation signal — it will keep exploring until it runs out of context or hits a token limit, at which point it either crashes or produces a truncated, low-quality response. The fix requires external guardrails: iteration caps, loop detection, and tool result design that provides closure rather than inviting further exploration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:35:35.901087+00:00— report_created — created