fix(voice): hold interrupted speech until recognition resolves - #231
Conversation
morgmart
left a comment
There was a problem hiding this comment.
🤖 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.
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.tspnpm checkReviewer-reproducible behavior covered by the focused suite: