Repository navigation
fix(responses): respect send queue limits during reconnect - #4000
Conversation
Castiron-Internal-PR: openai/openai-python-internal#184 Castiron-Source-SHA: 33dd40311689b7d1af0fb5b75d6b13b7fa378439 Castiron-Public-Base-SHA: 58aca1d
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. 48 mixed files remain; 2 existing customizations changed. Compared
46 existing customizations unchanged
6 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 36678095668 --repo openai/openai-python \
--name castiron-custom-code-36678095668-1 --dir /tmp/castiron-custom-code-36678095668-1
git apply --stat /tmp/castiron-custom-code-36678095668-1/custom-code.patch
cat /tmp/castiron-custom-code-36678095668-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 58aca1dcfd8d04a3c6352fa2c34b3035ea850f57 e42366a32176c6667eb3ac33c9493b039a88607c
python3 scripts/castiron/custom_code_report.py report \
--base 58aca1dcfd8d04a3c6352fa2c34b3035ea850f57 \
--head e42366a32176c6667eb3ac33c9493b039a88607c --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-e42366a32176
cat /tmp/castiron-custom-code-e42366a32176/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed e42366a32176c6667eb3ac33c9493b039a88607c: no actionable findings. The four explicit is not None checks preserve the manager's configured SendQueue even when empty, while keeping the existing default for omitted queues. The new sync/async manager-entry and reconnect coverage exercises both empty and prequeued paths and verifies byte-limit enforcement and flushing.
Reviewed all three changed files, queue implementation, manager-to-connection handoffs, reconnect/flush methods and test helpers. 28 exact-source, AST-isolated lifecycle cases passed on Python 3.12.12, covering stable/beta sync/async paths, zero/small limits, UTF-8 byte accounting, prequeued messages, reconnect flushes and default construction; four pre-fix-expression controls reproduced the queue replacement. Transport, resource/event-handler and transformation/reconnect-metadata collaborators were mocked, so this was not a full local SDK suite or network test. No temporary files created.
Exact-head hosted lint/build, Python 3.10/3.14 and HTTPX2 tests, CodeQL, breaking-change and Castiron checks passed. The matching-head OkTest report also records 236/236 passing.
Automated Release PR --- ## [3.23.0](openai/openai-python@v3.22.1...v3.23.0) (2026-10-01) ### Features * **agents:** [1/n] return typed answers from session streams ([openai#4007](openai#4007)) ([10f8816](openai@10f8816)) * **agents:** stage files and download turn artifacts ([openai#4009](openai#4009)) ([4fc2438](openai@4fc2438)) * **api:** Add session traces and Realtime translations ([openai#4001](openai#4001)) ([138e3d1](openai@138e3d1)) * **beta:** expose typed application actions as agent tools ([openai#4006](openai#4006)) ([f219c55](openai@f219c55)) * collect final output from beta Agents streams ([157ac4c](openai@157ac4c)) ### Bug Fixes * **api:** allow original image detail in Chat Completions ([openai#4005](openai#4005)) ([8a136c2](openai@8a136c2)) * **api:** correct the eval run cancellation endpoint ([openai#4003](openai#4003)) ([28c5c9a](openai@28c5c9a)) * **api:** retain WebSocket endpoint paths and query parameters ([openai#3999](openai#3999)) ([7f203fd](openai@7f203fd)) * keep Castiron budget results valid when main advances ([openai#4012](openai#4012)) ([73f189b](openai@73f189b)) * **responses:** avoid replaying uncertain typed sends on reconnect ([openai#4011](openai#4011)) ([1dbbf61](openai@1dbbf61)) * **responses:** respect send queue limits during reconnect ([openai#4000](openai#4000)) ([50f95ac](openai@50f95ac)) * use monotonic clock for file processing timeout ([openai#3748](openai#3748)) ([58aca1d](openai@58aca1d)) ### Chores * **api:** retain WebRTC Live session transport types ([openai#4002](openai#4002)) ([5c9ace9](openai@5c9ace9)) * **deps-dev:** bump pyright from 1.1.413 to 1.1.414 ([openai#3902](openai#3902)) ([a91d779](openai@a91d779)) * **deps:** bump astral-sh/setup-uv from 10.0.1 to 10.1.0 ([openai#3976](openai#3976)) ([f15f43c](openai@f15f43c)) * **deps:** bump CodeQL actions to 4.38.1 ([openai#3974](openai#3974)) ([fb70d66](openai@fb70d66)) --- 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>
Summary
Responses WebSocket connections now honor
max_queue_sizeduring reconnect even when no messages were queued before connecting.Changes
WebSocketQueueFullErrorat the configured byte limit and flush admitted messages after reconnect.