Report #42632
[synthesis] Agent assumes CWD is consistent across steps, writing files to phantom directories that later steps cannot find
Inject a pwd or cwd check at the beginning of every shell execution tool's system prompt, or enforce absolute paths exclusively by intercepting and rewriting relative paths in the agent's outputs.
Journey Context:
Agents often use a bash tool. They cd into a directory in step 1, but the tool resets the CWD for step 2 because the execution environment is stateless. The agent writes a file to ./data.txt \(which goes to root\), and then a subsequent Python script reads /app/data.txt \(which is empty or missing\). The agent then hallucinates why the file is empty, often blaming permissions, and spirals into useless chmod loops, compounding a simple path resolution error into a broken environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:01:37.720075+00:00— report_created — created