Repository navigation
fix(flows): keep finished live transcriptions separate per turn and speaker - #8404
Open
sumedh-aerram wants to merge 1 commit into
Open
sumedh-aerram wants to merge 1 commit into
sumedh-aerram wants to merge 1 commit into
Conversation
…peaker Only merge adjacent unfinished chunks from the same speaker, transcription type, invocation, live session and branch. Preserve original adjacency so filtered turn boundaries cannot join distinct utterances. Cover completed input/output turns, speaker attribution, unfinished chunks, and persisted session history. Fixes google#8403
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Fixes #8403
2. Or, if no issue exists, describe the change:
Problem:
Adjacent finished live transcriptions are joined across utterances and speakers. For example, completed user utterances
firstandsecondbecomefirstsecond, while output from two agents is attributed entirely to the second agent.Solution:
Keep finished records separate. Merge only consecutive unfinished transcriptions with matching type, author, invocation, live session and branch. Preserve adjacency before filtering so discarded turn-complete or interruption events still stop merging. Keep existing unfinished chunk aggregation and avoid mutating stored events.
Testing Plan
Unit Tests:
The context unit suite passes: 215 passed. The 25 focused transcription cases fail before the fix with 20 failed, 5 passed, and all pass after the fix. Coverage includes input/output text, finished versus unfinished records, repeated turns by one speaker, changed output speakers, invocation/session boundaries, filtered turn controls, legacy chunks, and an in-memory session round trip.
All applicable pre-commit checks pass. Mypy on the three changed files reports the same 164 existing errors as the base, with no new diagnostics.
Manual End-to-End (E2E) Tests:
Ran the issue's offline reproduction. The fixed output contains separate user strings
first,second, and separate quoted messages fromagent_a(one) andagent_b(two). No live model E2E test was run.Checklist
Additional context
No dependent changes are required. Verification used Python 3.11 and deterministic offline events.