Repository navigation
fix(examples): recognize Live replies during audio upload - #3060
markstuart-oai wants to merge 1 commit 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".
| previous?.speaker === 'user' && | ||
| !previousSegments.has(previous.id) && | ||
| segment.previousId === previous.id && | ||
| segment.endMs >= previous.startMs |
There was a problem hiding this comment.
Do not treat overlapping old output as the final reply
When an interrupted first answer emits a late transcript fragment whose interval crosses the new user's start time, TranscriptGrouper emits that fragment as an assistant segment immediately after the user segment. Since previousId denotes display order rather than a semantic reply relationship, this timestamp check then becomes true after inactivity even if the assistant never answers the second utterance, causing the demo to close successfully with only stale output. The stale fixture misses this case because its old fragment ends before the new user interval.
Useful? React with 👍 / 👎.
| return ( | ||
| segment.speaker === 'assistant' && | ||
| previous?.speaker === 'user' && | ||
| !previousSegments.has(previous.id) && |
There was a problem hiding this comment.
Accept second speech appended to an active user segment
If a late input-transcript fragment switches the grouper back to a user segment before this snapshot—possible while interrupting the first answer—the second utterance is appended to that same active user segment because user segments do not close on inactivity. The eventual valid assistant reply therefore points to an ID contained in previousSegments, so this condition can never pass and the demo times out despite receiving the final answer.
Useful? React with 👍 / 👎.
The Live transcript demo could receive and finish the second answer while it was still sending audio, then wait 45 seconds and report a timeout. It could also count the late end of an interrupted answer as a reply to the second utterance.
Record the existing segment IDs before sending the second clip. Wait for a settled assistant segment linked to a new user segment. Allow their speech intervals to overlap. This uses the relationship between displayed transcript segments and does not require a server turn ID.
The SDK's test command passed all 10 regression tests on Node 22 and 24. Each runtime also passed 15 local WebSocket scenarios. A separate peer reproduced overlapping speech in both interruption modes. The full TypeScript project passed
tsc --noEmit --project tsconfig.json. Formatting and lint passed for the changed files.