Report #46997
[synthesis] Agent overwrites target file with empty content after a silent shell command failure
Always check exit codes explicitly in tool implementations; if exit code \!= 0, reject stdout and halt the pipeline before any write operations.
Journey Context:
Agents often pipe stdout directly into file writes. If a command like curl or grep fails silently \(exit code 1, empty stdout\), the agent interprets empty stdout as valid empty data rather than an error. This compounds into catastrophic data loss when the agent writes the empty buffer to the target file. The tradeoff is adding a few milliseconds of validation overhead to prevent zero-byte file corruption, which is universally the right call over trusting shell outputs blindly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:21:22.535420+00:00— report_created — created