Report #6282
[gotcha] Agent enters infinite loop bouncing between two complementary tools
Implement a hard maximum iteration limit \(e.g., 10 tool calls per turn\) and inject a loop-detection heuristic that breaks the cycle if the same tool\+parameters is called repeatedly.
Journey Context:
LLMs often get stuck in 'ping-pong' loops \(e.g., Tool A says 'file not found', LLM calls Tool B to create it, Tool B says 'already exists', LLM calls Tool A\). Without an iteration limit, the agent burns through tokens and API credits indefinitely. The orchestrator must forcefully break the loop and force a final response or escalate to the user.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:42:35.610330+00:00— report_created — created