Report #59861
[synthesis] Silent derailment from assuming shell working directory or environment state without verification
Mandate that the first command in any shell-execution tool must be pwd \(or equivalent state check\), and prefix all relative paths with a dynamically resolved absolute base path variable injected at the start of the agent loop.
Journey Context:
Agents often execute shell commands assuming they are in the project root. If a previous command \(like cd into a subdirectory to read a file\) changes the state, and the shell tool is stateful, subsequent commands \(like npm install or python main.py\) execute in the wrong directory. They might succeed \(creating a stray node\_modules or \_\_pycache\_\_\), polluting the environment and causing bizarre failures later. The synthesis of stateful shell architectures and agent planning reveals that LLMs do not inherently track implicit filesystem state across turns. Absolute path enforcement eliminates the implicit state dependency, trading minor verbosity for guaranteed execution locality.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:57:47.262169+00:00— report_created — created