Repository navigation
feat(api): support WebSocket warmup and preserve cleanup cancellation - #4215
Conversation
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. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Request changes at 989c8cd. The existing cleanup cancellation finding remains valid: when the context body already raised, BaseException handling suppresses a new CancelledError from close(), replacing cancellation with the earlier ordinary error. Preserve cancellation and process-control exceptions in all affected WebSocket managers while retaining ordinary cleanup-error handling. Referencing the existing finding rather than adding a duplicate inline comment. The author responses address overload ellipses, not this issue. Coordinator and independent static review covered the complete diff, parser forwarding, request fields and cleanup paths. Hosted CI: 17 passed, 9 skipped. No candidate code or tests ran locally.
989c8cd to
7eca97c
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at 7eca97c. Coordinator and independent static review of all15 changed files found no blockers. Narrowing both exit handlers to Exception across all seven WebSocket products preserves fresh cancellation/process-exit signals while retaining ordinary body-error precedence. The cancellation regression covers task cancellation during close with an existing body error. Optional generate preserves omission and explicit false consistently in stable/beta sync/async helpers and event models. Existing cancellation feedback is addressed. Hosted CI:15 successful,9 skipped,2 pending (Python3.14 and OkTest). No candidate code, tests, builds or generators ran locally.
Castiron-Internal-PR: openai/openai-python-internal#387 Castiron-Source-SHA: 23639b55f961a781c648a7ca87fbe57660295116 Castiron-Public-Base-SHA: 85bb536
7eca97c to
8b414d2
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at 8b414d2. Coordinator and independent static review found no new actionable issues. The public/private file trees match. The rebase preserves request-local Azure credentials and the previously reviewed WebSocket generate/parse_as behavior. Cleanup catches ordinary Exception while allowing cancellation and process-control exceptions to propagate; the prior cleanup finding is fixed. Generated-file hashes match. Hosted CI remains pending. No candidate code or tests ran locally.
Automated Release PR --- ## [3.42.0](openai/openai-python@v3.41.0...v3.42.0) (2026-10-31) ### Features * **api:** add agent context compaction settings ([openai#4209](openai#4209)) ([f552fcf](openai@f552fcf)) * **api:** add agent session review and tool settings ([openai#4217](openai#4217)) ([a63c4cd](openai@a63c4cd)) * **api:** add experimental agent time awareness ([openai#4211](openai#4211)) ([10f9dd0](openai@10f9dd0)) * **api:** add image edit markup overlays ([openai#4210](openai#4210)) ([72c656d](openai@72c656d)) * **api:** add organization external key management ([openai#4205](openai#4205)) ([3ee373e](openai@3ee373e)) * **api:** add SIP DTMF commands and delivery events ([openai#4208](openai#4208)) ([f9f3f76](openai@f9f3f76)) * **api:** improve WebSocket recovery and delivery reporting ([openai#4213](openai#4213)) ([68b962c](openai@68b962c)) * **api:** keep callable API keys scoped to each request ([openai#4216](openai#4216)) ([85bb536](openai@85bb536)) * **api:** support response format updates and local output types ([openai#4212](openai#4212)) ([bd61e84](openai@bd61e84)) * **api:** support WebSocket warmup and preserve cleanup cancellation ([openai#4215](openai#4215)) ([9abd656](openai@9abd656)) ### Bug Fixes * preserve refusal output and authentication in WebSocket helpers ([openai#4214](openai#4214)) ([0599203](openai@0599203)) --- 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>
Add optional
generateto stable and beta Responses WebSocket create events. An unset field stays absent from the request; explicitfalseandtruestay on the wire.Preserve cancellation raised while a WebSocket connection closes, even when the context body already raised an error. The seven Realtime, translation, Live, and Responses manager paths still preserve the original body error if ordinary cleanup fails. Their cleanup handlers catch
Exception, so cancellation and other process-control exceptions propagate.Validation: 2,014 tests passed against installed SDK wheels across Pydantic v1 and v2. Each environment passed 940 core tests, eight warmup tests, five parsing tests, four tool-runner configuration tests, and 50 authentication tests. The final comparison preserves the parsing and tool-runner behavior already on public main.