Skip to content

fix(realtime): honor the selected WebSocket session target - #3059

Open
markstuart-oai wants to merge 1 commit into
mainfrom
markstuart/websocket-runtime-audit-20261027
Open

markstuart-oai wants to merge 1 commit into
mainfrom
markstuart/websocket-runtime-audit-20261027

Conversation

@markstuart-oai

Copy link
Copy Markdown
Contributor

Summary

An explicit Realtime session target could inherit a conflicting model, intent or call_id from the client base URL. A transcription or sideband connection could therefore send both targets to the server.

Clear inherited session selectors before adding the requested one. Preserve other query parameters and the custom URL builder contract.

Verification

All 390 tests in eight focused repository suites passed, as did the full formatter. Across Chromium, Node 22, Node 24 and Bun, 48 accepted loopback handshakes carried exactly one target. The browser also rejected a long-lived synthetic key.

@github-actions

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: 60224b376e25912bb1143007c81d2ecdc7a7434c.

Trusted main policy: 60224b376e25912bb1143007c81d2ecdc7a7434c.

✅ No new custom-code files detected.

0 mixed files remain; 0 existing customizations changed.

Compared 60224b376e25 → 2a9c9c479c9b. Generated baselines verified.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 40462475870 --repo openai/openai-node \
  --name castiron-custom-code-40462475870-1 --dir /tmp/castiron-custom-code-40462475870-1
git apply --stat /tmp/castiron-custom-code-40462475870-1/custom-code.patch
cat /tmp/castiron-custom-code-40462475870-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 60224b376e25912bb1143007c81d2ecdc7a7434c 2a9c9c479c9b9b94c41abe91933f2d8922cdc708
python3 scripts/castiron/custom_code_report.py report \
  --base 60224b376e25912bb1143007c81d2ecdc7a7434c \
  --head 2a9c9c479c9b9b94c41abe91933f2d8922cdc708 --target-branch main --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-2a9c9c479c9b
cat /tmp/castiron-custom-code-2a9c9c479c9b/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@markstuart-oai
markstuart-oai marked this pull request as ready for review October 27, 2026 17:51
@markstuart-oai
markstuart-oai requested a review from a team as a code owner October 27, 2026 17:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T17:53:21.943587Z 2a9c9c4 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-27T17:53:18.518508Z 2a9c9c4 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a9c9c479c

ℹ️ 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".

Comment on lines +302 to +304
url.searchParams.delete('model');
url.searchParams.delete('intent');
url.searchParams.delete('call_id');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clear stale selectors in the beta Realtime builder

When callers use openai/beta/realtime/ws or openai/beta/realtime/websocket with a base URL containing a stale selector, these deletions have no effect because those entrypoints use the separate builder in src/beta/realtime/internal-base.ts. For example, a beta callID connection with baseURL: 'https://example.com/v1?model=old' still sends both model=old and the selected call_id, so the same ambiguous-target bug remains on a public surface; apply the selector cleanup to the beta builder and include BetaWS/BetaNative in the regression coverage.

AGENTS.md reference: AGENTS.md:L52-L54

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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