Add chat quota trajectory nudge#320683
Draft
rfeltis wants to merge 24 commits into
Draft
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" |
rfeltis
commented
Jun 18, 2026
rfeltis
commented
Jun 18, 2026
rfeltis
commented
Jun 18, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove redundant trajectory-shown signature dedup, duplicate storeTrajectoryShown calls, the redundant terminal baseline capture, dead canUpgradePlan test scaffolding, and cosmetic churn. Inline the single-use link-click handler. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Defer the getTreatment exposure until the user has met every condition required to render the nudge, so treatment and control cohorts are assigned at the same point and users who would never see the nudge are not enrolled. Moves the locale check into candidate computation and removes the eager-enrollment gate, restoring the original update flow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the just-in-time experiment enrollment into _computeQuotaTrajectoryWarning so _update stays lean. The method dispatches the async assignment once every render condition is met and returns a warning only for the treatment cohort; while assignment is pending it returns undefined and the remainder of _update falls through. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
getTreatment returns undefined when the user is not in the experiment flight (or assignments are unavailable), which is distinct from being assigned to a control cohort. Store the raw treatment value and render the nudge only on an explicit 'enabled' value, instead of coercing a missing assignment into a synthetic 'control' enrollment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Log a chatQuotaTrajectoryNudgeEnrolled event with the resolved treatment value when the experiment service assigns the user to a flight (treatment is defined), to measure experiment exposure across both arms. No telemetry is emitted when TAS returns no assignment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… experiment ExP for VS Code requires experiment treatment keys to be prefixed with config. The treatment is a simple yes/no, so use a boolean type instead of a string. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove trajectory nudge shown and dismissed interaction telemetry now that generic chat input notification telemetry covers those interactions. Keep the learn more link click event because it is specific to this nudge. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e45d1ff to
8adc7ce
Compare
rfeltis
commented
Jun 19, 2026
rfeltis
commented
Jun 19, 2026
rfeltis
commented
Jun 19, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
chatQuotaTrajectoryNudgetreatmentValidation
npm run compile-check-ts-native -- --pretty falsenpm run transpile-clientscripts\\test.bat --run src/vs/workbench/contrib/chat/test/browser/chatQuotaNotification.test.ts --timeout 10000(50 passing)node --experimental-strip-types build\\hygiene.ts ...npm run valid-layers-checknpm run precommitvscode.chat.updateQuotas