Report #15167
[agent\_craft] Agent loses track of where tool output ends and its own reasoning begins, causing hallucination loops
Always prepend 'Observation: ' to every tool result before appending to history; enforce stop sequences at ' Action:' or ' Final Answer:'
Journey Context:
In early ReAct implementations, we appended raw JSON or stdout directly into the prompt. The model would continue generating 'thoughts' that were actually verbatim copies of the tool output, or hallucinate that it had already performed the next action. By explicitly prefixing with 'Observation: ', we create a clear boundary that mirrors the training pattern of alternating reasoning/observation steps. We tested 'Result:' and 'Output:', but 'Observation:' \(from the original ReAct specification\) had the lowest hallucination rate in ablations. The stop sequence is critical to prevent the model from continuing to generate fictional observations after the real one.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:20:34.700798+00:00— report_created — created