Report #70433
[gotcha] SSE stream connection drops silently, leaving a truncated AI response that looks complete to the user
Always check for the stream termination signal \(e.g., the 'data: \[DONE\]' marker in OpenAI's SSE format\) and the finish\_reason on the final chunk before marking a response as complete; if the stream ends without these signals, show a 'response may be incomplete' warning and offer a retry; never assume a closed stream is a completed stream
Journey Context:
When a streaming SSE connection drops due to network issues, timeout, or server-side errors, the client receives the last chunk and then nothing else. The partial response is already rendered in the UI and looks like a complete response. There is no error thrown in most SSE implementations — the stream simply closes and the event listener fires a completion event. Users read the truncated output and assume it's the full answer, which can be dangerous if the truncation removes important caveats, code closers, safety warnings, or the second half of a comparison. The fix is to never assume a stream that closed is a stream that completed. Check for the explicit completion signal — OpenAI uses 'data: \[DONE\]' and a final chunk with finish\_reason. If these are missing, the response was truncated and the user needs to know. This is especially critical for code-generation UIs where a truncated code block will fail at runtime.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:48:11.713302+00:00— report_created — created