Skip to content

fix(desktop): re-arm voice chat after replies - #74780

Closed
marcdordal wants to merge 1 commit into
NousResearch:mainfrom
marcdordal:fix/desktop-voice-rearm
Closed

fix(desktop): re-arm voice chat after replies#74780
marcdordal wants to merge 1 commit into
NousResearch:mainfrom
marcdordal:fix/desktop-voice-rearm

Conversation

@marcdordal

@marcdordal marcdordal commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • capture the playback sequence after voice playback starts, so Hermes does not confuse its own stale-audio reset with a user Stop action
  • re-arm Start Voice after a normal streaming reply
  • cover the playback-sequence regression

Closes #73649.

Test Plan

  • npm test -- --run src/app/chat/composer/hooks/use-voice-conversation.test.tsx
  • npm run typecheck
  • npm run lint -- --quiet src/app/chat/composer/hooks/use-voice-conversation.ts src/app/chat/composer/hooks/use-voice-conversation.test.tsx
  • Manual Desktop test: Start Voice accepted a second request after the first reply finished

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) tool/tts Text-to-speech and transcription duplicate This issue or pull request already exists labels Jul 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #73880: both move the voice-playback sequence baseline past the hook's internal playback reset/start so a normal reply re-arms the microphone rather than looking like an explicit Stop.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the focused renderer regression fix. The current-main premise is valid: openLiveSpeech() records its baseline before startSpeechStream() at apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.ts:487, while startSpeechStream() later calls stopVoicePlayback() after asynchronous URL resolution at apps/desktop/src/lib/voice-playback.ts:324-332.

Problems

  • The new post-await startSpeechStream() baseline at apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.ts:509 absorbs an explicit Stop made while stream discovery is pending. The helper's normal reset and that user Stop are both included in the recorded baseline, so the later sequence comparison cannot suppress re-arm.
  • The new test covers normal streaming completion only. The fallback path changed too, and explicit-Stop behavior remains untested.

Suggested changes

  • Preserve the entry sequence and allow only the one expected setup increment after startSpeechStream() resolves; stop and settle without re-arming if an additional increment occurred.
  • Cover Stop during setup, Stop during active playback, normal fallback re-arm, and Stop before fallback begins.

Automated hermes-sweeper review.

@@ -505,6 +509,11 @@ export function useVoiceConversation({
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

startSpeechStream() awaits URL discovery before it performs its one expected stopVoicePlayback() increment. A user Stop during that await is absorbed by this post-await baseline, so later settling cannot distinguish it from normal setup and re-arms the mic. Preserve the entry sequence and treat more than the expected one increment as an external Stop.

@marcdordal marcdordal closed this Jul 30, 2026
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop voice conversation never re-arms mic after normal playback

3 participants