Repository navigation
Conversation
ymichael
deleted the
bb/investigate-and-reproduce-reported-github-issue-thr_eaj79srsgx
branch
September 25, 2026 17:34
ymichael
added a commit
that referenced
this pull request
Oct 30, 2026
## Human comments ## What was wrong `useVoiceInput`'s unmount cleanup treated a still-running recording as cancelled: it set `shouldTranscribeRef` to false before stopping the recorder, so the stop handler cleared the captured chunks and returned before anything reached the recording store. Leaving a thread while dictating lost the audio with no transcript, retry entry, or toast. Investigation report: https://get-bb.github.io/reports/issues/6660.html ## What changed - `apps/app/src/hooks/useVoiceInput.ts`: a recording started in a composer with a persisted draft (`recordingKey` set) is accepted as Stop with `insert` delivery when the composer unmounts. It then follows the existing accepted-recording path from #4330/#5590: transcribe into the originating draft, or keep it in that composer's failed recordings with the "saved in its composer" toast. It is never sent automatically. Explicit Cancel still discards. - The question field (`VoiceInputTextarea`, `recordingKey: null`) still discards on unmount because it has no durable destination after the question closes. That needs a separate ownership decision (issue options 1/3 are not implemented here). - No wire, CLI, or doc changes. ## How you verified - `useVoiceInput.test.tsx`: new test records 3 minutes, emits a chunk, unmounts, then finishes the recorder late; asserts all chunks are transcribed once and delivered with `insert` and no error toast. It fails on main (1 failed, 22 passed) and passes with the fix. The old discard-on-unmount test now covers the question field only. - `pnpm exec turbo run test --filter=@bb/app -- src/hooks/useVoiceInput.test.tsx src/components/promptbox`: 559 passed. `@bb/app` typecheck and lint pass. - Ran a `pnpm start:worktree` instance with two threads for a manual check; `bb voice transcribe` succeeded on that instance. Fixes #6660 > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The voice hook aborted accepted transcription when its composer unmounted. Even if the request completed, the result callback only targeted the mounted editor ref, so navigation lost the transcript. See #4236 and its reproduction report.
What changed
Accepted transcription continues after unmount and appends to the originating persisted draft when the editor is gone. A review follow-up keeps accepted recording data alive when
MediaRecorder.onstoparrives after unmount. Recording cleanup still discards unaccepted audio, and explicit Cancel still aborts processing. New-thread and thread follow-up composers provide their draft accessor, including embedded thread chat.How you verified
onstopregression failed before the review fix and passed after it; the focused Vitest run passed (9 tests).pnpm exec turbo run typecheck --filter=@bb/apppassed.pnpm start:worktree. In headless Chromium, a labeled speech fixture went through the real composer controls and transcription API. Accepted text reached the root and thread follow-up drafts after navigation; the thread draft survived a full reload. Cancel aborted the signal and left the draft unchanged; leaving before acceptance sent no request. The fixture replaced microphone capture, not the server transcript.Fixes #4236