Repository navigation
chat: enable OpenAI BYOK Voice Mode - #339150
Merged
Merged
Conversation
Keep the OpenAI project key in the Copilot extension host while Voice Mode exchanges WebRTC session descriptions and delegates coding work through the existing agent flow.\n\nFixes #338708\n\nCo-authored-by: Copilot <[email protected]>
Move session exchange behind an extension-identity-checked provider bridge, cancel stale connection setup, and honor runtime speech output configuration. Co-authored-by: Copilot <[email protected]>
Mark voice-only BYOK models as non-selectable so they remain manageable without appearing in chat model pickers. Co-authored-by: Copilot <[email protected]>
Use OpenAI BYOK only when the configured key exposes gpt-live-1; otherwise preserve the hosted Voice Mode transport. Co-authored-by: Copilot <[email protected]>
Use an explicit model ID setting to opt into OpenAI BYOK voice sessions, and keep voice-only models out of model management and chat model pickers.\n\nCo-authored-by: Copilot <[email protected]>
Show a provider-aware success notification after a new API key is securely persisted through Models Management.\n\nCo-authored-by: Copilot <[email protected]>
Confirm the configured OpenAI model after GPT-Live connects instead of showing a generic notification when any provider key is added.\n\nCo-authored-by: Copilot <[email protected]>
Read the active OpenAI provider key from its extension-host configuration, notify when the configured live model is available, and preserve the SDP terminator required by OpenAI.\n\nCo-authored-by: Copilot <[email protected]>
Defer GPT-Live session initialization until the voice controller has completed its connected-state setup, so hands-free listening enables the WebRTC microphone track. Guard the deferred initialization so it fires only once per connection.\n\nCo-authored-by: Copilot <[email protected]>
Bind voice turns, confirmations, questions, and narration to their owning chat input. Harden cancellation, connection lifetimes, draft promotion, WebRTC playback, and workbench widget routing. Add explicit natural-consent phrases and concise contextual acceptance acknowledgements with focused regression coverage. Refs #338709 and #338708. Co-authored-by: Copilot <[email protected]>
Contributor
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Submission acknowledgements, schema changes, and WebRTC/audio transitions still have correctness issues.
Review effort: Balanced
Findings: 5
Open (5)
What changed in this PR
Adds OpenAI BYOK GPT-Live Voice Mode with extension-host credential isolation, deterministic chat routing, audio lifecycle handling, accessibility guidance, and regression coverage.
Changes:
- Adds the proposed live-session speech API and OpenAI session provider.
- Hardens session ownership, approvals, questions, playback, and cancellation.
- Expands Agents-window/workbench support and tests.
| File | Description |
|---|---|
src/vscode-dts/vscode.proposed.speech.d.ts |
Adds live-session API. |
src/vs/workbench/contrib/speech/test/browser/voiceLiveSession.test.ts |
Tests provider isolation. |
src/vs/workbench/contrib/speech/common/speechService.ts |
Defines live-session contracts. |
src/vs/workbench/contrib/speech/browser/speechService.ts |
Implements provider registration. |
src/vs/workbench/contrib/chat/test/common/voiceClient/voiceQuestionAnswers.test.ts |
Tests malformed answers. |
src/vs/workbench/contrib/chat/test/common/voiceClient/voiceLiveInputRouter.test.ts |
Tests deterministic routing. |
src/vs/workbench/contrib/chat/test/common/voiceChatService.test.ts |
Updates speech mock. |
src/vs/workbench/contrib/chat/test/browser/voiceClient/voiceToolDispatchService.test.ts |
Tests exact prompt dispatch. |
src/vs/workbench/contrib/chat/test/browser/voiceClient/voiceSessionController.test.ts |
Expands lifecycle coverage. |
src/vs/workbench/contrib/chat/test/browser/voiceClient/voiceInputUtils.test.ts |
Tests widget submission. |
src/vs/workbench/contrib/chat/test/browser/voiceClient/micCaptureService.test.ts |
Tests microphone state. |
src/vs/workbench/contrib/chat/test/browser/accessibility/chatAccessibilityHelp.test.ts |
Tests help content. |
src/vs/workbench/contrib/chat/common/voiceClient/voiceQuestionAnswers.ts |
Validates wire answers. |
src/vs/workbench/contrib/chat/common/voiceClient/voiceLiveInputRouter.ts |
Routes direct-provider input. |
src/vs/workbench/contrib/chat/common/voiceClient/voiceClientService.ts |
Extends voice contracts. |
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts |
Routes submissions by widget. |
src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.ts |
Hardens prompt responses. |
src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.ts |
Coordinates BYOK lifecycle. |
src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.ts |
Centralizes voice submission. |
src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.ts |
Implements GPT-Live WebRTC. |
src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.ts |
Synchronizes microphone tracks. |
src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts |
Documents BYOK interaction. |
src/vs/workbench/contrib/agentsVoice/test/browser/voiceModeOnboarding.test.ts |
Tests BYOK enablement. |
src/vs/workbench/contrib/agentsVoice/test/browser/voiceModeActions.test.ts |
Tests input ownership. |
src/vs/workbench/contrib/agentsVoice/common/agentsVoice.ts |
Adds BYOK setting gate. |
src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.ts |
Registers setting and routing. |
src/vs/workbench/api/common/extHostSpeech.ts |
Bridges extension providers. |
src/vs/workbench/api/common/extHost.protocol.ts |
Adds speech RPC methods. |
src/vs/workbench/api/common/extHost.api.impl.ts |
Exposes proposed API. |
src/vs/workbench/api/browser/mainThreadSpeech.ts |
Registers main-thread bridge. |
src/vs/sessions/contrib/chat/test/browser/voiceBridge.test.ts |
Tests draft ownership. |
src/vs/sessions/contrib/chat/test/browser/newChatVoiceTarget.test.ts |
Updates composer contract. |
src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.ts |
Routes Agents-window input. |
src/vs/sessions/contrib/chat/browser/newSessionComposerService.ts |
Aligns request options type. |
src/vs/sessions/contrib/chat/browser/newChatWidget.ts |
Propagates send status. |
src/vs/sessions/contrib/chat/browser/newChatVoice.ts |
Updates composer API. |
src/vs/sessions/contrib/chat/browser/newChatInput.ts |
Reports voice submission status. |
src/vs/sessions/contrib/chat/browser/chatView.ts |
Forwards send status. |
extensions/copilot/src/extension/vscode-api.d.ts |
Includes speech proposal. |
extensions/copilot/src/extension/byok/vscode-node/test/openAIProvider.spec.ts |
Tests key invalidation. |
extensions/copilot/src/extension/byok/vscode-node/test/gptLiveSession.spec.ts |
Tests OpenAI transport. |
extensions/copilot/src/extension/byok/vscode-node/openAIProvider.ts |
Retains active key. |
extensions/copilot/src/extension/byok/vscode-node/gptLiveSession.ts |
Creates GPT-Live sessions. |
extensions/copilot/src/extension/byok/vscode-node/byokContribution.ts |
Registers voice provider. |
extensions/copilot/package.json |
Enables speech activation/API. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Await composer submission results and distinguish edited input from accepted requests. Allow transient WebRTC recovery and invalidate partial form answers when pending schemas change. Isolate migration coverage from production registrations and apply repository formatting. Co-authored-by: Copilot <[email protected]>
Unblock PR CI while preserving both upstream composer tests and voice submission regressions. Validate the merged head through CI because local dependency restoration is blocked by npm feed authentication. Co-authored-by: Copilot <[email protected]>
Preserve Voice Mode across voice-driven session navigation, route session awareness through authoritative Agents state, and interrupt GPT Live playback when meaningful provider transcripts indicate barge-in. Co-authored-by: Copilot <[email protected]>
Keep configured BYOK failures terminal, remove language-specific session intent parsing, and make target changes suppress stale provider output safely. Repair provider and accessibility CI coverage. Co-authored-by: Copilot <[email protected]>
Use the configured or automatic Voice Mode language for GPT Live instructions and locale-gated client routing, while removing obsolete session-navigation guidance. Co-authored-by: Copilot <[email protected]>
Megan Rogge (meganrogge)
marked this pull request as ready for review
October 15, 2026 21:41
Megan Rogge (meganrogge)
enabled auto-merge (squash)
October 15, 2026 21:43
Co-authored-by: Copilot <[email protected]>
Avoid a no-op regular expression in non-English voice choice parsing while preserving locale-gated behavior.\n\nCo-authored-by: Copilot <[email protected]>
Vritant Bhardwaj (vritant24)
approved these changes
Oct 15, 2026
2 tasks done
This was referenced Oct 16, 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.

Fixes #338708. Supersedes #338709.
Summary
Adds OpenAI GPT Live as a BYOK Voice Mode provider over WebRTC and hardens the full voice lifecycle across regular workbench chat and the Agents window:
Expected GPT Live Voice Mode behavior
agents.voice.useBYOKVoiceModelto opt back into hosted Voice Mode.[mouth noise]alone do not interrupt playback.agents.voice.languageis explicitly configuredagents.voice.languageisautoDeliberately unsupported or out-of-scope behavior
focus_sessionor silently move focus.get_session_infocalls.Language and safety boundaries
approve,approved,accept,accepted,allow,yes,I approve, andI accept; rejection usesreject,deny, andno.agents.voice.languagesetting, or from the browser/VS Code display locale when the setting isauto.1or2are supported.option N,and,other, andskipare enabled only for English locales.How to test
Validation
Current head was merged with the latest
main, rebuilt, and validated locally:npm run build-fast -- --client-only— passed../scripts/test.sh --run src/vs/workbench/contrib/chat/test/common/voiceClient/voiceLiveInputRouter.test.ts --run src/vs/workbench/contrib/chat/test/browser/voiceClient/voiceClientService.test.ts --run src/vs/workbench/contrib/chat/test/browser/voiceClient/voiceSessionController.test.ts --run src/vs/sessions/test/browser/parts/panelPart.test.ts— 284 passed.npm --prefix extensions/copilot run test:unit -- src/extension/byok/vscode-node/test/gptLiveSession.spec.ts src/extension/byok/vscode-node/test/byokContribution.spec.ts— 14 passed.npm --prefix extensions/copilot run typecheck— passed.npm --prefix extensions/copilot run compile— passed.npm run typecheck-client— passed.npm run eslint -- <all 12 modified TypeScript files>— passed with no errors or warnings.git diff --check— passed.npm run build-fast -- --client-onlyplus the focusedVoiceClientServiceandVoiceLiveInputRoutertests — 96 passed; targeted ESLint, client typecheck, and diff checks also passed.VoiceLiveInputRoutertests passed after the formatting and CodeQL cleanups.Total focused tests in the final local run: 298 passed, 0 failed.
The full GitHub Actions matrix for commit
b5e086fb94dis currently running. Cross-platform CI and live microphone/provider behavior remain the authoritative validation for platform audio, external ASR accuracy, and model adherence.