Skip to content

fix(streaming): reject named SSE provider error events - #2409

Merged
HAYDEN-OAI merged 2 commits into
mainfrom
codex/sse-named-error-frames-20260818-2249
Aug 18, 2026
Merged

HAYDEN-OAI merged 2 commits into
mainfrom
codex/sse-named-error-frames-20260818-2249

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • Reject named SSE event: error frames as typed APIErrors instead of yielding flat provider failures as successful Chat Completions, Responses, and Assistants stream events.
  • Preserve nested provider errors, request headers and request IDs, cancellation, ordinary named events, Assistant event envelopes, completion sentinels, and private malformed-event diagnostics.
  • Remove the unreachable error check from the Assistant-only branch and add 19 public-API and exported-stream regression cases.

Validation

  • Regression-first on untouched main: all three actual new OpenAI({ fetch }) public streaming APIs and both exported event-synthesis modes incorrectly fulfilled before the fix.
  • OPENAI_TEST_SUITE=unit pnpm test -- --maxWorkers=6 — 3,531 handwritten tests passed.
  • OPENAI_TEST_SUITE=generated pnpm test -- --runInBand — 559 generated tests passed.
  • pnpm lint — zero errors and warnings.
  • pnpm exec tsc --pretty false; pnpm build.
  • Published source type-checked with TypeScript 4.9 and 6.
  • pnpm exec publint dist; packed-package CommonJS, ESM, and 267 source checks passed on Node 22.23.2 and 26.7.0.
  • Dedicated 19-case streaming regression passed on Node 22 and Node 26.

@HAYDEN-OAI
HAYDEN-OAI requested a review from a team as a code owner August 18, 2026 23:10
@openai-sdks

openai-sdks Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 237/237 SDK tests passed in 8.525s for Node SDK PR #2409.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 89ms
tests/chat-completions-create.test.ts ✅ Passed 185ms
tests/chat-completions-stream.test.ts ✅ Passed 100ms
tests/files-content-binary.test.ts ✅ Passed 111ms
tests/files-create-multipart.test.ts ✅ Passed 107ms
tests/files-list-pagination.test.ts ✅ Passed 109ms
tests/initialize-config.test.ts ✅ Passed 98ms
tests/instance-isolation.test.ts ✅ Passed 85ms
tests/models-list.test.ts ✅ Passed 99ms
tests/responses-background-lifecycle.test.ts ✅ Passed 171ms
tests/responses-body-method-errors.test.ts ✅ Passed 242ms
tests/responses-cancel-timeout.test.ts ✅ Passed 169ms
tests/responses-cancel.test.ts ✅ Passed 165ms
tests/responses-compact-retries.test.ts ✅ Passed 178ms
tests/responses-compact.test.ts ✅ Passed 159ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 93ms
tests/responses-create-advanced.test.ts ✅ Passed 146ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.158s
tests/responses-create-errors.test.ts ✅ Passed 161ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 91ms
tests/responses-create-retries.test.ts ✅ Passed 116ms
tests/responses-create-stream-failures.test.ts ✅ Passed 170ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.124s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.092s
tests/responses-create-stream.test.ts ✅ Passed 64ms
tests/responses-create-terminal-states.test.ts ✅ Passed 160ms
tests/responses-create-timeout.test.ts ✅ Passed 175ms
tests/responses-create.test.ts ✅ Passed 109ms
tests/responses-delete.test.ts ✅ Passed 85ms
tests/responses-input-items-errors.test.ts ✅ Passed 131ms
tests/responses-input-items-list.test.ts ✅ Passed 136ms
tests/responses-input-items-options.test.ts ✅ Passed 79ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 176ms
tests/responses-input-tokens-count.test.ts ✅ Passed 151ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.679s
tests/responses-not-found-errors.test.ts ✅ Passed 191ms
tests/responses-parse.test.ts ✅ Passed 124ms
tests/responses-retrieve-retries.test.ts ✅ Passed 236ms
tests/responses-retrieve.test.ts ✅ Passed 204ms
tests/responses-stored-method-errors.test.ts ✅ Passed 470ms
tests/retry-behavior.test.ts ✅ Passed 3.009s
tests/sdk-error-shape.test.ts ✅ Passed 225ms

View OkTest run #32196970553

SDK merge (3798bdfa5590) · head (44b730c36bbf) · base (2097ba0902cc) · OkTest (7e7850017529)

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent two-pass review: named SSE provider errors are correctly converted into APIError while preserving nested error behavior, response metadata, request IDs, assistant envelopes, cancellation, and sanitized malformed-event diagnostics. No actionable findings.

@HAYDEN-OAI
HAYDEN-OAI added this pull request to the merge queue Aug 18, 2026
Merged via the queue into main with commit b7a0bd6 Aug 18, 2026
29 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the codex/sse-named-error-frames-20260818-2249 branch August 18, 2026 23:34
@openai-sdks openai-sdks Bot mentioned this pull request Aug 18, 2026
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.

2 participants