Gate Dictation on Copilot entitlement - #329222
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97983c12-eefc-4d1b-a8d2-7fd5a6d64ed9
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Copilot entitlement gating to built-in Dictation.
Changes:
- Restricts Dictation and MAI by plan and organization.
- Refreshes UI availability and cancels sessions on entitlement changes.
- Adds entitlement tests.
Show a summary per file
| File | Description |
|---|---|
chatSpeechToTextService.ts |
Implements entitlement gating and cancellation. |
voiceInputMode.ts |
Refreshes Dictation availability. |
chatSpeechToTextService.test.ts |
Tests plan/backend eligibility. |
Review details
Suppressed comments (2)
src/vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.ts:517
isConfiguredevaluates the currently selecteddictation.model, not the backend used by the in-progress session. If an MAI session starts, the setting is switched to local, and entitlement then changes to external Enterprise, this remainstrueand the cloud session is not cancelled. Evaluate entitlement against_activeBackendfor active sessions.
if (!this.isConfigured && this._state !== ChatSpeechToTextState.Idle) {
this.cancel();
}
src/vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.ts:658
- This eligibility check can become stale while
start()awaits microphone permission and backend/capture setup. The service remainsIdleuntil recording begins, so the entitlement listener skips cancellation; an entitlement loss during those awaits can therefore still end inRecording. Track/cancel an in-flight start (or revalidate with teardown before enteringRecording).
if (!isDictationEntitled(this._chatEntitlementService.entitlement, this._chatEntitlementService.isInternal, backend === 'mai')) {
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
Collaborator
Author
|
cc @cwebster-99 |
meganrogge
enabled auto-merge (squash)
August 5, 2026 17:43
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97983c12-eefc-4d1b-a8d2-7fd5a6d64ed9
roblourens
approved these changes
Aug 5, 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.
Summary
This is client-side product gating only; MAI must continue to authenticate requests and enforce entitlement server-side.
Testing
npm run transpile-client