Repository navigation
Add isBYOK signal to distinguish CAPI vs BYOK models - #321090
Merged
Merged
Conversation
Plumb an explicit isBYOK flag end-to-end (proposed chatProvider API -> core ILanguageModelChatMetadata -> ext host conversion), set it at the BYOK provider chokepoint (AbstractLanguageModelChatProvider), and consolidate BYOK/Copilot selection helpers in chatSelectedModel.ts used by runSubagentTool and the quota notification.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an explicit isBYOK flag on chat language model metadata to distinguish models served via user-supplied credentials (BYOK) from models served via Copilot/CAPI, and updates downstream classification logic to use this signal instead of vendor heuristics.
Changes:
- Adds
isBYOK?: booleanto the proposedLanguageModelChatInformationAPI and to internalILanguageModelChatMetadata. - Propagates the
isBYOKflag from extensions into the workbench model registry and marks Copilot BYOK-provided models accordingly. - Updates quota notifications and subagent model selection to use the BYOK flag for Copilot/CAPI vs BYOK decisions.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.chatProvider.d.ts | Adds isBYOK to the proposed chat provider API surface. |
| src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.ts | Switches BYOK detection for skipping Copilot fallbacks to isByokModel(...). |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Extends internal model metadata (ILanguageModelChatMetadata) with isBYOK. |
| src/vs/workbench/contrib/chat/common/chatSelectedModel.ts | Adds helpers to resolve selected model metadata and classify “Copilot vs BYOK”. |
| src/vs/workbench/contrib/chat/browser/chatQuotaNotification.ts | Uses the new Copilot/BYOK classification helper to gate quota notifications. |
| src/vs/workbench/api/common/extHostLanguageModels.ts | Plumbs isBYOK from LanguageModelChatInformation into internal metadata. |
| extensions/copilot/src/extension/byok/vscode-node/abstractLanguageModelChatProvider.ts | Marks Copilot BYOK models with isBYOK: true. |
Copilot's findings
- Files reviewed: 6/7 changed files
- Comments generated: 2
Paul (pwang347)
marked this pull request as ready for review
June 12, 2026 07:29
Martin Aeschlimann (aeschli)
approved these changes
Jun 12, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.