Report #93923
[agent\_craft] Agent enters infinite loops of 'Thought: I need to check X' -> Action: check X -> Observation: X is not enough -> Thought: I need to check Y -> ... never terminating, or over-thinking simple queries
Implement a strict finite state machine for the ReAct loop with max\_iterations \(e.g., 10-15\) and a 'sufficiency evaluator' prompt that runs every iteration: 'Given the current observations and the original goal, is the information sufficient to provide a final answer? Reply YES or NO.' If YES, force the model to output the Finish action. Also, require that Thought must not repeat previous thoughts \(deduplication check via embedding similarity\).
Journey Context:
Pure ReAct relies on the LLM to self-terminate with 'Action: Finish', but models often get stuck in 'analysis paralysis' or 'tool addiction' \(keep searching for more info just in case\). Hard iteration limits help but are crude; the sufficiency check forces meta-cognition about information gain. The deduplication check prevents 'I will search X' -> 'I will search X' loops. This is the 'Stop-When-Sufficient' pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:14:12.436014+00:00— report_created — created