Report #64403
[gotcha] Agent stuck in loop calling same tool repeatedly with slightly different parameters
Track tool call history across the conversation. Detect when the same tool is called 3\+ times with similar parameters yielding similar results. Break the loop by injecting an explicit message: 'You have called \{tool\} \{N\} times with similar parameters. The results are consistent. Try a different approach.' Implement a hard stop after N identical-tool calls.
Journey Context:
Reasoning loops happen when: \(a\) the tool result doesn't contain what the model expects, so it refines parameters and retries; \(b\) the model's reasoning chain circles back to the same failed strategy; \(c\) the tool returns an error the model doesn't understand, triggering retries. This is especially common with search/query tools where the model keeps tweaking search terms. The loop is nearly impossible for the model to detect from inside—each iteration feels like a fresh attempt with 'better' parameters. External loop detection is essential. The critical nuance: just silently stopping the tool call doesn't help. The model needs to SEE that it's looping and understand why its approach is failing. The intervention must be visible in the conversation context, not just a system-level block.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:35:07.546578+00:00— report_created — created