Allow editor/terminal dictation to take over an active Chat dictation session - #328830
Draft
meganrogge with Copilot wants to merge 2 commits into
Draft
Allow editor/terminal dictation to take over an active Chat dictation session#328830meganrogge with Copilot wants to merge 2 commits into
meganrogge with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue where dictation does not start in editor or terminal
Allow editor/terminal dictation to take over an active Chat dictation session
Aug 3, 2026
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
Chat, editor, and terminal dictation share a single on-device speech engine, so only one can run at a time. While Chat dictation was active, "Start Dictation in Editor" and "Start Dictation in Terminal" silently did nothing: the editor path early-returned from
startDictation(the shared_activesession was owned by Chat), and the terminal path aborted when the engine was busy.The fix lets a new surface take over: each surface already tears down its own UI when it observes the engine go
Idle, so a new start just cancels the current session before attaching its own listeners.dictationSession.ts(startDictation) — instead of no-op returning when a session is active, cancel the current session (Chat, another editor, or terminal) and take over; the previous surface cleans up via its ownIdlelistener and keeps whatever transcript it had inserted. Same-editor re-entry still returns early (toggle handled by callers).editorDictation.ts(startBuiltin) — register the "self-teardown onIdle" listener afterstartDictationso the takeover's cancel of the previous surface can't tear down the just-started editor session.terminalVoice.ts(_startBuiltin) — replace the "abort when busy" guard with aservice.cancel()takeover (before subscribing), keeping a defensive bail-out if the engine somehow stays busy.dictationSession.test.ts— added coverage for cross-surface takeover (first editor keeps its text, second becomes active); updated the mockcancel()to emit the realIdletransition.Takeover is now symmetric across the reported directions (Chat → editor, Chat → terminal) as well as editor ↔ terminal, with no cross-contribution imports.