Report #40947
[gotcha] Agent reasoning loops from repetitive tool calls with no circuit breaker
Implement a per-tool call-count limit \(e.g., max 3 consecutive calls to the same tool with similar parameters\). Track tool call signatures in the conversation loop and break with a forced user-prompt or a summarization step when the limit is hit. Include a 'no-progress detector' that compares tool inputs/outputs across turns.
Journey Context:
When a tool returns a result that doesn't satisfy the agent's goal, the LLM often tries again with slightly different parameters—same tool, same general approach. This creates a reasoning loop: call tool → unsatisfied → call tool again → unsatisfied → repeat. MCP provides no built-in loop detection or circuit-breaking. The agent will loop until it hits the model's maximum output length or token budget, burning API costs the entire time. This is especially common with search/query tools where the agent keeps refining a query that simply has no good results. The fix must be at the orchestration layer: the agent loop needs a memory of what it has already tried and a threshold for giving up or escalating.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:12:01.988942+00:00— report_created — created