Skip to content

Voice input: in-progress recording is silently discarded when the composer unmounts #6660

Closed

Description

@Kylo6

Summary

An in-progress voice recording is silently discarded when its composer unmounts. Several minutes of dictation are lost, with no recording kept for retry and no warning. Since #4330 an accepted recording survives navigation, but a recording that is still running when the composer leaves the screen does not.

Versions and environment

  • bb 0.48.0 desktop app, macOS (Apple silicon)
  • Voice service: Automatic (Codex)

What happened

I dictated for several minutes in a thread follow-up composer. The chat view changed while I was still recording (I did not press Stop or Cancel). The recording was gone: no transcript in the draft, no entry in failed recordings, no toast.

Root cause (from the shipped bundle)

useVoiceInput (app/dist/assets/ExecutionControls-*.js): the unmount cleanup does

if (recorder && recorder.state === "recording") { keep.current = false; recorder.stop(); }
// ...
recorder.onstop = () => { if (!keep.current) { chunks.current = []; setState("idle"); return; } ... }

So unmount during recording drops every chunk. The chunks live only in a useRef of the composer component (MediaRecorder.start(250) pushes to it), and nothing is written to bb-voice-recordings until Stop. #4330 states this on purpose: "Recording cleanup still discards unaccepted audio".

The question form's free-text field (VoiceInputTextarea, recordingKey: null) is worse: even an accepted recording is cancelled when the question unmounts.

Expected

Leaving the composer must never lose what was said. Any of these would do, in order of preference:

  1. Keep recording across navigation. Lift the recorder out of the composer into an app-level owner (one active recording per window), keep a visible "recording for " pill, and deliver the transcript to the originating draft — the delivery path from Preserve accepted voice transcription across navigation #4330 already exists.
  2. Treat unmount as Stop, not Cancel. Accept the recording and transcribe it into the originating persisted draft (same path as Preserve accepted voice transcription across navigation #4330). Cancel stays explicit.
  3. At least persist chunks while recording (the bb-voice-recordings IndexedDB store already exists) and surface them in Failed recordings, so a crash, reload or unmount can be retried.

Related

Activity

  1. added theissue type on Oct 30, 2026
  2. added
    ui
    confirmed-repro
    on Oct 30, 2026
  3. bb-slop-cop commented on Oct 30, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · High priority · Medium effort · ui.
    • Report: Reproduction and root-cause analysis.
    • Verdict: REPRODUCED · root-cause confidence high · reproduction label confirmed-repro.
    • Root cause: Composer teardown disables transcription and clears captured chunks before the audio reaches recoverable recording storage.
    • Evidence: The lifecycle probe fails only on unmount in two trusted-main checkouts (24 tests pass, 1 preservation assertion fails). The pristine hook suite passes 22/22; both full builds pass. This tests the real hook with a recorder fake, not physical macOS audio.
    • No PR: Existing tests explicitly require discard-on-unmount; choosing replacement behavior and ownership requires a product decision, outside the simple-fix gate.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions