Skip to content

fix(desktop): rearm voice conversation after stop (#108301) - #108407

Open
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/108301-voice-stop-rearm-consume
Open

Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/108301-voice-stop-rearm-consume

Conversation

@Tranquil-Flow

Copy link
Copy Markdown
Contributor

What

Fixes #108301.

Desktop voice conversation mode now treats Stop/Esc during read-aloud as a reply-only interruption, not as the end of hands-free mode:

  • consumes the interrupted pending response when an external Stop is observed, so it cannot be replayed later;
  • re-arms the microphone whenever the conversation is still enabled;
  • preserves the barge-in capture early return so an active barge monitor still owns the mic instead of starting a second capture.

Why

The previous settleAfterSpeech() path detected an external stop via the voice playback sequence and then skipped pendingStartRef.current = true. The UI remained in voice-conversation mode, but the mic never reopened. It also left the stopped pending response available to future playback consumers.

Verification

Run from apps/desktop after rebasing onto current upstream/main:

  • npx vitest run --project ui src/app/chat/composer/hooks/use-voice-conversation-rearm.test.tsx src/app/chat/composer/hooks/use-voice-conversation.test.tsx --reporter=default → 2 files passed, 11 tests passed. Existing React act(...) warning in the barge-in suite is unchanged.
  • npx eslint src/app/chat/composer/hooks/use-voice-conversation.ts src/app/chat/composer/hooks/use-voice-conversation-rearm.test.tsx → passed.
  • npm run typecheck → passed.
  • git diff --check → passed.

RED proof captured in .automation/runs/20260911T1604Z/108301/fail-without-fix.txt: 3 regression tests failed on the pre-fix production code, each with the mic start count stuck at 1 instead of re-arming to 2.

Duplicate / competitor check

Auto-published by Moonsong via Path B automated pipeline.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) tool/tts Text-to-speech and transcription labels Sep 11, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Related: #81176 (open since 2026-08-07) removes the same stoppedByUser gate in settleAfterSpeech so the mic re-arms after an external Stop; this PR additionally consumes the interrupted pending response and preserves the barge-in early return. Competing fixes for #108301 - a maintainer should pick one (or fold the pending-response consumption into #81176).

@kvnloo

kvnloo commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Comment assumes head 898757948b5f92e5d5faeff05af20e782dabaa84; void if moved.

CHECK — Desktop voice-conversation re-arm after Stop (#108301)

  • Treating Stop/Esc during read-aloud as reply-only interruption (consume interrupted pending + re-arm mic while conversation still enabled + preserve barge-in early return) is a valuable re-arm fix for stuck hands-free mode.
  • This is not a new Desktop lifetimes vehicle — Rank3 fix(desktop): isolate voice turn lifetimes #95180 (@ bee79171eacf6eb810a208ec8d3154a8891bb2e0) already owns capture/turn lifetime isolation. Prefer fix(desktop): isolate voice turn lifetimes #95180’s contracts; adapt this re-arm so it cannot submit/stop/re-arm a superseded turn.

CHECK (desk / competitors)

One-click close / ordering

Landing-evidence

  • When merged, please reply with the merge commit SHA on main (not “completed”).

1 similar comment
@kvnloo

kvnloo commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Comment assumes head 898757948b5f92e5d5faeff05af20e782dabaa84; void if moved.

CHECK — Desktop voice-conversation re-arm after Stop (#108301)

  • Treating Stop/Esc during read-aloud as reply-only interruption (consume interrupted pending + re-arm mic while conversation still enabled + preserve barge-in early return) is a valuable re-arm fix for stuck hands-free mode.
  • This is not a new Desktop lifetimes vehicle — Rank3 fix(desktop): isolate voice turn lifetimes #95180 (@ bee79171eacf6eb810a208ec8d3154a8891bb2e0) already owns capture/turn lifetime isolation. Prefer fix(desktop): isolate voice turn lifetimes #95180’s contracts; adapt this re-arm so it cannot submit/stop/re-arm a superseded turn.

CHECK (desk / competitors)

One-click close / ordering

Landing-evidence

  • When merged, please reply with the merge commit SHA on main (not “completed”).

This branch has not been deployed

No deployments
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/*) P2 Medium — degraded but workaround exists 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 becomes deaf after stopping read-aloud (stop re-arms nothing)

3 participants