Skip to content

Streaming Responses Fail with Failed to parse JSON after multiple chunks. #1189

@mikestaub

Description

@mikestaub

I see this when using some OpenAI compatible models.

Likely root cause:

Interactive chat sessions were intermittently aborting when the UI attempted to
stream assistant messages. The React SDK delegated streaming to
@tambo-ai/typescript-sdk’s advanceStream, which tries to JSON.parse each
newline-delimited SSE chunk as it arrives. Under normal network conditions the
server can split a single JSON payload across multiple TCP frames, so the client
occasionally received incomplete JSON and threw Failed to parse JSON after multiple chunks.—terminating the stream and surfacing an error toast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions