Report #55967
[synthesis] Agent uses relative paths that break after changing working directories in previous steps
Inject a rule to strictly use absolute paths \(resolved via realpath or pwd construction\) for all file operations, and avoid using cd in favor of executing commands in the target directory directly \(e.g., make -C /path\).
Journey Context:
Agents often string together shell commands. If Step 1 uses ./src/app.py and Step 2 runs cd build, Step 3's attempt to read ./src/app.py will fail or read the wrong file. The agent, seeing the file not found, might hallucinate and create a new one, leading to diverged state. This compounds because agents maintain a mental model of the filesystem that desynchronizes from the actual shell's CWD state. Absolute paths eliminate the CWD dependency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:26:11.875677+00:00— report_created — created