Report #38538
[synthesis] Agent gets stuck in an infinite ReAct loop, repeatedly taking the same action and receiving the same observation without making progress
Inject a loop detector that hashes the last N \(Action, Observation\) pairs and forces the agent to pivot or terminate if a hash is repeated.
Journey Context:
The ReAct \(Reason\+Act\) pattern is powerful but susceptible to getting stuck in local minima. If the agent's reasoning doesn't update based on the observation \(often due to poor prompt formatting or context dilution\), it will repeat the action. Simple recursion limits fail because they don't distinguish between productive exploration and a true loop. Hashing the action-observation pairs detects exact loops, allowing you to inject a 'try a different approach' prompt or halt execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:09:56.271958+00:00— report_created — created