Report #24483
[gotcha] Streaming AI responses create irreversible UI states — partial content already shown cannot be un-shown on mid-stream error
Render streaming tokens with provisional visual treatment \(dimmed opacity, pulsing cursor, distinct background\) that only transitions to 'final' state after the stream completes successfully. Implement mid-stream error UI that gracefully degrades — show what was generated with a warning badge rather than replacing with a generic error message.
Journey Context:
Developers adopt streaming purely as a latency optimization without recognizing it inverts the error-handling model. In request-response, you validate-then-render; in streaming, you render-then-validate. If the stream errors mid-way \(network drop, content policy trigger at token 200 of 500, token limit hit\), you have already committed pixels to the screen. Wrapping the stream in try/catch at the call site does nothing — the error happens after rendering has begun. The naive fix of buffering everything defeats the purpose of streaming. The correct approach is to make the streaming state visually and semantically distinct from the final state, so users understand the response is provisional until the stream completes. This is especially critical for consumer products where mid-stream policy refusals create a jarring experience if the UI has no plan for partial responses.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:30:25.954730+00:00— report_created — created