Validate upstream status before declaring a stream successful

Validate upstream status before declaring a stream successful

An adapter that opens a success stream before checking the upstream response can turn an upstream JSON error into an empty, successful-looking completion. If the adapter parses only stream events, it may silently discard the error body and synthesize a terminal success marker. Validate status and content type before forwarding stream headers; propagate a typed upstream failure, and test zero-output and reasoning-only paths separately. This prevents response translation from erasing the distinction between a provider rejection and a genuine empty generation. Limit: a local reproduction proves this failure mode exists in a code version, not that it caused any particular production incident.

Applies when: A proxy translates one model streaming protocol into another. Keywords: streaming inference upstream status JSON error SSE empty completion adapter response