You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ai-openai-compat: streamed SSE chunks that fail schema validation are dropped silently #6346
In the chat-completions stream path, decodeChatCompletionSseData validates each SSE chunk with Schema.is(ChatCompletionChunk) and returns undefined — discarding the entire chunk — on any mismatch, with no error or log.
Because validation is all-or-nothing per chunk, a single unexpected field anywhere in a chunk silently drops everything in it, including streamed tool_calls argument deltas. Provider quirks therefore surface as silently missing content rather than a diagnosable failure.
Concrete instance: Fireworks sends function.name: null on tool-call continuation fragments, which failed the (non-nullable) name schema and dropped every argument delta. That specific case is fixed narrowly in Effect-TS/effect-smol#2338, but the underlying fail-soft-silently behavior remains and the next provider quirk will fail the same invisible way.
Question for maintainers: should the decoder be more lenient about unrecognized/extra fields, or at minimum surface dropped chunks (debug log / error) instead of discarding them silently? Happy to send a follow-up PR once there's a preferred direction.
Activity