Reset dictation transcript state on session teardown#326673
Merged
meganrogge merged 6 commits intoJul 20, 2026
Merged
Conversation
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue where old dictation text reappears
Reset dictation transcript state on session teardown
Jul 20, 2026
meganrogge
approved these changes
Jul 20, 2026
meganrogge
marked this pull request as ready for review
July 20, 2026 18:10
meganrogge
enabled auto-merge (squash)
July 20, 2026 18:10
Contributor
There was a problem hiding this comment.
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
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
pwang347
approved these changes
Jul 20, 2026
anthonykim1
approved these changes
Jul 20, 2026
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
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.
Description
The on-device dictation transcript (
_finalizedText/_deltaText) was cleared inconsistently acrossChatSpeechToTextServicesession lifecycles: oncancel()and_failSession(), and on the nextstart()— but only after the async microphone-acquisition prompt. A normalstopAndTranscribe()("Stop recording") left the prior transcript in service state, so a subsequent recording could resurface it.Changes:
_teardown()— every session-end path (stop, cancel, error, andstart()'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.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.