fix(desktop): guard voice loop during playback - #55581
Conversation
d181cc9 to
63a9e08
Compare
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Well-designed fix for the desktop voice loop restarting during active playback. The onSubmit return type change to boolean | void allows the caller to signal rejection, and the isVoicePlaybackActive() guard prevents the mic from restarting while audio is playing. Good test coverage.
Looks Good
- The
accepted === falsecheck correctly resets voice state without entering thinking - Multiple guard points (
isVoicePlaybackActive()) prevent mic restart during playback - The
pendingStartRefreset moved after guards is correct ordering - Test cases cover both the playback-wait and submit-rejection paths
Reviewed by Hermes Agent
|
Thanks for the focused desktop voice-loop fix. Current main still has both reported failure paths: The shared state already models both This is an automated hermes-sweeper review. |
63a9e08 to
b6fb923
Compare
|
Closing as superseded by the merged voice playback/barge-in rework #69511 ( If anything in this area still misbehaves on current main, please open a fresh PR against the new stack. |
Summary
thinkingstateRoot cause
The ordinary voice-conversation recorder only gated microphone re-arm on its local conversation status and session busy state. It did not observe the shared voice playback state, and it cleared
pendingStartRefbefore all start guards had passed. A playback overlap could therefore either reopen the normal recorder too early or consume the pending restart without retrying it.The composer submit contract returns
falsewhen a prompt is rejected, butsubmitVoiceTurn()discarded that result and the voice loop unconditionally enteredthinking. Currentmainalso has a separate captured-utterance path for streaming TTS barge-in; that sibling path had the same rejected-submit behavior.This update keeps the new
monitorSpeechDuringPlayback/ streaming speech path intact. The playback guard applies only to the ordinary recorder restart, while the dedicated barge-in monitor continues to own microphone capture during playback.Testing
npm --workspace apps/desktop run test:ui -- src/app/chat/composer/hooks/use-voice-conversation.test.tsx(3 passed)npm --workspace apps/desktop run test:ui(243 files, 2052 passed, 1 skipped)npm --workspace apps/desktop run typechecknpm --workspace apps/desktop run buildNotes
There is an adjacent open PR (#54067) that improves voice-conversation latency and TTS gaps. This PR remains narrower: it guards the ordinary mic re-arm and keeps rejected voice submits out of the response-waiting loop while preserving the newer streaming/barge-in implementation on
main.