Skip to content

fix: preserve explicitly provided send queues - #3742

Open
Hughhhhcoder wants to merge 1 commit into
openai:mainfrom
Hughhhhcoder:codex/openai-python-send-queue-identity
Open

fix: preserve explicitly provided send queues#3742
Hughhhhcoder wants to merge 1 commit into
openai:mainfrom
Hughhhhcoder:codex/openai-python-send-queue-identity

Conversation

@Hughhhhcoder

@Hughhhhcoder Hughhhhcoder commented Aug 27, 2026

Copy link
Copy Markdown
  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

WebSocket connection constructors replace an explicitly supplied empty SendQueue because SendQueue.__bool__ is false when empty.

Reproduction

  1. Create SendQueue(max_bytes=0).
  2. Pass it to any of the realtime or responses WebSocket connection constructors.
  3. Inspect the connection's queue or enqueue an item.

Expected: the connection retains the supplied queue, including its configured limits and identity.

Actual: the truthiness check constructs a new default SendQueue, discarding the supplied queue.

Root cause and changes

The constructors used send_queue or SendQueue(). An empty queue is a valid configured dependency, but its falsey value was treated as if no queue had been supplied.

  • Use an explicit is not None check in the six affected realtime and responses connection constructors.
  • Add parametrized regression coverage across all six constructors, including the supplied queue's limit behavior.

Additional context & links

Validation

  • uv run --no-project --with-editable . --with pytest python -m pytest -c /dev/null --rootdir=. --noconftest -o addopts='' -q tests/test_websocket_send_queue.py — 6 passed.
  • ruff check src/openai/resources/beta/responses/responses.py src/openai/resources/realtime/realtime.py src/openai/resources/responses/responses.py tests/test_websocket_send_queue.py — passed.
  • ruff format --check src/openai/resources/beta/responses/responses.py src/openai/resources/realtime/realtime.py src/openai/resources/responses/responses.py tests/test_websocket_send_queue.py — passed.
  • Current-head Codex code and security reviews found no issues.

This preserves caller-provided queue identity and configuration. Default construction is unchanged when send_queue is None; no public API signatures change.

@Hughhhhcoder
Hughhhhcoder requested a review from a team as a code owner August 27, 2026 06:37
@Hughhhhcoder

Copy link
Copy Markdown
Author

Focused regression tests and repository formatting checks pass on the current head (c8a1d85). @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: c8a1d85af5

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: c8a1d85af5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant