Skip to content

Add isBYOK signal to distinguish CAPI vs BYOK models - #321090

Merged
Paul (pwang347) merged 4 commits into
mainfrom
pawang/agentHostBYOK
Jun 12, 2026
Merged

Paul (pwang347) merged 4 commits into
mainfrom
pawang/agentHostBYOK

Conversation

@pwang347

Copy link
Copy Markdown
Contributor

No description provided.

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.
Copilot AI review requested due to automatic review settings June 12, 2026 05:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?: boolean to the proposed LanguageModelChatInformation API and to internal ILanguageModelChatMetadata.
  • Propagates the isBYOK flag 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

@pwang347
Paul (pwang347) marked this pull request as ready for review June 12, 2026 07:29
@pwang347
Paul (pwang347) merged commit 46171a9 into main Jun 12, 2026
40 of 41 checks passed
@pwang347
Paul (pwang347) deleted the pawang/agentHostBYOK branch June 12, 2026 15:49
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 12, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants