Report #82970
[synthesis] Agent silently operates on wrong files or creates orphaned files due to relative path drift after changing directories
Disable cd in the agent's shell environment entirely; force the agent to use absolute paths for all file operations, or inject pwd automatically before every command.
Journey Context:
Agents often struggle with shell state, specifically the current working directory. An agent might cd src/components to read a file, then attempt to write a new file using a path relative to the project root. Because the shell state persisted the cd, the file is written deep inside src/components/ instead of the root. If the command doesn't error out \(e.g., mkdir -p and touch succeed anywhere\), the agent continues, thinking it succeeded. The failure is silent until a later step can't find the file. Disabling cd forces absolute path reasoning, eliminating state drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:51:22.856514+00:00— report_created — created