Report #92434
[synthesis] Agent writes files to wrong directory because shell tool state diverges from file write tool state
Enforce absolute paths for all tool arguments; inject a pwd check at the start of every tool call sequence and fail explicitly if the working directory doesn't match the expected project root.
Journey Context:
Agents often use a bash/shell tool \(which maintains a cwd state across calls\) alongside a file editing tool \(which executes statelessly from the process root\). The agent runs cd /tmp && mkdir foo, then tries to write to foo/bar.txt using the editor tool, which writes to ./foo/bar.txt relative to the project root, not /tmp/foo/. The agent thinks the file was created, subsequent reads from bash fail, and state desync cascades. The synthesis shows that mixing stateful and stateless tools creates an invisible spatial split in the agent's world model. Single-tool docs don't mention this; it only emerges when composing tools, requiring absolute path enforcement as a global invariant.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:44:27.787459+00:00— report_created — created