Report #87994
[gotcha] Streaming JSON/structured output can't be incrementally rendered, defeating the purpose of streaming
For structured output endpoints, use incremental JSON parsers \(e.g., partial-json or json-stream libraries\) to extract and render partial fields as they arrive. Alternatively, use a hybrid architecture: stream a natural-language summary for immediate UX, then deliver the structured payload non-streaming once complete.
Journey Context:
The whole point of streaming is progressive output and reduced perceived latency. But when the output must be valid JSON \(tool call arguments, structured data\), partial tokens produce invalid JSON that cannot be parsed. The result is the worst of both worlds: you pay the complexity cost of streaming infrastructure but the UI shows nothing until the full response arrives. Teams discover this only when they try to stream tool call arguments and find their JSON parser throwing on every intermediate chunk. Incremental JSON parsing works but is fragile — field boundaries can split across tokens. The hybrid approach \(stream text, deliver structure\) is more robust but requires two generation passes or careful prompt design.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:17:06.582625+00:00— report_created — created