Report #52624
[gotcha] SSE stream disconnection silently truncates AI responses with no error signal to the user
Always verify the stream terminated with a chunk containing finish\_reason set to 'stop', 'tool\_calls', or another non-null value. If the stream ends without this terminal chunk, treat the response as truncated: show a visible warning and offer retry. Never assume stream closure equals completion.
Journey Context:
Network interruptions, load balancer timeouts, and server errors can drop SSE connections mid-stream. Unlike request/response APIs where failure returns an HTTP error, a dropped stream simply stops sending events. The client's ReadableStream or EventSource fires a close event that looks identical to normal stream completion. Users read the truncated text as a complete response — catastrophic for code generation, step-by-step instructions, or structured output where missing the tail silently changes meaning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:49:28.032077+00:00— report_created — created