Repository navigation
examples: handle Live replies and session finalization - #3060
markstuart-oai wants to merge 10 commits into
Conversation
Castiron custom codeEvaluated main: Trusted main policy: ✅ No new custom-code files detected. 0 mixed files remain; 0 existing customizations changed. Compared 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 40529415312 --repo openai/openai-node \
--name castiron-custom-code-40529415312-1 --dir /tmp/castiron-custom-code-40529415312-1
git apply --stat /tmp/castiron-custom-code-40529415312-1/custom-code.patch
cat /tmp/castiron-custom-code-40529415312-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 60224b376e25912bb1143007c81d2ecdc7a7434c 21e33204452edd48567836ceb9a3a56b1a3aea0d
python3 scripts/castiron/custom_code_report.py report \
--base 60224b376e25912bb1143007c81d2ecdc7a7434c \
--head 21e33204452edd48567836ceb9a3a56b1a3aea0d --target-branch main --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-21e33204452e
cat /tmp/castiron-custom-code-21e33204452e/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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21e3320445
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5ed65711f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e84426af5
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Requesting changes for the two confirmed CLI regressions already identified by Dan; referencing the existing threads to avoid duplicate inline comments:
- Redirected stdin (for example, /dev/null) emits close and aborts capture before session startup. Please provide an explicit bounded noninteractive path: #3060 (comment)
- Terminal Ctrl-C closes readline and triggers the same successful finish path as Enter. Please distinguish interruption, preserve cleanup, and return a nonzero exit: #3060 (comment)
The helper finalization and failure handling otherwise look sound. Please cover stdin EOF and Ctrl-C at the CLI boundary.
Static review of commit 12c48b8. Hosted checks show no failures (applicable checks passed; other jobs skipped). No local tests or candidate code were run.
12c48b8 to
beb1b6d
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
The earlier stdin EOF and Ctrl-C findings are fixed: noninteractive capture is bounded, and cancellation interrupts work, cleans up playback, and exits 130. One new compilation failure remains below. Hosted lint and breaking-change detection both fail with TS2550, not an SDK API compatibility regression. Other test jobs are still running.
Static re-review with an independent reviewer; no candidate code or local tests run.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
The TypeScript issue is fixed, and all three added CLI tests passed in hosted Node 26. One PR-introduced flaky assertion remains: the playback test assumes the child cannot observe EOF before termination. Hosted Node 26 failed only this test (12,182 passed, one failed, two skipped). This is a test race, not evidence of failed playback cancellation.
Static re-review with an independent reviewer; no candidate code or local tests run.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-reviewed the latest fix, including an independent static second pass. Moving the EOF-marker precondition before close() removes the scheduler-dependent assertion without weakening the process-termination and repeated-close checks. The earlier redirected-input, cancellation-exit, and TypeScript compatibility findings are also addressed. No remaining actionable findings.
Hosted CI is green, including Node.js 22/24/26 and OkTest. Review was static; no candidate code or tests were run locally.
| console.log('Capturing for up to 45 seconds, then closing the session.'); | ||
| } | ||
| const result = await runTranscriptDemo(client, audio, { | ||
| finishSignal: input ? finish.signal : AbortSignal.timeout(45_000), |
There was a problem hiding this comment.
[P2] Preserve automatic completion for the default terminal invocation. Running the documented command in a terminal previously captured a conversation and returned without keyboard input. It now selects an untimed finish.signal, so leaving the same command unattended never requests normal session closure and eventually fails at the helper's 120-second deadline instead of returning a transcript. The redirected-stdin fix only preserves automatic completion outside a terminal. Make Enter-only capture an explicit mode, or apply the bounded observation window in terminals too while allowing Enter to finish earlier.
The Live transcript example could end while the model was still speaking or before the server confirmed closure. Redirecting stdin from
/dev/nullalso stopped capture during startup, while terminal Ctrl-C could print a successful result and exit zero.The example now waits for the caller to finish capture and for the server to confirm
session.closewithsession.closedreasonclose_requested. A terminal user presses Enter to finish; unattended runs capture for up to 45 seconds. Ctrl-C cancels capture, closes the connection and audio players, suppresses the success summary, and exits 130. Finishing before startup rejects promptly. Transport errors, other closure reasons, premature closure, and deadlines fail the operation.The helper no longer guesses completion from transcript timing. The initial speech check only chooses when to play the second clip. The change covers the example, README, callers, and tests; SDK APIs and dependencies are unchanged.
Validation: 37 focused helper, audio-player, and CLI tests passed on Node 22. The three CLI cases also passed on Node 24, including a real Linux terminal Ctrl-C test. Strict project TypeScript, scoped formatting, and lint passed. The final assertion uses ES2020-compatible operations. The paid live test remains opt-in and uses its own 45-second observation window; it does not assert that the model has produced a complete answer.