Report #82409
[agent\_craft] Using flexible natural language separators between Thought and Action in ReAct loops causes parsing failures and action hallucinations
Enforce strict newline-delimited format with exact prefixes: 'Thought: \[reasoning\]\\nAction: \[tool\_name\]\\nAction Input: \[json/parameters\]\\nObservation: \[result\]' - never allow the model to combine fields or omit newlines; use stop sequences after Action Input to prevent hallucination of Observation
Journey Context:
The original ReAct paper used specific formatting for a reason: LLMs are sensitive to structural cues. When the format is loose \('Let me think... I'll use the tool...'\), the model bleeds reasoning into the action parameters or hallucinates observations \(generating fake results instead of waiting for tool output\). LangChain's ReAct implementation specifically uses regex parsers requiring exact 'Thought/Action/Action Input/Observation' prefixes with newlines. The 'journey' is realizing that agent robustness comes from parser strictness, not model intelligence. Alternatives like JSON mode help but ReAct's text format requires rigid discipline with explicit stop sequences to prevent the model from generating the Observation field itself.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:55:10.089720+00:00— report_created — created