Skip to content

fix(examples): recognize Live replies during audio upload - #3060

Open
markstuart-oai wants to merge 1 commit into
mainfrom
markstuart/live-transcript-final-answer-20261027
Open

markstuart-oai wants to merge 1 commit into
mainfrom
markstuart/live-transcript-final-answer-20261027

Conversation

@markstuart-oai

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

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Oct 27, 2026 •

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 → 21e33204452e. 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 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.patch

Or 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.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:52
@markstuart-oai
markstuart-oai requested a review from a team as a code owner October 27, 2026 17:52
@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:54:45.814667Z 21e3320 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-27T17:54:00.666604Z 21e3320 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: 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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