Skip to content

Hook up the ability to handle model promos - #325166

Merged
Logan Ramos (lramos15) merged 3 commits into
mainfrom
lramos15/medieval-tern
Jul 9, 2026
Merged

Hook up the ability to handle model promos#325166
Logan Ramos (lramos15) merged 3 commits into
mainfrom
lramos15/medieval-tern

Conversation

@lramos15

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 9, 2026 17:24
@lramos15 Logan Ramos (lramos15) self-assigned this Jul 9, 2026

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 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 promo to the model-metadata/billing interfaces and proposed API .d.ts files, 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 ChatPromoNotificationContribution that shows a dismissible, persisted one-time notification.
  • Change ChatEndpoint.degradationReason to drop the info_messages fallback and fold the degradation reason into warningText['degradation'] in languageModelAccess.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

Comment thread src/vs/workbench/contrib/chat/browser/chatPromoNotification.ts
@lramos15
Logan Ramos (lramos15) marked this pull request as ready for review July 9, 2026 17:42
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Tyler James Leonhardt (@TylerLeonhardt)

Matched files:

  • extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeModels.ts

@lramos15
Logan Ramos (lramos15) merged commit 5e221c4 into main Jul 9, 2026
29 checks passed
@lramos15
Logan Ramos (lramos15) deleted the lramos15/medieval-tern branch July 9, 2026 21:44
@vs-code-engineering vs-code-engineering Bot added this to the 1.129.0 milestone Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants