From 50831287749240434a4bb00a3bd7a26aff5492fe Mon Sep 17 00:00:00 2001 From: Chris Staley Date: Tue, 31 Mar 2026 17:23:27 -0600 Subject: [PATCH] fix: default missing remainingFraction to 1 instead of 0 Models without quota data (e.g. tab-completion models) were showing 0% because remainingFraction defaulted to 0 when absent. Now defaults to 1 so they show 100% remaining instead. --- open-sse/services/usage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/open-sse/services/usage.ts b/open-sse/services/usage.ts index 698e65fd..0e2c5fc9 100644 --- a/open-sse/services/usage.ts +++ b/open-sse/services/usage.ts @@ -703,8 +703,10 @@ async function getAntigravityUsage(accessToken, providerSpecificData) { continue; } - const remainingFraction = toNumber(quotaInfo.remainingFraction, 0); + const rawFraction = toNumber(quotaInfo.remainingFraction, -1); const resetAt = parseResetTime(quotaInfo.resetTime); + // Default to 100% when the API doesn't report a fraction + const remainingFraction = rawFraction < 0 ? 1 : rawFraction; // Models with no resetTime and full remaining are unlimited (e.g. tab-completion models) const isUnlimited = !resetAt && remainingFraction >= 1; const remainingPercentage = remainingFraction * 100;