Repository navigation
fix: clean up failed WebSocket setup and honor native options - #4121
Conversation
Castiron custom codeEvaluated main: Trusted main policy: ✅ No new custom-code files detected. 39 mixed files remain; 0 existing customizations changed; 7 generated baselines changed. Compared
32 existing customizations unchanged
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 39459981097 --repo openai/openai-python \
--name castiron-custom-code-39459981097-1 --dir /tmp/castiron-custom-code-39459981097-1
git apply --stat /tmp/castiron-custom-code-39459981097-1/custom-code.patch
cat /tmp/castiron-custom-code-39459981097-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 0e5794dc48b8f8d51f6047f8a0b1814eb1e65850 791ea571192b0c628bef4fdffe32e17ab33eeb7c
python3 scripts/castiron/custom_code_report.py report \
--base 0e5794dc48b8f8d51f6047f8a0b1814eb1e65850 \
--head 791ea571192b0c628bef4fdffe32e17ab33eeb7c --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-791ea571192b
cat /tmp/castiron-custom-code-791ea571192b/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
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. |
f0bbe5b to
fc25578
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at fc25578. Reviewed the public diff and independently verified promotion parity with approved internal #295 at 65a672c7: all 16 changed source/test/manifest files match exactly, with only public-codegen metadata differing. Supporting WebSocket helpers, client and dependency configuration also match.
No actionable findings. Failed entry closes the acquired transport while preserving the original exception; synchronous options use the native synchronous type. Unlimited receives disable implicit compression, while explicit limits, compression and extensions remain preserved. The increased-network-traffic tradeoff is documented. The compiler source change has merged.
Hosted checks passed or were appropriately skipped, and exact-head OkTest passed 236/236. Static review only; no candidate code or tests were run locally.
fc25578 to
f28ed29
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-approved after static incremental review. Exact old/new commit tree comparison shows only the generated WebSocket compression test changed; the complete updated file matches approved internal #295 at 336965e2. The 18 added cases verify exact receipt above 2 MiB across nine routes in sync/async modes without implicit compression. No actionable findings. Hosted CI/OkTest are still running; no local candidate code or tests executed.
f28ed29 to
0dec5f3
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-approved after independent static review and exact old/new tree comparison. Only two test files changed, both byte-identical to approved internal #295 at 3f51cc8b: the bounded WebSocket peer-readiness barrier and atomic descendant-PID publication. Both preserve the substantive assertions; runtime files are unchanged. No actionable findings. Hosted Python3.10/3.14 and HTTPX2 checks now pass, and OkTest reports 236/236. No candidate code or tests executed locally.
Castiron-Internal-PR: openai/openai-python-internal#295 Castiron-Source-SHA: 5fbf16077384d56a8645730663af13b8d2834ff6 Castiron-Public-Base-SHA: 0e5794d
0dec5f3 to
791ea57
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved after coordinator and independent static review of 791ea57 against approved 0dec5f3. The eight changed source/schema/test blobs match current main; generation statistics and manifest reflect that update, including verified hashes for the six inherited compaction type files. Prior WebSocket implementation and tests are byte-identical. No new actionable findings. Hosted CI is still running; no candidate code or tests executed locally.
Project API-key updates require scopes, an expiration, or both. Record this existing rule with required-only `anyOf`, and supply valid scopes bodies in synchronous and asynchronous update tests. Runtime source, WebSocket documentation, and published WebSocket tests are unchanged from the public baseline, including the defaults introduced in openai#4121. Validation: 340 published WebSocket tests passed; the reporting-helper suite passed (99 tests, one skipped); scoped lint and formatting passed. The trusted public-main custom-code budget is 7,352 / 10,000. Two fresh independent adversarial review rounds were clean. Current hosted validation is tracked on this PR. Co-authored-by: jbeckwith-oai <269036200+jbeckwith-oai@users.noreply.github.com>
Summary
Close acquired WebSocket transports when connection setup fails, and use native synchronous option types for synchronous connections and Translation sessions. Preserve explicit caller options across Realtime, Live, Responses, Translation and legacy Beta Realtime.
Unbounded receives disable implicit compression by default. Finite receive limits keep the native compression default, and callers can explicitly configure compression or extensions. Disabling compression can increase network traffic.