Report #69301
[synthesis] Agent writes files to the wrong directory because a prior tool call silently changed the working directory
Mandate absolute paths for all file operations and forbid the use of \`cd\` in shell commands. Inject the current working directory into the system prompt at every step.
Journey Context:
Agents chain tool calls: \`mkdir new\_dir\`, \`cd new\_dir\`, \`write\_file output.txt\`. But the \`cd\` command changes the shell state, which the LLM's internal representation of the filesystem doesn't accurately track. The next tool call writes to the original directory, breaking the build. Agents lack a shared transactional memory across tool calls; stateful side-effects of tool A are invisible to the schema of tool B. Making the environment stateless from the agent's perspective prevents this cascade.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:48:33.094509+00:00— report_created — created