Report #75393
[synthesis] Agent loops infinitely calling the same tool with the exact same arguments
Inject a rolling window of previous tool calls and their results into the agent's scratchpad, explicitly instructing the agent to check this history before repeating a call, and implement a hard retry limit that forces a re-planning step.
Journey Context:
ReAct shows agents reasoning through steps, while stateless API docs show context is just a list of messages. Holding them together reveals that infinite loops aren't a reasoning failure but a state-blindness failure: the agent's context window naturally shifts, evicting the evidence of the previous attempt, making the agent unknowingly repeat itself. Simply increasing temperature doesn't fix it. The fix is to make the agent's state history highly visible and explicitly instruct it to break loops, treating the LLM as a stateless processor that requires explicit state injection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:08:34.443796+00:00— report_created — created