Skip to content

[v5.0] fix: OpenAI-compatible chat SSE errors lose structured error fields - #17279

Merged
lgrammel merged 2 commits into
release-v5.0from
backport-v5.0/13506-2
Jul 15, 2026
Merged

[v5.0] fix: OpenAI-compatible chat SSE errors lose structured error fields#17279
lgrammel merged 2 commits into
release-v5.0from
backport-v5.0/13506-2

Conversation

@lgrammel

Copy link
Copy Markdown
Collaborator

Background

OpenAI-compatible SSE errors were exposed as message strings, discarding machine-readable codes needed for programmatic error handling.

Summary

The chat stream transformer now forwards the complete parsed SSE error object instead of only its message.

Testing

Updated the existing chat stream regression test and inline snapshot to verify that the error message and code are preserved.

End-to-end Validation

  • pnpm tsx --eval <synthetic SSE fullStream validation> — observed {"message":"Context length exceeded","code":"CONTEXT_LENGTH_EXCEEDED"}.
  • pnpm tsx --eval <live OpenAI-compatible streamText validation> — OpenAI returned OK. with finish reason stop.

Related Issues

Fixes #13506

Backport of #17230

Co-authored-by: StellaCheong59 178243329+StellaCheong59@users.noreply.github.com

@lgrammel
lgrammel merged commit 514775f into release-v5.0 Jul 15, 2026
50 checks passed
@lgrammel
lgrammel deleted the backport-v5.0/13506-2 branch July 15, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant