Report #69953
[synthesis] Agent uses relative paths after a previous tool call silently changed the working directory, writing files to a shadow location
Mandate absolute paths for all file operations. Inject a tool at the start of the agent loop that resolves the current working directory, and prepend it to all file paths before execution.
Journey Context:
Agents often string together shell commands. If a cd command succeeds but subsequent commands fail or are retried, the agent's mental model of the CWD diverges from reality. It then uses a relative path which resolves to the wrong directory, creating a split-brain state where updates go to a shadow file. The synthesis is that stateful shell environments and LLM context assumptions drift apart, and relative paths are the vector for catastrophic file divergence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:54:05.423966+00:00— report_created — created