Repository navigation
Add chat quota trajectory nudge - #320683
Merged
Paul (pwang347) merged 60 commits intoJun 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new “quota trajectory” (fast credit usage) nudge to chat quota notifications, including telemetry + dismissal persistence, and refines notification action styling/behavior.
Changes:
- Add trajectory-based quota warning logic gated by assignment treatment + stored dismissal per quota period, with telemetry for “shown” and “action clicked”.
- Extend chat input notification actions to support explicit secondary styling and a custom
runhook (used for telemetry). - Update notification widget CSS for improved warning/error visuals and more flexible action/layout wrapping.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/chatQuotaNotification.test.ts | Adds trajectory warning test coverage, including assignment + telemetry mocks and dismissal behavior. |
| src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css | Tweaks severity colors, wraps body layout, and updates secondary button styling. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.ts | Uses explicit secondary action flag and calls optional action.run before command execution. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.ts | Extends action API with secondary?: boolean and run?: () => void. |
| src/vs/workbench/contrib/chat/browser/chatQuotaNotification.ts | Implements trajectory nudge gating, telemetry, dismissal persistence, and hooks into assignment + dismiss events. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.ts:1
action.run?.()is invoked inline without error isolation. If a consumer-providedrunthrows, the command execution will be skipped and the click handler will reject. Wrapaction.runin a try/catch (or otherwise ensure failures don’t blockexecuteCommand) so telemetry hooks can’t break the primary action behavior.
/*---------------------------------------------------------------------------------------------
- Files reviewed: 5/5 changed files
- Comments generated: 3
Contributor
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
Ralph Feltis (rfeltis)
force-pushed
the
rfeltis/quota-trajectory-nudge
branch
from
June 19, 2026 21:08
e45d1ff to
8adc7ce
Compare
Ralph Feltis (rfeltis)
marked this pull request as ready for review
June 22, 2026 17:57
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Remove the package.json configuration test workaround now that the quota trajectory experiment no longer uses a Copilot setting. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Ralph Feltis (rfeltis)
force-pushed
the
rfeltis/quota-trajectory-nudge
branch
from
June 25, 2026 19:02
e6a8908 to
c45e86d
Compare
Restore package files and the Copilot configuration test workaround now that the quota experiment no longer uses a Copilot setting. Co-authored-by: Copilot <[email protected]>
Route treatment resolution failures through ILogService and simplify the trajectory treatment request path/comment. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Revert the chatInputPart.ts additions (Auto is assumed always available) and move 'is auto selected' into the common chatSelectedModel module as isSelectedModelAuto, mirroring the sibling isSelectedModelCopilot. Export the existing AUTO_MODEL_IDENTIFIER from languageModels.ts as the single source of truth, reused by both the nudge's switch-to-Auto command and the detection helper. Co-authored-by: Copilot <[email protected]>
The quota trajectory nudge's Try Auto link was hardcoded to the 'copilot/auto' identifier for both detection and switching. In a Copilot CLI agent-host session the Auto model is registered as 'copilotcli:auto' and the general 'copilot/auto' is filtered out of the session's model pool, so the link silently no-opped and 'already Auto' was never detected. Key Auto off the canonical metadata.id === 'auto' marker instead: add AUTO_MODEL_ID + ILanguageModelChatMetadata.isAutoModel, use it in isSelectedModelAuto, and add a session-aware ChatInputPart.switchToAutoModel() that the nudge calls. Works for both the Copilot panel and the Copilot CLI harness. Co-authored-by: Copilot <[email protected]>
Drop the "switch to Auto" capability and all Auto-model detection from the quota trajectory nudge. The nudge now shows only a learn-more link to https://aka.ms/token-usage-tips and logs chatQuotaTrajectoryNudgeLinkClicked when clicked. Revert the Auto-detection/switching scaffolding back to its pre-PR state: - languageModels.ts: remove AUTO_MODEL_ID export, isAutoModel/isAutoModelIdentifier - chatSelectedModel.ts: remove isSelectedModelAuto - chatInputPart.ts: remove switchToAutoModel - languageModels.test.ts: remove the corresponding suites Co-authored-by: Copilot <[email protected]>
Paul (pwang347)
approved these changes
Jun 27, 2026
Paul (pwang347)
enabled auto-merge (squash)
June 27, 2026 19:18
roblourens
approved these changes
Jun 27, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Jun 27, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
chatQuotaTrajectoryNudgetreatmentcopilotskuinstead of enforcing a Pro/Pro+/Max allowlist in product codeLearn about optimizing usagelink that opens https://aka.ms/token-usage-tipsScreenshots
Treatment arm — the nudge is shown with the
Learn about optimizing usagelink:Treatment arm —
chatQuotaTrajectoryNudgeEnrolledis emitted withtreatment:1in the live Telemetry output (real TAS assignment,chatquotatrajectorynudge-enabled:-9):Treatment arm — after clicking the link,
chatQuotaTrajectoryNudgeLinkClickedis emitted (the nudge dismisses on click):Control arm — no nudge is shown:
Control arm —
chatQuotaTrajectoryNudgeEnrolledis emitted withtreatment:0(real TAS assignment,chatquotatrajectorynudge-control:-9):Experiment targeting
Chat Quota Trajectory Nudge(config.chatQuotaTrajectoryNudge)copilotsku In ("monthly_subscriber_quota","yearly_subscriber_quota","plus_monthly_subscriber_quota","plus_yearly_subscriber_quota","max_monthly_subscriber_quota")IWorkbenchAssignmentService.getTreatment) and still gates on quota state, billing-window projection, Copilot-model selection, and the TAS treatment resultTelemetry
chatQuotaTrajectoryNudgeEnrolled— emitted for both arms once the gates pass and TAS resolves; carriestreatment(true/false),entitlement,averageDailyUsage, andpercentUsedto measure exposurechatQuotaTrajectoryNudgeLinkClicked— emitted when the learn-more link is clicked (treatment arm)Validation
npm run compilenpm run transpile-clientscripts\\test.bat --grep ChatQuotaNotificationdevDeviceIdoverrides); only quota/model eligibility was faked with generated-output-only patches. Screenshots, Playwright traces, and screen recordings were captured from the full native 1600×1000 Code OSS window with the right-side Chat bar visible/asserted for both arms, and each asserted telemetry event was verified visible in the live Telemetry output stream (Developer: Show Telemetry).chatquotatrajectorynudge-control:-9, devDeviceId728565ad-7e67-419e-8d48-a642f7e22480): no nudge shown;chatQuotaTrajectoryNudgeEnrolledemitted withtreatment:0.chatquotatrajectorynudge-enabled:-9, devDeviceId1a69d410-8d55-4e7e-b072-f6b2de8f3e58): nudge shown;chatQuotaTrajectoryNudgeEnrolledemitted withtreatment:1, andchatQuotaTrajectoryNudgeLinkClickedemitted on click.