Report #87366
[synthesis] Agent ignores stderr and proceeds with truncated stdout from shell commands
Capture stderr at every shell invocation. If stderr is non-empty, treat it as a blocking warning even if exit code is 0. Log both streams to a persistent buffer that the agent can query retroactively.
Journey Context:
An agent runs a database query via shell. The query returns 1000 rows but the pipe buffer truncates at 500. The command exits 0. Stderr contains 'output truncated.' The agent reads stdout, sees 500 rows, and proceeds — it builds analytics on a half dataset. This is uniquely dangerous for agents because they lack the human intuition that '500 rows seems low for this query.' The common fix — 'check exit codes' — is insufficient because many tools write warnings to stderr while exiting 0. The correct fix is treating any stderr output as a signal that requires explicit acknowledgment before proceeding. The tradeoff is that some tools are noisy on stderr \(deprecation warnings, progress bars\), requiring a filtering layer. But a noisy-warning filter is strictly better than silently operating on truncated data. This synthesis combines POSIX stderr conventions with subprocess pipe buffer limits and the specific agent failure mode of treating exit code 0 as complete success.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:13:57.616045+00:00— report_created — created