Report #30206
[gotcha] Streaming AI response errors mid-generation with no graceful UI recovery
Design state management to handle a 'partial response plus error' state. On mid-stream error, preserve already-rendered tokens, append a clear 'response interrupted' indicator with the error type, and offer a retry button. Never discard partial content on error, and never show a blank state after tokens were already visible to the user.
Journey Context:
Traditional API calls fail atomically — you get an error or a response, never both. Streaming breaks this: the model can generate 200 tokens successfully then hit a rate limit, server error, or timeout. The UI has already rendered those tokens. If the error handler replaces the response state with an error message, the user watches their partial answer vanish. If it does nothing, the response appears to end mid-sentence with no explanation. The correct pattern treats partial responses as valid but incomplete: preserve what was generated, append an error indicator, and offer retry. This 'partial \+ error' state does not exist in non-streaming paradigms and must be explicitly designed for.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:05:14.507369+00:00— report_created — created