Skip to content

Reset dictation transcript state on session teardown#326673

Merged
meganrogge merged 6 commits into
mainfrom
copilot/microsoft326672-fix-dictation-text-issue
Jul 20, 2026
Merged

Reset dictation transcript state on session teardown#326673
meganrogge merged 6 commits into
mainfrom
copilot/microsoft326672-fix-dictation-text-issue

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

The on-device dictation transcript (_finalizedText/_deltaText) was cleared inconsistently across ChatSpeechToTextService session lifecycles: on cancel() and _failSession(), and on the next start() — but only after the async microphone-acquisition prompt. A normal stopAndTranscribe() ("Stop recording") left the prior transcript in service state, so a subsequent recording could resurface it.

Changes:

  • Centralize the reset in _teardown() — every session-end path (stop, cancel, error, and start()'s error paths) already funnels through here, so the transcript is now cleared the instant a session ends rather than on the next start. This removes the window in which stale text could reappear.
  • Remove the now-redundant resets in start(), cancel(), and _failSession(), making _teardown() the single source of truth for the invariant "no transcript survives the session that produced it."

The returned final transcript is captured in a local and telemetry (transcriptLength) is logged before _teardown(), so both remain correct.

Net diff: 6 insertions / 6 deletions in one file.

Copilot AI requested review from Copilot and removed request for Copilot July 20, 2026 16:44
Copilot AI linked an issue Jul 20, 2026 that may be closed by this pull request
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 20, 2026 17:21
Copilot AI changed the title [WIP] Fix issue where old dictation text reappears Reset dictation transcript state on session teardown Jul 20, 2026
Copilot AI requested a review from meganrogge July 20, 2026 17:21
@meganrogge
meganrogge marked this pull request as ready for review July 20, 2026 18:10
Copilot AI review requested due to automatic review settings July 20, 2026 18:10
@meganrogge
meganrogge enabled auto-merge (squash) July 20, 2026 18:10
@meganrogge meganrogge added this to the 1.131.0 milestone Jul 20, 2026

Copilot AI 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.

Pull request overview

Centralizes transcript cleanup during speech-to-text session teardown, preventing stale dictation from resurfacing.

Changes:

  • Clears finalized and interim transcript state in _teardown().
  • Removes redundant cleanup from individual lifecycle paths.
Show a summary per file
File Description
chatSpeechToTextService.ts Centralizes transcript reset across session teardown paths.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread src/vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
meganrogge and others added 2 commits July 20, 2026 16:27
Empty commit to re-run checks; the failing macOS/Electron job is an unrelated
flaky ExtHostAuthentication disposable leak (FileService.doWriteBuffer retry),
not caused by this dictation change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0e880d06-9ed1-4131-9b77-3766bbec6977
@meganrogge
meganrogge merged commit bb7c1d3 into main Jul 20, 2026
29 checks passed
@meganrogge
meganrogge deleted the copilot/microsoft326672-fix-dictation-text-issue branch July 20, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dictation text shows up again

5 participants