Skip to content

examples: check WebSocket outcomes before continuing - #1281

Merged
markstuart-oai merged 3 commits into
mainfrom
markstuart/websocket-audit-examples-20261026
Oct 28, 2026
Merged

markstuart-oai merged 3 commits into
mainfrom
markstuart/websocket-audit-examples-20261026

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The Responses example checks each response status before it uses an ID or sends a continuation. The Realtime example checks the status on response.done. The Live example rejects session.closed before it has sent its three audio frames and close request; after that sequence, all valid session close reasons still confirm finalization.

Validation: the Responses and Realtime examples previously compiled against published SDK 4.92.0 and passed 11 local WebSocket cases. The Live example compiled with JDK 21, Java 11 release mode and -Werror against published SDK 4.93.0. Seven real local WebSocket cases cover early closure, all five close reasons after the send sequence, and server errors. The early-closure case fails on the previous code and passes after this change. The SDK's :openai-java-example:formatJava and lintJava checks pass.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: fafdc0cc51c7bc0e0a087cbcfdf038040f398708.

Trusted main policy: fafdc0cc51c7bc0e0a087cbcfdf038040f398708.

✅ No new custom-code files detected.

0 mixed files remain; 0 existing customizations changed.

Compared fafdc0cc51c7 → 054cda1f1302. 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 40429281721 --repo openai/openai-java \
  --name castiron-custom-code-40429281721-1 --dir /tmp/castiron-custom-code-40429281721-1
git apply --stat /tmp/castiron-custom-code-40429281721-1/custom-code.patch
cat /tmp/castiron-custom-code-40429281721-1/custom-code.patch

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

git fetch --no-tags origin fafdc0cc51c7bc0e0a087cbcfdf038040f398708 054cda1f13024bfb1a49bf80151b8ede5911c7e3
python3 scripts/castiron/custom_code_report.py report \
  --base fafdc0cc51c7bc0e0a087cbcfdf038040f398708 \
  --head 054cda1f13024bfb1a49bf80151b8ede5911c7e3 --target-branch main --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-054cda1f1302
cat /tmp/castiron-custom-code-054cda1f1302/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:54
@markstuart-oai
markstuart-oai requested a review from a team as a code owner October 27, 2026 17:54
@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-28T05:37:18.768123Z 250241b Manual request
🔒 Security Review ✅ Completed 2026-10-28T05:37:40.957312Z 250241b Manual request
ℹ️ 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.

@markstuart-oai markstuart-oai changed the title fix(examples): check WebSocket response status before continuing examples: check WebSocket outcomes before continuing Oct 28, 2026
@markstuart-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 250241b99c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

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

Reviewed commit: 250241b99c

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.

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed completed-status gates before Responses continuation and Realtime success, plus the Live startup/send-before-close guard. Existing timeout and resource cleanup remain intact. No actionable findings.

Static review of 250241b with an independent reviewer. Hosted checks show no failures; applicable checks passed and some jobs were skipped. No candidate code or local tests were run.

@markstuart-oai
markstuart-oai added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 1ffd86e Oct 28, 2026
14 checks passed
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.

3 participants