Add support for usage-based billing#312892
Conversation
Standardize severity colors and tighten typography/spacing across the chat status dashboard, chat input notification banner, and chat context usage details hover. Color tokens (accessibility & theme correctness) - Use editorWarning-foreground / editorError-foreground / focusBorder for severity foregrounds (icons, borders, bar fills). These tokens are AA-validated by core across light, dark, and HC themes. - Replace 20%-transparent severity overlays with editorWidget-border for bar tracks. Avoids opacity-blending pitfalls and stays visible in HC themes. - Use color-mix(... 6%, var(--vscode-editorWidget-background)) for subtle banner/callout background tints so they degrade gracefully in HC (fall back to widget background) instead of resolving to Color.white via the gauge.* tokens. - Color the percent value text with --vscode-foreground (always AA); severity is conveyed via the icon, bar fill, and border per WCAG 1.4.1. Chat status dashboard (chatStatus.css) - 16px outer padding, widened to 380-440px. - SKU header: 13px / 400 / foreground with a 12px bottom rule. - Quota title: 13px / 600 / foreground; meta in descriptionForeground. - Big % value: 20px / 700 / foreground. - 24px spacing between quota rows (16px before the upgrade row). - Bars: 4px tall, 4px radius on a editorWidget-border track. - Quick Settings header: foreground / 13px (sharper than before). - Description text bumped to 12px for legibility. - Replaced opacity-based dimming with descriptionForeground. Chat input notification banner (chatInputNotificationWidget.css) - 12x16 padding, 4px inner gap, 8px header icon/title gap. - 4px top margin on the description so the title/bar/% group stays tight while the description (e.g. "Copilot will pause...") gets a touch of separation. - Severity-info / -warning / -error variants now use the same color pattern as the dashboard. Chat context usage details (chatContextUsageDetails.css) - Quota bar track switched to editorWidget-border; severity fills use the editorWarning/editorError tokens. - Output-buffer striping uses the same severity tokens so legend and bar match across info / warning / error states.
…d-billing # Conflicts: # extensions/copilot/src/util/common/test/shims/vscodeTypesShim.ts
- Lighter, regular-weight quota titles (Monthly Limit, Inline Suggestions, etc.) - Remove dimmed state so 0% and 100% render identically - Tighten dashboard width (320–360px) - Even out vertical rhythm across quota indicators and dividers - Clean up Quick Settings spacing: uniform row gaps, consistent min-heights, zeroed hr margins
|
Screenshot ChangesBase: Changed (4)Removed (14)blocks-ci screenshots changedReplace the contents of Updated blocks-ci-screenshots.md<!-- auto-generated by CI — do not edit manually -->
#### editor/codeEditor/CodeEditor/Dark

#### editor/codeEditor/CodeEditor/Light

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Dark

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Light

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Dark

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Light
 |
|
/api-proposal-change-required |
There was a problem hiding this comment.
Pull request overview
This PR adds token-based billing and quota UX support across the VS Code workbench, the Sessions window, and the built-in Copilot extension by introducing pricing metadata for language models and a new chat input notification surface for quota/rate-limit messaging.
Changes:
- Adds a proposed API for model pricing labels and wires pricing metadata through language model providers into the model management UI.
- Reworks quota snapshot handling to support token-based billing fields (e.g. reset timestamps, token-based billing flag) and updates related UI/telemetry.
- Introduces a proposed API + implementation for chat input notifications, replacing the previous “status widget” approach and integrating into both Workbench and Sessions UI.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.languageModelPricing.d.ts | New proposed API surface for model pricing labels. |
| src/vscode-dts/vscode.proposed.chatProvider.d.ts | Bumps proposal version and adjusts model cost metadata shape/docs. |
| src/vscode-dts/vscode.proposed.chatInputNotification.d.ts | New proposed API for chat input notifications. |
| src/vs/workbench/services/chat/common/chatEntitlementService.ts | Updates quota snapshot shape for token-based billing + moves overage fields to aggregate quotas. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Swaps model metadata from multiplier label to pricing label. |
| src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css | Updates quota indicator styling colors. |
| src/vs/workbench/contrib/chat/browser/widget/input/media/chatStatusWidget.css | Removes old quota-exceeded status widget styles. |
| src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css | Adds styling for the new chat input notification banner (Workbench). |
| src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.ts | Removes old quota-exceeded status widget implementation. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts | Updates model picker description composition (removes multiplier label usage). |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.ts | Removes generic “input part widgets” registry/controller. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Integrates notification widget container + auto-dismiss on send. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.ts | Implements the notification banner widget rendering + actions/dismiss. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.ts | Adds singleton service to manage notifications and selection logic. |
| src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css | Updates status dashboard tooltip styling and quota visuals. |
| src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.ts | Refactors dashboard layout (collapsible quick settings), updates quota/overage display, stores collapse state. |
| src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.ts | Updates model management UI to show “Pricing” instead of multiplier. |
| src/vs/workbench/contrib/chat/browser/chat.contribution.ts | Registers new chat input notification service (replaces old widget import). |
| src/vs/workbench/api/common/extHostTypes.ts | Adds ChatInputNotificationSeverity enum to ext host types. |
| src/vs/workbench/api/common/extHostLanguageModels.ts | Wires pricing metadata through ext host language model plumbing. |
| src/vs/workbench/api/common/extHostChatInputNotification.ts | Implements ext host-side ChatInputNotification object + syncing to main thread. |
| src/vs/workbench/api/common/extHost.protocol.ts | Adds DTOs and main-thread shape for chat input notifications. |
| src/vs/workbench/api/common/extHost.api.impl.ts | Exposes chat.createInputNotification (proposed) and severity enum to API surface. |
| src/vs/workbench/api/browser/mainThreadChatInputNotification.ts | Main thread bridge: persists notification DTOs into the notification service. |
| src/vs/workbench/api/browser/extensionHost.contribution.ts | Registers the new main-thread chat input notification actor. |
| src/vs/sessions/electron-browser/sessions-dev.html | Extends dev CSP connect-src to allow localhost HTTP. |
| src/vs/sessions/contrib/chat/browser/newChatInput.ts | Adds notification banner above the Sessions new-chat input area. |
| src/vs/sessions/contrib/chat/browser/media/chatInput.css | Adds Sessions-specific container styling for the notification banner. |
| src/vs/sessions/contrib/accountMenu/test/browser/accountTitleBarState.test.ts | Updates tests for revised quota snapshot shape. |
| src/vs/sessions/contrib/accountMenu/browser/media/accountTitleBarWidget.css | Increases sessions account titlebar panel width. |
| src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts | Updates constant width for the sessions account panel. |
| src/vs/platform/hover/browser/hoverWidget.ts | Adds ResizeObserver-based layout refresh for dynamic HTML hover content. |
| src/vs/platform/extensions/common/extensionsApiProposals.ts | Registers new proposals: chatInputNotification + languageModelPricing; bumps chatProvider proposal version. |
| src/vs/code/electron-browser/workbench/workbench-dev.html | Extends dev CSP connect-src to allow localhost HTTP. |
| src/vs/base/common/defaultAccount.ts | Updates quota snapshot DTO shape (adds reset/token billing fields; removes legacy fields). |
| extensions/copilot/src/vscodeTypes.ts | Re-exports ChatInputNotificationSeverity for Copilot code. |
| extensions/copilot/src/util/common/test/shims/vscodeTypesShim.ts | Adds shim export for ChatInputNotificationSeverity. |
| extensions/copilot/src/util/common/test/shims/chatTypes.ts | Adds shim enum for ChatInputNotificationSeverity. |
| extensions/copilot/src/platform/networking/common/networking.ts | Adds normalized tokenPricing to chat endpoint interface. |
| extensions/copilot/src/platform/endpoint/node/chatEndpoint.ts | Implements token price normalization and exposes tokenPricing. |
| extensions/copilot/src/platform/endpoint/node/autoChatEndpoint.ts | Makes multiplier discount logic handle undefined multiplier safely. |
| extensions/copilot/src/platform/endpoint/common/endpointProvider.ts | Expands billing metadata shape (optional multiplier/is_premium + token_prices). |
| extensions/copilot/src/platform/chat/common/chatQuotaServiceImpl.ts | Replaces “consume warning” flow with onDidChange-driven quota/rate-limit updates. |
| extensions/copilot/src/platform/chat/common/chatQuotaService.ts | Updates service contract to expose events and current quota/rate-limit info. |
| extensions/copilot/src/extension/vscode-api.d.ts | References new proposed chatInputNotification API types for Copilot extension build. |
| extensions/copilot/src/extension/prompt/node/chatParticipantRequestHandler.ts | Avoids rendering multiplier detail when multiplier is undefined. |
| extensions/copilot/src/extension/externalAgents/node/oaiLanguageModelServer.ts | Passes through tokenPricing on endpoint wrapper. |
| extensions/copilot/src/extension/extension/vscode-node/contributions.ts | Registers ChatInputNotificationContribution. |
| extensions/copilot/src/extension/conversation/vscode-node/remoteAgents.ts | Makes billing metadata optional in remote agent model info. |
| extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts | Emits pricing label (multiplier label or token pricing) into model metadata. |
| extensions/copilot/src/extension/conversation/vscode-node/chatParticipants.ts | Removes inline stream warning injection (moved to notification system). |
| extensions/copilot/src/extension/conversation/common/languageModelAccess.ts | Adds formatting helpers for pricing labels. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts | Makes model option description conditional on multiplier presence. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeLanguageModelServer.ts | Passes through tokenPricing on endpoint wrapper. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeModels.ts | Emits pricing label + tooltip for Claude code models. |
| extensions/copilot/src/extension/chatInputNotification/vscode-node/chatInputNotification.contribution.ts | New contribution showing quota/rate-limit notifications in the chat input UI. |
| extensions/copilot/package.json | Enables new proposals and bumps @vscode/copilot-api dependency. |
| extensions/copilot/package-lock.json | Locks updated @vscode/copilot-api version. |
Copilot's findings
Files not reviewed (1)
- extensions/copilot/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.ts:106
- The dismiss control is a custom clickable but only listens for CLICK/KEY_DOWN. In touch environments (notably iOS in the Sessions window), CLICK can be unreliable for non- elements. Consider using the gesture system (Gesture.addTarget) and handling both CLICK and TouchEventType.Tap (or switch this to a real /Button) so dismiss works consistently on touch devices.
- Files reviewed: 53/58 changed files
- Comments generated: 3
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @deepak1556Matched files:
|
No description provided.