Skip to content

Don't skip quota bucket when hasQuota: false#314874

Merged
pwang347 merged 2 commits intomainfrom
pawang/hasQuotaFix
May 6, 2026
Merged

Don't skip quota bucket when hasQuota: false#314874
pwang347 merged 2 commits intomainfrom
pawang/hasQuotaFix

Conversation

@pwang347
Copy link
Copy Markdown
Member

@pwang347 pwang347 commented May 6, 2026

Related #314238

Copilot AI review requested due to automatic review settings May 6, 2026 23:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts chat quota snapshot parsing so that quota buckets are not dropped solely because has_quota is false (notably under token-based billing), while still filtering out buckets that represent “no allocated credits” (e.g. entitlement: 0 and not unlimited). This keeps quota UI/telemetry behavior aligned with the service’s snapshot semantics.

Changes:

  • Update parseQuotas to no longer skip snapshots based on has_quota === false, and instead skip only non-unlimited snapshots with entitlement === 0.
  • Add/adjust unit tests to cover keeping TBB snapshots with has_quota: false and skipping zero-entitlement non-unlimited snapshots.
Show a summary per file
File Description
src/vs/workbench/services/chat/common/chatEntitlementService.ts Changes quota snapshot filtering logic to avoid dropping buckets purely due to has_quota: false.
src/vs/workbench/contrib/chat/test/common/chatEntitlementService.test.ts Adds coverage for the new filtering behavior and updates fixtures/assertions accordingly.

Copilot's findings

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

Comment thread src/vs/workbench/contrib/chat/test/common/chatEntitlementService.test.ts Outdated
@pwang347 pwang347 marked this pull request as ready for review May 6, 2026 23:30
@pwang347 pwang347 enabled auto-merge (squash) May 6, 2026 23:32
@pwang347 pwang347 merged commit 468fa08 into main May 6, 2026
26 checks passed
@pwang347 pwang347 deleted the pawang/hasQuotaFix branch May 6, 2026 23:47
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 6, 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