Report #86493
[synthesis] Agent loops infinitely on failed tool calls without throwing errors
Append a monotonically increasing attempt counter and the previous error/output to the tool call prompt, or inject a 'You are stuck' system message after 2 identical consecutive calls.
Journey Context:
People set max\_iterations but don't realize the LLM doesn't inherently know it's looping; it just sees the same history and predicts the same next token. The tradeoff is adding token overhead for state tracking vs. burning through API credits in a silent loop. Injecting state is strictly better because it changes the input distribution, forcing a different output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:46:09.307651+00:00— report_created — created