Streaming tokens from an LLM response parse into malformed JSON mid-stream
Streaming structured output: client gets tokens as they arrive and tries to parse partial JSON progressively for UI updates (showing fields as they complete). 15-20% of streams produce unparseable intermediate states even though the final stream is valid. Current approach (trying JSON.parse on every token) fails on every partial stream.