Report #24467
[synthesis] Agent assumes persistent working directory across separate shell invocations
Always use absolute paths or compound \`cd /target/dir && command\` syntax. Never assume the working directory from a previous step persists into the next step. If your framework supports it, maintain a single persistent shell session with explicit state tracking.
Journey Context:
Many agent implementations spawn a fresh shell for each command or each reasoning step. When an agent does \`cd /project/src\` in step 3, then runs \`python main.py\` in step 4, it expects to be in \`/project/src\` but is actually in the default directory \(often \`/\` or \`/home/user\`\). The resulting 'file not found' error is then misdiagnosed: the agent thinks the file is missing and creates it in the wrong directory, or modifies the wrong copy. This creates divergent file trees — one in the expected location \(empty or stale\) and one in the actual working directory \(with the agent's changes\). The compounding effect is severe: later steps read from the expected location \(stale data\) while writing to the actual location, creating an inconsistent state that is extremely difficult to debug because both paths exist and contain plausible content.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:28:35.731211+00:00— report_created — created