10000 102% usage (fix microsoft/vscode-copilot#17284) by bpasero · Pull Request #248776 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

102% usage (fix microsoft/vscode-copilot#17284) #248776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ export class ChatEntitlementRequests extends Disposable {
if (response.monthly_quotas?.chat && typeof response.limited_user_quotas?.chat === 'number') {
quotas.chat = {
total: response.monthly_quotas.chat,
percentRemaining: (response.limited_user_quotas.chat / response.monthly_quotas.chat) * 100,
percentRemaining: Math.min(100, Math.max(0, (response.limited_user_quotas.chat / response.monthly_quotas.chat) * 100)),
overageEnabled: false,
overageCount: 0,
unlimited: false
Expand All @@ -651,7 +651,7 @@ export class ChatEntitlementRequests extends Disposable {
if (response.monthly_quotas?.completions && typeof response.limited_user_quotas?.completions === 'number') {
quotas.completions = {
total: response.monthly_quotas.completions,
percentRemaining: (response.limited_user_quotas.completions / response.monthly_quotas.completions) * 100,
percentRemaining: Math.min(100, Math.max(0, (response.limited_user_quotas.completions / response.monthly_quotas.completions) * 100)),
overageEnabled: false,
overageCount: 0,
unlimited: false
Expand All @@ -667,7 +667,7 @@ export class ChatEntitlementRequests extends Disposable {
}
const quotaSnapshot: IQuotaSnapshot = {
total: rawQuotaSnapshot.entitlement,
percentRemaining: rawQuotaSnapshot.percent_remaining,
percentRemaining: Math.min(100, Math.max(0, rawQuotaSnapshot.percent_remaining)),
overageEnabled: rawQuotaSnapshot.overage_permitted,
overageCount: rawQuotaSnapshot.overage_count,
unlimited: rawQuotaSnapshot.unlimited
Expand Down
Loading
0