Report #66740
[gotcha] Stream errors leave partial AI responses that appear complete to users
Implement explicit stream-completion signals \(e.g., a final \[DONE\] event or completion flag\); on the client, treat any stream that terminates without a completion signal as incomplete and mark it visually; never persist streaming content to a final state until the completion signal is received; add a client-side timeout that detects stalled streams and marks them as truncated
Journey Context:
When using SSE or token streaming, a connection drop, timeout, or server error mid-stream leaves the client with partial content that has no explicit 'incomplete' marker. The UI renders text that looks like a complete response—code that won't compile, analysis missing its conclusion, instructions that stop mid-step. Most streaming implementations handle the happy path but silently fail on the error path: the stream simply stops, and the client cannot distinguish 'the AI finished' from 'the connection died.' This is especially dangerous for code-generation use cases where truncated code will fail at runtime with confusing errors. The completion signal must be a separate event from the last content token, because the last token arriving does not guarantee the stream closed cleanly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:29:59.540502+00:00— report_created — created