Hook up the ability to handle model promos - #325166
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR threads a new optional promo field ({ id, discountPercent, endsAt, message }) through the model-metadata stack so a model can advertise a promotional discount. The data originates from the CAPI billing.promo payload, is normalized in the agent-host pricing layer and the Copilot endpoint, flows through the ext-host bridge into ILanguageModelChatMetadata, and is surfaced in three UI places: the model picker (a boosted entry right after "Auto" plus a discount badge/description), the model hover card (a discount pill + promo message with end date), and a new one-time chat-input notification.
Changes:
- Add
promoto the model-metadata/billing interfaces and proposed API.d.tsfiles, and wire it through every mapping site (CAPI billing → endpoint → ext-host → picker/session providers/agent-host). - Surface promos in the picker (boost the promo model next to Auto, show a "{n}% discount" description/badge and a promo hover block) and add a new
ChatPromoNotificationContributionthat shows a dismissible, persisted one-time notification. - Change
ChatEndpoint.degradationReasonto drop theinfo_messagesfallback and fold the degradation reason intowarningText['degradation']inlanguageModelAccess.ts.
Show a summary per file
| File | Description |
|---|---|
src/vs/platform/agentHost/common/agentModelPricing.ts |
Adds promo to pricing meta/billing interfaces plus defensive normalizePromo/read validation and round-trip write. |
extensions/copilot/src/platform/endpoint/common/endpointProvider.ts |
Adds IModelPromo and billing.promo. |
extensions/copilot/src/platform/endpoint/node/chatEndpoint.ts |
Maps billing.promo to promo; removes info_messages fallback from degradationReason. |
extensions/copilot/src/platform/networking/common/networking.ts |
Adds promo to IChatEndpoint. |
extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts |
Passes promo; folds degradationReason into warningText. |
extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeModels.ts |
Forwards endpoint.promo. |
src/vs/workbench/api/common/extHostLanguageModels.ts |
Bridges promo into ILanguageModelChatMetadata. |
src/vs/workbench/contrib/chat/common/languageModels.ts |
Declares promo on ILanguageModelChatMetadata. |
src/vs/workbench/contrib/chat/common/chatSessionsService.ts |
Adds promo to option-model metadata. |
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.ts |
Forwards promo. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.ts |
Forwards promo. |
src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts |
Forwards promo. |
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts |
Boosts promo models, adds discount description/badge, and renders promo hover block. |
src/vs/workbench/contrib/chat/browser/widget/media/chat.css |
Adds .chat-model-hover-promo-text styles (mirrors warning-text). |
src/vs/workbench/contrib/chat/browser/chatPromoNotification.ts |
New contribution showing a persisted one-time promo notification. |
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts |
Registers the new contribution. |
src/vs/vscode-dts/vscode.proposed.chatProvider.d.ts / vscode.proposed.chatSessionsProvider.d.ts |
Add promo to proposed API. |
src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts |
Adds picker tests for promo boosting/description/dedup. |
Review details
- Files reviewed: 17/19 changed files
- Comments generated: 1
- Review effort level: Medium
Logan Ramos (lramos15)
marked this pull request as ready for review
July 9, 2026 17:42
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Tyler James Leonhardt (@TylerLeonhardt)Matched files:
|
Connor Peet (connor4312)
approved these changes
Jul 9, 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.
No description provided.