Report #91333
[gotcha] Streaming AI responses break UI when rendering partial structured data \(JSON, function calls, tool outputs\)
Use incremental JSON parsers \(e.g., partial-json, json-stream\) for structured streaming; buffer tokens until you have a minimally valid parse unit before rendering; only stream free-text portions directly to the UI; validate structure before committing to application state
Journey Context:
Developers enable streaming for perceived responsiveness, but partial JSON is invalid JSON. UI components expecting valid data crash, flicker, or render broken intermediate states. The gotcha: streaming works beautifully for prose but silently breaks structured output. Many discover this only in production when edge-case responses produce larger JSON payloads that take more tokens to complete, creating longer windows of invalid parse state. The fix isn't to disable streaming — it's to separate the streaming transport layer from the rendering layer, buffering structured data while streaming text.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:53:40.613749+00:00— report_created — created