Skip to content

fix(voice): hold interrupted speech until recognition resolves - #231

Merged
johnmatthewtennant merged 11 commits into
mainfrom
fix-voice-interruption-finalization-race
Aug 26, 2026
Merged

fix(voice): hold interrupted speech until recognition resolves#231
johnmatthewtennant merged 11 commits into
mainfrom
fix-voice-interruption-finalization-race

Conversation

@johnmatthewtennant

Copy link
Copy Markdown
Contributor

Summary

Fixes a voice interruption race where assistant audio could briefly resume after VAD reported the user idle but before speech recognition delivered the user's finalized transcript.

Native assistant speech now treats VAD speech start as an unresolved recognition segment when it interrupts playback. Interrupted speech stays held until recognition finalizes, the segment reaches a bounded no-result timeout, or an explicit cleanup path resolves it. Finalized user text discards stale interrupted playback so the new user turn steers the conversation normally, while false-positive/no-result interruptions can still resume.

Related issue

None found.

Testing

  • pnpm vitest run src/features/voice-conversation/lib/nativeAssistantSpeech.test.ts
  • pnpm check

Reviewer-reproducible behavior covered by the focused suite:

  1. Assistant speech is interrupted by user speech.
  2. VAD reports idle before final recognition text is available.
  3. The old idle-settle window passes without starting replacement playback.
  4. A delayed final transcript arrives and stale assistant speech remains stopped.
  5. A no-result interruption resolves after the bounded recognition timeout and resumes eligible speech.

@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review August 26, 2026 19:14
@johnmatthewtennant
johnmatthewtennant requested a review from a team August 26, 2026 19:14

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated code review

APPROVE. Fresh static review of the exact three-dot comparison b340b9c...26f47d3 found no publishable issues. The changed voice-interruption flow now holds interrupted playback through delayed recognition finalization, discards causally stale speech when a final transcript arrives, and retains a bounded no-result recovery path with lifecycle cleanup. The focused tests discriminate delayed-final, timeout, repeated-VAD-edge, rewrite, mute, stop, and backend behavior. Final self-check covered all changed user flows; accessibility and i18n (no changed UI or user-facing localized copy); navigation and consent guards (not implicated); async error, never-completes, lifecycle, timeout, and race behavior; test honesty; design-system and project rules; duplicate overlap; and blocking-severity evidence/user effect. No unsupported or overlapping findings survived. Supplied GitHub evidence was inspected: all listed check runs completed successfully; required checks still independently govern merge readiness.

Deterministic publication result: 0 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Pending checks: 1 check(s) are not complete.

This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.

@johnmatthewtennant
johnmatthewtennant merged commit 0664d20 into main Aug 26, 2026
9 checks passed
@johnmatthewtennant
johnmatthewtennant deleted the fix-voice-interruption-finalization-race branch August 26, 2026 19:32
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.

2 participants