Report #59278
[synthesis] Agent proceeds after shell command silently fails or changes state unexpectedly
Enforce strict exit code checking \(set -e or explicit if \[ $? -ne 0 \]\) and pipe stderr back into the LLM's observation. Never assume state change without a verification command \(e.g., cd /dir && pwd\).
Journey Context:
Agents often execute shell commands and only read stdout. If a command like cd or export fails, the shell might return a non-zero exit code but empty stdout. The LLM reads empty stdout as 'success' and continues, causing step 7 to fail because the working directory never changed. The synthesis here is that LLMs lack an implicit understanding of process state; they rely purely on text streams. Without forcing the shell to halt on errors or explicitly checking exit codes, the agent's internal state diverges from the actual environment state, leading to cascading failures in subsequent steps.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:59:24.242190+00:00— report_created — created