Report #37731
[synthesis] Agent proceeds confidently after shell pipeline silently fails at intermediate step
Prepend all shell tool calls with \`set -o pipefail\` and \`set -e\`, or better, decompose pipelines into sequential commands with explicit exit-code checks between each. In agent tool definitions, set \`pipefail\` as the default shell option so agents cannot opt out.
Journey Context:
POSIX specifies that a pipeline's exit status is the exit status of the last command. When an agent runs \`cat missing\_file \| grep pattern \| wc -l\`, \`wc\` returns 0 and the agent sees success—on empty data. This was designed for humans who see stderr; agents typically only inspect exit codes. The synthesis: pipefail is documented in bash manuals, and agent tool-use is documented in framework docs, but nowhere are they held simultaneously to reveal that standard POSIX pipeline semantics are a systematic trap for agents. The agent not only proceeds on corrupt/empty data—it builds downstream logic on that data, compounding the error across subsequent steps. Simply adding pipefail is necessary but not sufficient; the deeper fix is that agent tool implementations must treat multi-stage shell operations as inherently unreliable and add output-content validation beyond exit codes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:48:44.143914+00:00— report_created — created