Report #43998
[synthesis] Agent reports file write success but file is incomplete or truncated due to silent streaming failures or token limits mid-stream
Implement atomic write-verify-commit: stream to temp file, calculate SHA-256 checksum, compare against expected length/hash, then POSIX atomic rename to target only if valid.
Journey Context:
Standard practice trusts HTTP 200 or 'finish\_reason' as success, but chunked transfer encoding, middle proxies, and hard token limits can silently truncate final bytes. The 'success' signal fires on stream close, not content verification. Atomic rename ensures visibility only after integrity check, preventing partial file exposure that agents interpret as 'task complete'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:19:20.680607+00:00— report_created — created