Repository navigation
fix(realtime): preserve native WebSocket error causes - #2715
Conversation
Native error events were reported with a null cause and, on Node 24+, an empty message; pass the event's error through like the ws transport.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 773b1d4399
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
💡 Codex Reviewopenai-node/tests/realtime-websocket.test.ts Lines 261 to 264 in 773b1d4 This regression only dispatches handcrafted objects through AGENTS.md reference: AGENTS.md:L18-L21 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed with Codex at 773b1d43990cee7d4b35e3d646e246c5d0ac1f70. Traced the stable and beta WebSocket listeners through shared error normalization, including native browser fallback behavior and ws parity. No actionable correctness or compatibility findings in the error-cause preservation. LGTM.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Castiron custom code✅ No new custom-code files detected. 45 mixed files remain; 0 existing customizations changed. Compared 45 existing customizations unchanged
5 more in the full report. A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 35126117906 --repo openai/openai-node \
--name castiron-custom-code-35126117906-1 --dir /tmp/castiron-custom-code-35126117906-1
git apply --stat /tmp/castiron-custom-code-35126117906-1/custom-code.patch
cat /tmp/castiron-custom-code-35126117906-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin e39037b169234de022ba1d98e0cdb7c5cd8374bd 91bdcf4bc91858a9e149ebd6f851c58b9dab5750
python3 scripts/castiron/custom_code_report.py report \
--base e39037b169234de022ba1d98e0cdb7c5cd8374bd \
--head 91bdcf4bc91858a9e149ebd6f851c58b9dab5750 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-91bdcf4bc918
cat /tmp/castiron-custom-code-91bdcf4bc918/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Automated Release PR --- ## [7.17.0](v7.16.0...v7.17.0) (2026-09-16) ### Features * **api:** add compaction progress events ([#2749](#2749)) ([425502d](425502d)) ### Bug Fixes * **ci:** retry transient Deno download failures ([#2752](#2752)) ([e39037b](e39037b)) * preserve chat runner abort reasons ([#2607](#2607)) ([eda4d0c](eda4d0c)) * **realtime:** preserve native WebSocket error causes ([#2715](#2715)) ([58fa72a](58fa72a)) * **responses:** reject function-based API keys in WebSocket constructors ([#2586](#2586)) ([eea7618](eea7618)) * **runners:** reject unfinished turns in streaming runTools ([#2716](#2716)) ([937ed67](937ed67)) * **streaming:** emit terminal SSE events missing a trailing blank line ([#2726](#2726)) ([94d6418](94d6418)) * **zod:** omit impossible optional branch in strict schemas ([#2751](#2751)) ([2b4c2c7](2b4c2c7)) ### Chores * update lint tooling and tailor anti-slop for the SDK ([#2753](#2753)) ([21a03c2](21a03c2)) ### Documentation * **examples:** preserve split UTF-8 in raw stream consumer ([#2714](#2714)) ([f44152a](f44152a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Changes being requested
Native socket failures lost their cause in the stable and beta WebSocket transports, leaving an empty error message on the measured Node 24 and 26 connection failures.
The listeners now forward the event's error as
causeand choose the first non-empty event or cause message, falling back tounknown error.Browser events without either field and the
wstransports keep their existing behavior.Additional context & links
Regressions cover the measured event shapes and message fallback in both transports. A separate unmocked test opens Node's native WebSocket through each public entrypoint against a local TCP peer that closes the connection, then verifies the resulting message and exact native cause identity. The native regressions fail before the fix and pass with it on Node 22.0.0, 24.19.0, and 26.2.0; all 126 realtime tests, lint, and TypeScript checks pass.