Skip to content

fix(flows): keep finished live transcriptions separate per turn and speaker - #8404

Open
sumedh-aerram wants to merge 1 commit into
google:mainfrom
sumedh-aerram:fix/live-transcription-turn-merge
Open

sumedh-aerram wants to merge 1 commit into
google:mainfrom
sumedh-aerram:fix/live-transcription-turn-merge

Conversation

@sumedh-aerram

Copy link
Copy Markdown

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 first and second become firstsecond, 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:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

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 from agent_a (one) and agent_b (two). No live model E2E test was run.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

No dependent changes are required. Verification used Python 3.11 and deterministic offline events.

…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
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.

Live history merges finished transcriptions across turns and attributes them to the last speaker

1 participant