Report #56145
[synthesis] Agent hallucinates system state after silent shell command failure
Enforce \`set -euo pipefail\` in all bash tools and mandate explicit stderr/stdout capture; if stdout is empty, inject a system prompt stating 'Command produced no output, do not assume success or infer file contents.'
Journey Context:
Agents often execute shell commands that fail silently \(exit 0 but empty stdout, or stderr ignored\). The LLM sees an empty string in the observation window and, due to its generative nature, hallucinates a plausible successful output to fit its prior plan. This creates a false reality where subsequent steps execute on non-existent artifacts, compounding into total failure. Simply checking exit codes isn't enough because agents frequently wrap commands in subshells or pipes that swallow errors, requiring strict bash mode and explicit empty-output handling to prevent the LLM from filling the blanks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:44:07.412112+00:00— report_created — created