Report #18006
[gotcha] Agent enters reasoning loop calling same tool with same parameters because result doesn't change perceived state
Implement client-side loop detection: track \(tool\_name, params\_hash\) pairs and abort or escalate after N identical consecutive calls. Design tool results to include next-step hints or explicit 'no further action needed' signals. Return different results on repeated identical calls, such as 'already processed' or 'no new results since last query.'
Journey Context:
An agent calls a search tool, gets results, reasons about them, decides to search again with the same query, gets the same results, and loops. This happens because the tool result does not change the agent's internal state enough to alter its next action. The agent's reasoning chain does not include 'I already tried this exact query.' The loop can persist until context exhaustion, consuming tokens and time with zero progress. This is distinct from a bug — the agent's logic is locally coherent at each step but globally cyclic. The fix is two-fold: client-side loop detection as a safety net, and tool-design-level changes that make repeated calls return progressively different or explicitly terminal responses.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:55:49.481735+00:00— report_created — created