SIGN IN SIGN UP

fix(openai): handle premature SSE stream termination with terminal error emission

- Propagate pending terminal errors when image/response data streams close, emitting `error`/`failed` SSE events (or HTTP error responses when no stream started) instead of dropping them.
- Sanitize and normalize streamed terminal errors before writing, and reuse normalized errors for cancellation.
- Improve SSE parsing/frame handling for multiline and cross-chunk payloads, prioritize payload/event-level failures, and avoid mutating emitted frame buffers by cloning chunks before queueing.

Closes: #4904
L
Luis Pater committed
522b4de54a8d1f126226d1000080fd77078f7ae1
Parent: 934da23