Skip to content

Reduce noise from quota exceeded input notification#322005

Draft
pwang347 wants to merge 1 commit into
mainfrom
pawang/noisyBanner
Draft

Reduce noise from quota exceeded input notification#322005
pwang347 wants to merge 1 commit into
mainfrom
pawang/noisyBanner

Conversation

@pwang347

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 18, 2026 21:42

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 reduces repeated chat “credit limit reached” input notifications by persisting a user dismissal of the quota-exhausted banner across window reloads, and clearing that persisted dismissal once quota becomes available again.

Changes:

  • Persist a boolean flag in IStorageService when the user dismisses the exhausted/quota-exceeded notification.
  • Suppress re-showing the exhausted notification (including managed-plan blocked / overage-at-100% variants) while the persisted dismissal is set.
  • Add unit tests to validate dismissal persistence across “reloads” and that the notification can re-appear after quota recovery.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/chatQuotaNotification.ts Persists and checks an “exhausted dismissed” storage flag to avoid re-showing quota-exceeded notifications across reloads until quota recovers.
src/vs/workbench/contrib/chat/test/browser/chatQuotaNotification.test.ts Extends the mock notification service to support dismissal events and adds tests covering dismissal persistence and reset-on-recovery.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

Comment on lines 117 to +133
private _update(): void {
const entitlement = this._chatEntitlementService.entitlement;
const isCopilot = this._isCopilotModelSelected();

// Defer new notifications when a BYOK model is selected or the model
// selection hasn't loaded yet — quota only applies to Copilot models.
// Already-shown notifications stay visible.
if (!isCopilot) {
return;
}

// Once quota recovers (credit is available again) drop any persisted
// dismissal so the quota-exceeded notification can show the next time
// quota runs out.
if (!this._isExhaustedState()) {
this._clearExhaustedDismissed();
}
Comment on lines +275 to +279
const notification = first.notificationMock.getNotification();
assert.ok(notification);
first.notificationMock.dismiss(notification!.id);

// Reload: new contribution with the same (persisted) storage and still-exhausted quota.
Comment on lines +297 to +304
first.notificationMock.dismiss(first.notificationMock.getNotification()!.id);

// Quota recovers — persisted dismissal is cleared.
updateQuotas(first.entitlementMock, { premiumChat: makeQuotaSnapshot(50) });

// Reload while exhausted again — notification shows because the flag was cleared.
const second = createContribution(
{ quotas: { usageBasedBilling: true, premiumChat: makeQuotaSnapshot(0) } },
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.

2 participants