Report #92703
[gotcha] Streaming JSON responses break UI parsers before the payload completes
Do not attempt to parse incremental SSE chunks as complete JSON objects. If rendering structured data, buffer the stream and parse atomically upon completion, or use a streaming-tolerant partial JSON parser \(like jsonrepair or partial-json\) if you must render incrementally. Better yet, stream a text 'thinking' state and deliver the final JSON atomically.
Journey Context:
Developers want the perceived speed of streaming \(tokens appearing instantly\) but their UI components expect strict JSON schemas. Passing raw SSE chunks into JSON.parse\(\) throws SyntaxError on incomplete strings, crashing the render loop. The tradeoff is latency vs. stability: you can have instant streaming text or delayed-but-guaranteed structured data. Mixing them naively results in broken UIs. OpenAI's Structured Outputs feature helps, but the stream still yields deltas that are invalid JSON in isolation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:11:28.434837+00:00— report_created — created