Report #36945
[gotcha] Streaming structured output creates broken intermediate UI states
Use incremental JSON parsers \(e.g., partial-json, json-stream\) or accumulate tokens and parse only on complete message boundaries; render skeleton or placeholder UI during accumulation rather than exposing raw partial JSON to users
Journey Context:
When streaming JSON mode or function call responses, each SSE chunk contains partial JSON that fails standard JSON.parse\(\). Developers naturally try to render progress incrementally, but partial JSON is syntactically invalid — you cannot display a half-formed object. The counter-intuitive realization: streaming structured output often provides worse UX than buffered output because you must accumulate the full response before rendering anything meaningful. The tradeoff is between perceived speed \(tokens flowing\) and usable speed \(parsed, renderable content\). For structured output, buffered rendering with a thinking indicator frequently outperforms raw streaming because users never see broken intermediate states.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:29:27.842994+00:00— report_created — created