Long context pricing#317820
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for “long context” (tiered) pricing metadata for language models and surfaces it in relevant VS Code Chat UI hovers, aligned with the updated Copilot API pricing structure.
Changes:
- Extend language model pricing metadata (proposed API + internal metadata + ext host marshalling) with optional long-context cost fields.
- Show long-context cost details in the model picker hover and the chat models management hover content.
- Update Copilot extension token pricing normalization to a tiered
{ default, longContext? }structure and bump@vscode/copilot-apito^0.4.0.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.languageModelPricing.d.ts | Adds optional longContext*Cost fields to the proposed API types. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Extends internal ILanguageModelChatMetadata with long-context pricing fields. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts | Renders a second “Long context cost” section in the model picker hover when present. |
| src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.ts | Adds long-context pricing section to the markdown hover content. |
| src/vs/workbench/api/common/extHostLanguageModels.ts | Marshals long-context pricing fields from extensions into workbench metadata (and back into API objects). |
| package.json | Bumps @vscode/copilot-api to ^0.4.0. |
| package-lock.json | Updates lock entry for @vscode/copilot-api@0.4.0. |
| remote/package.json | Bumps @vscode/copilot-api to ^0.4.0 for remote. |
| remote/package-lock.json | Updates remote lock entry for @vscode/copilot-api@0.4.0. |
| extensions/copilot/src/platform/networking/common/networking.ts | Introduces tier types (ITokenPriceTier, tiered IChatEndpointTokenPricing). |
| extensions/copilot/src/platform/endpoint/node/chatEndpoint.ts | Normalizes tiered pricing (default + optional long_context) into per-1M token rates. |
| extensions/copilot/src/platform/endpoint/common/endpointProvider.ts | Updates raw billing token price type shape to tiered structure. |
| extensions/copilot/src/extension/conversation/common/languageModelAccess.ts | Uses pricing.default.* for labels after pricing shape change. |
| extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts | Emits both default and long-context costs into model metadata. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeModels.ts | Emits both default and long-context costs for Claude code models. |
| extensions/copilot/package.json | Bumps @vscode/copilot-api to ^0.4.0 in Copilot extension. |
| extensions/copilot/package-lock.json | Updates Copilot extension lock entry for @vscode/copilot-api@0.4.0. |
| extensions/copilot/chat-lib/package.json | Bumps @vscode/copilot-api to ^0.4.0 in chat-lib package. |
Copilot's findings
Files not reviewed (2)
- extensions/copilot/package-lock.json: Language not supported
- remote/package-lock.json: Language not supported
- Files reviewed: 14/18 changed files
- Comments generated: 2
connor4312
approved these changes
May 21, 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.
Fix #317575