fix(desktop): rearm voice conversation after playback - #73880
Conversation
|
The root cause analysis matches what I found, and the fix works. I checked out the branch and ran the new test, and I also confirmed the same scenario on main does not re-arm, so this does close #73649. One issue I ran into while testing. On the live path the baseline moved from the top of Could we keep a capture at Two smaller things on the tests:
Not blocking, but while you're in this file: |
12d8df5 to
1bad2fd
Compare
|
Addressed in Changes:
Added regression coverage for:
Validation passed: 11 focused voice-conversation tests, ESLint on the changed files, and the full desktop TypeScript check. |
|
Thanks for the focused fix. Current main still captures the fallback baseline before Commit Automated hermes-sweeper review. |
austinpickett
left a comment
There was a problem hiding this comment.
Approving. Verified on a merge-with-main worktree.
Root cause holds on current main: the baseline sequence was captured before the setup-time stopVoicePlayback() increment, so normal completion read as a user Stop and the mic never re-armed. Fixed for both the streaming and fallback paths.
All four points from the review discussion are covered: the async setup-window Stop (stoppedDuringStart guard), the Stop-during-stream-discovery case, fallback-path coverage, and the external-stop regression test for #70955. The barge monitor no longer leaks now that ensureBargeMonitor is idempotent.
Local checks green: 11 voice-conversation tests (5 new + 6 existing), typecheck across all three tsconfigs, eslint on the changed files.
Thanks @carbongotfound for the fix and @Adolanium for the review catches.
What changed
Root cause
Both
startSpeechStream()andplaySpeechText()callstopVoicePlayback()as normal setup, which increments the global playback sequence. The voice-conversation hook captured its baseline before that increment, then interpreted the setup increment as an explicit user Stop when playback completed. As a result, it suppressed the next microphone cycle.The hook now records the post-setup sequence. A later sequence change still represents an external interruption and continues to suppress automatic re-arming.
Closes #73649.
Validation
npm run --workspace apps/desktop test:ui -- src/app/chat/composer/hooks/use-voice-conversation.test.tsxnpm exec --workspace apps/desktop -- eslint src/app/chat/composer/hooks/use-voice-conversation.ts src/app/chat/composer/hooks/use-voice-conversation.test.tsxnpm run --workspace apps/desktop typecheckgit diff --check