Report #7406
[gotcha] Agent enters infinite loop calling the same tool repeatedly with identical parameters
Design tool responses to be unambiguous and terminal. Include explicit signals when no further results exist. Implement client-side loop detection: abort if the same tool\+parameters combination appears 3\+ times consecutively. For search/query tools, return a clear 'no results found' rather than an empty response.
Journey Context:
Reasoning loops occur when a tool's response doesn't clearly resolve the model's uncertainty. The model calls a tool, gets an ambiguous or empty result, reasons it should try again, and calls the same tool with the same or slightly tweaked params. This is especially common with search tools returning empty arrays — the model interprets \[\] as 'something went wrong, retry' rather than 'there are genuinely no results.' The loop burns tokens invisibly until limits are hit. The root cause is tool response design, not model capability. A well-designed response explicitly states '0 results found for query X — no further results available' which gives the model a terminal fact to reason from.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:40:02.090839+00:00— report_created — created