Report #8219
[agent\_craft] ReAct agent hallucinates tool results or enters infinite loops
Enforce strict separation: Generate 'Thought:' and 'Action:' \(with tool call\) by the LLM, then STOP. Inject the real 'Observation:' \(tool output\) via code, then prompt again for next 'Thought:'. Never let the LLM generate the word 'Observation'.
Journey Context:
A common implementation error is allowing the LLM to continue generating after the Action, resulting in hallucinated observations like 'Observation: The tool returned success' when it actually failed. This breaks the loop because the agent acts on false data. The ReAct \(Reasoning \+ Acting\) paper specifies that observations come from the external environment, not the LLM. Implementation requires a stop sequence of 'Observation:' and programmatic injection of the actual tool return value before the next LLM call.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:52:24.256081+00:00— report_created — created