[Bug]: Changing the draft while dictating discards the recording#32653

opened9d agobyMmrlufepines

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web (the voice controller lives in packages/client-runtime)

Steps to reproduce

  1. Start voice input in the chat composer.
  2. While it's recording, select text in an assistant message and click Cite. Anything else that changes the draft text during the recording has the same effect.
  3. Stop the recording.

Expected behavior

The transcript lands in the draft. If it really can't, the audio is kept so I can retry or copy it.

Actual behavior

The composer shows Draft changed (the full message, on hover, is "The draft changed while voice input was running. The transcript was not added."). The audio is deleted, and Record again starts a new recording, so what I said is gone.

There's a second path: pressing Escape inside the citation comment box cancels the recording and discards the audio, because the dictation shortcut handler catches Escape before the comment box sees it.

Impact

I lost a dictated message this way: I was recording, selected some text to quote, and the audio was gone. There's nothing to recover afterwards.

Cause, from reading the code at 25bf84ab07

  • Any draft change during a recording counts as an edit and bumps the draft revision (apps/web/src/speech/useEnvironmentSpeechInput.ts:214-256). Removing the citation afterwards is another edit, so it doesn't help.
  • At stop, resolveTranscriptCommit (packages/client-runtime/src/voice-input/controller.ts:118-125) returns stale and the transcript is refused.
  • Audio is only retained for transcription errors, so deleteOwnedRecordings (controller.ts:636) deletes it here.
  • Escape: the dictation shortcut listens on window in the capture phase (apps/web/src/speech/useDictationShortcut.ts:154) and cancels the recording on Escape (:103-113), before the comment box gets the key.

Version or commit

Desktop 0.1.8-nightly.20261106.4275. Both paths also reproduced in a local web dev client on main at 25bf84ab07, with a real recording running.

Environment

macOS, desktop app.

Workaround

Don't touch the draft while recording.

Related: #32651 fixes Cancel doing nothing on a new citation while recording; it doesn't change this.

Synced from GitHub

Same bug via a second path: pasting or typing into the composer while a dictation is recording.

Steps:

  1. Start voice input in the chat composer.
  2. While it's recording, paste text (or type) into the composer.
  3. Press stop.

Result: "Draft changed", the transcript is not added and the audio is gone. The pasted or typed text stays in the draft. Expected: the transcript is inserted at the recording's cursor position next to the new text, or at minimum the audio or transcript is kept so it can be recovered.

Version: T3 Code Desktop 0.1.10-nightly.20261112.4580 (commit 40526f96f6), macOS 27.0 arm64. resolveTranscriptCommit and the retry path in controller.ts are unchanged on main as of 2026-11-12.

Workaround: stop the recording before pasting or typing.

— Triaged with Claude Code (Claude Opus 5.5) via T3 Code's triage flow.