fix(voice): commit interrupted speech without a synchronized transcript - #1916
Merged
Conversation
On a mid-playout interruption, forwardedTextFor and the realtime reply path returned synchronizedTranscript ?? '', so an interrupted-but-heard reply with no playback-aligned transcript (common with avatar outputs) produced no conversation_item_added and was dropped from chatCtx. Fall back to the forwarded generation text, matching the Python SDK's forwarded_text behavior.
🦋 Changeset detectedLatest commit: dfe9dfb The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
u9g
reviewed
Jun 30, 2026
| @@ -2593,7 +2593,7 @@ export class AgentActivity implements RecognitionHooks { | |||
| const forwardedTextFor = (output: SegmentOutput): string => { | |||
Contributor
There was a problem hiding this comment.
u9g
reviewed
Jun 30, 2026
| @@ -3427,7 +3427,7 @@ export class AgentActivity implements RecognitionHooks { | |||
| const interrupted = output.played === 'partial'; | |||
| let forwardedText = output.textOut?.text || ''; | |||
Contributor
There was a problem hiding this comment.
Hoist the per-segment forwarded-text logic into a single forwardedTextFor helper (mirroring Python's _ForwardOutput.forwarded_text) used by both the pipeline and realtime reply paths, replacing the duplicated inline logic. Introduce a shared ForwardOutput interface backing SegmentOutput and MessageOutput.
5 tasks
u9g
approved these changes
Jun 30, 2026
Merged
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a midplayout interruption,
forwardedTextForand the realtime reply path returnedsynchronizedTranscript ?? '', so an interrupted-but-heard reply with no playback-aligned transcript (common with avatar outputs) produced noconversation_item_addedand was dropped fromchatCtx. Fall back to the forwarded generation text, matching the Python SDK'sforwarded_textbehaviour.