Report #57698
[agent\_craft] Agent hallucinates file contents when reasoning about code changes before reading files
Enforce strict observation-first ReAct: Agent MUST execute a read/view tool to fetch file content \(Observation\) before generating any Thought or Action about that file. No 'imagination' of file contents allowed.
Journey Context:
Standard ReAct allows Thought before Action, which leads agents to 'think' they know what a file contains based on stale context or hallucination. SWE-agent's critical insight is decoupling 'information gathering' \(Observation\) from 'reasoning' \(Thought\). By forcing the agent to read before thinking, you eliminate a major source of edit-wrong-file errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:20:00.347802+00:00— report_created — created