fix(server): Antigravity Gemini limits show consumed quota instead of 100% left #23011
main fromrefs/pull/23011/head·opened View on GitHubProblem#
On personal Google accounts, Usage → Limits shows Antigravity's Gemini 5-hour and weekly quotas at 100% left after they've been used. On the 2026-10-15 nightly the Gemini rows are missing entirely, as @DavidCzartoryski reported on the issue.
Both come from the probe's antigravity/hub/1.0.0 User-Agent. For that client, the daily endpoint's retrieveUserQuotaSummary returns only the Claude & GPT buckets. The production endpoint reports Gemini as unused, or on some accounts also leaves it out. Main merges both endpoints and keeps the most-used reading, so Gemini shows 100% left, or no Gemini rows at all when production leaves it out too. The older nightly stops at the first endpoint that returns anything, so Gemini never appears.
Change#
- The probe now sends
antigravity/hub/2.24.0, the version the Antigravity IDE sent in @DeepitMagee's capture on #21115. Nothing else in the header or request changes. With that version the daily endpoint returns the consumed Gemini buckets (on some accounts production does too), and the existing merge keeps the most-used reading. - In the summary, Argon's weekly bucket keeps the service's group name, so it reads "Gemini 4 Argon · Weekly". On those accounts the legacy client already receives that bucket, and every
gemini-bucket is labeled "Gemini", so it fills the "Gemini · Weekly" row today. Once the version change brings back the realgemini-weeklybucket, Argon accounts would get two rows with that label, as @markshan00 pointed out.
The version is the only part of the header that changes. It's the one variable that decided the result in the captures on #21115, where triage also tied the missing rows to the 1.0.0 User-Agent.
Scope and approval#
Fixes #22876, the focused follow-up requested in the closing comment on #21115 for the part that's still open: Gemini readings still use the 1.0.0 User-Agent. The Argon label is part of the same fix, because without it the version change would give Argon accounts two "Gemini · Weekly" rows. The model-quota fallback is unchanged. It only runs when the summary is empty, so the version change doesn't reach it.
Related open PRs:
- #21361 (@hi-konduit) sends the ACP identity instead and labels Argon separately in the summary and in the model-quota fallback. Both identities return the Gemini group on the daily endpoint (comparison on #21115). The ACP identity changes the product token, version, architecture spelling and fields of the header, while this PR changes only the version. Argon's model-fallback windows are left to #21361.
- #21020 also resolves the quota project through
loadCodeAssist, rewritesos_type/archto Go spellings, and merges 5-hour readings fromfetchAvailableModels. None of that is needed for this bug: the captures show the version is the only variable, the summary returns both 5-hour buckets with2.24.0on all three accounts below, and Mark's check shows thewin32/x64andlinux/x64headers return the Gemini group.
Verification#
I tested this myself on my own personal Google account (macOS arm64). I ran a Gemini thread in Antigravity to use some quota, then opened Usage → Limits on a dev build of this branch, and a minute earlier with only the version string switched back to main's 1.0.0.
main (hub/1.0.0) | this PR (hub/2.24.0) |
|---|---|
![]() | ![]() |
Main shows Gemini at 100% left after the quota was used. With this change it shows 95% (5-hour) and 97% (weekly), and the 5-hour reset is the consumed window's fixed time instead of a rolling one.
Direct retrieveUserQuotaSummary requests from the same account and credential, changing only the version (fraction left):
| Host | hub/1.0.0 | hub/2.24.0 |
|---|---|---|
| daily | Claude & GPT buckets only, no Gemini | gemini-5h 0.960, gemini-weekly 0.979 |
| production | every bucket 1 | every bucket 1 |
@DavidCzartoryski (comment) and @markshan00 (comment) confirmed the fix on their own accounts. On David's, the readings match agy's Models & Quota. On Mark's, production also drops Gemini for hub/1.0.0 and returns the consumed quota for hub/2.24.0. Mark also sent the exact header the probe builds for darwin/arm64, darwin/x64, win32/x64 and linux/x64 to the daily endpoint; all four returned the Gemini group (comment).
Tests, in apps/server/src/provider/antigravityUsageLimits.test.ts:
- The daily endpoint omits the Gemini group for the 1.0.0 client and production reports every bucket unused, matching the table in the issue. On main it reads Gemini as 0% used (
expected +0 to be close to 9); with this change it reads the daily values (9% and 4%). - A summary with the Argon group gives five rows with distinct labels, Argon's as "Gemini 4 Argon · Weekly". Without the label change it fails (
expected 4 to be 5: two rows share "Gemini · Weekly"). vp test run apps/server/src/provider/antigravityUsageLimits.test.ts apps/server/src/provider/AntigravityProvider.test.ts: 29 passed.- Scoped
vp lintandvp fmt --checkon the two changed files, and the server typecheck, pass.
Not checked: Workspace accounts, a live account with an Argon allowance (the Argon response shape comes from the captures in #21361 and Mark's comment), or real Windows and Linux machines beyond their header strings.
Model: Claude Opus 5.5 via Claude Code, in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
0d35f99Macroscope's review found this PR approvable — This narrowly scoped fix updates the Antigravity quota client version so Gemini consumption is returned correctly, with a regression test covering the legacy-client behavior. It does not change schemas, deployment, or processing workflows.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1bee491e-493d-445e-97b7-2962383adfe1
📥 Commits
-
Reviewing files that changed from the base of the PR and between a003f33b99b1fcb6a56a05d5e6ce8cc70b17e6b2 and d52400b1f4d412a2c0fce83088f99df56a101423.
📒 Files selected for processing: 2
-
apps/server/src/provider/antigravityUsageLimits.test.tsapps/server/src/provider/antigravityUsageLimits.ts
💤 Files with no reviewable changes: 1
-
- apps/server/src/provider/antigravityUsageLimits.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
📝 Walkthrough
-
The Antigravity quota request now uses client version
2.24.0. Gemini Argon buckets receive distinct labels. Tests cover legacy daily responses, Gemini usage recovery, and Argon quota metadata.Changes: Antigravity Gemini quota reporting
Layer / File(s) Summary Gemini quota classification and coverage
apps/server/src/provider/antigravityUsageLimits.ts,apps/server/src/provider/antigravityUsageLimits.test.tsgemini-argon-*buckets use their trimmed group name orGemini 4 Argon. Tests verify distinct Argon labels, weekly duration, reset metadata, and usage values.Quota request identity and legacy-response coverage
apps/server/src/provider/antigravityUsageLimits.ts,apps/server/src/provider/antigravityUsageLimits.test.tsThe request User-Agentchanges toantigravity/hub/2.24.0. The fixture can omit Gemini from legacy daily responses. Tests verify Gemini usage from the other endpoint.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related issues
- None identified.
Suggested reviewers:
maseeek
Merge Risk: ⚪ Minimal · up to
d5240-
The changed quota behavior has targeted regression coverage, and no issue requiring a fix before merge was identified.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main change: fixing Antigravity Gemini quota limits that incorrectly showed 100% remaining. Description check The description includes all required sections. It explains the problem, implementation, scope and approval, verification results, test coverage, and known limitations. It also identifies the agent mo… Linked Issues check Issue #22876requires accurate Gemini five-hour and weekly quotas for affected personal Google accounts.antigravityUsageLimits.tschanges the probe identity fromantigravity/hub/1.0.0to `antigra…Out of Scope Changes check The production changes are limited to the request version required by #22876and the Argon label classification needed to prevent duplicate quota labels after Gemini buckets return. The added tests co…Full details: Description check
-
Explanation
The description includes all required sections. It explains the problem, implementation, scope and approval, verification results, test coverage, and known limitations. It also identifies the agent model and harness used.
Full details: Linked Issues check
-
Explanation
Issue
#22876requires accurate Gemini five-hour and weekly quotas for affected personal Google accounts.antigravityUsageLimits.tschanges the probe identity fromantigravity/hub/1.0.0toantigravity/hub/2.24.0and leaves the other header fields unchanged. The added test models the legacy daily omission and unused production buckets, then verifies consumed Gemini readings. The Argon grouping change keepsGemini 4 Argon · Weeklydistinct fromGemini · Weekly.
Full details: Out of Scope Changes check
-
Explanation
The production changes are limited to the request version required by
#22876and the Argon label classification needed to prevent duplicate quota labels after Gemini buckets return. The added tests cover both behaviors. No unrelated production files or behavior appear in the reviewed diff.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
This fixes it for my account. I ran this branch (
0d35f99) against the account from my report on #22876 (personal Google sign-in, macOS arm64).Live probe, 2026-10-21 13:55 EDT. Same credential, run back to back, only the probe source swapped:
Bucket main ( hub/1.0.0)this PR ( hub/2.24.0)agyModels & Quota, ~20 min earlierGemini · 5-hour 100% left, resets now + 5h 60.77% left, resets 15:09 EDT 65.64%, refreshes in 1h 33m Gemini · Weekly 100% left, resets now + 7d 82.69% left, resets Oct 27 23:47 EDT 85.23%, refreshes in 154h 11m Claude & GPT (shared) · 5-hour 100% 100% 100% Claude & GPT (shared) · Weekly 100% 100% 100% With this branch the Gemini reset times line up with
agy's countdowns. The remaining percentages are a few points lower thanagyshowed, which fits the Gemini usage from a thread that was running in between. On main, both Gemini windows read as unused and reset at "now + window", the same rolling countdown described in #22815.Tests on this branch:
vp test run apps/server/src/provider/antigravityUsageLimits.test.ts apps/server/src/provider/AntigravityProvider.test.ts: 28 passed.- Running the new test against main's
antigravityUsageLimits.tsfails as expected (expected +0 to be close to 9).
I called
makeAntigravityUsageProbedirectly withFetchHttpClientand a copy of the instance'sacp_token.json. I didn't build the desktop app from this branch, so I haven't checked the Limits panel itself.Verified on my account as well (macOS arm64, personal Google sign-in, running
makeAntigravityUsageProbewithFetchHttpClientagainst the liveacp_token.jsonat 2026-10-21 18:20 UTC).1.
makeAntigravityUsageProbeoutput (mainvs0d35f99)#Window main(9179178,hub/1.0.0)This PR ( 0d35f99,hub/2.24.0)gemini-5h(Gemini · 5-hour)not returned 8.68% used ( 91.32% left),resetsAt: 2026-10-21T18:29:53.000Zgemini-weekly(Gemini · Weekly)not returned 10.54% used ( 89.46% left),resetsAt: 2026-10-28T08:29:53.000Z3p-5h(Claude & GPT (shared) · 5-hour)0% used(resetsAt: 2026-10-21T23:21:00.000Z)0% used(resetsAt: 2026-10-21T23:20:55.000Z)3p-weekly(Claude & GPT (shared) · Weekly)0% used(resetsAt: 2026-10-28T18:21:00.000Z)0% used(resetsAt: 2026-10-28T18:20:55.000Z)2. Per-endpoint raw
retrieveUserQuotaSummarybehavior (2026-10-21 18:21 UTC)#Host User-AgentReturned buckets ( remainingFraction@resetTime)daily-cloudcode-pa.googleapis.comantigravity/hub/1.0.0 (...)3p-weekly: 1,3p-5h: 1(Gemini group omitted)daily-cloudcode-pa.googleapis.comantigravity/hub/2.24.0 (...)gemini-weekly: 0.89951617 @ 2026-10-28T08:29:53Z,gemini-5h: 0.9127226 @ 2026-10-21T18:29:53Z,3p-weekly: 1,3p-5h: 1cloudcode-pa.googleapis.comantigravity/hub/1.0.0 (...)3p-weekly: 1,3p-5h: 1(Gemini group omitted)cloudcode-pa.googleapis.comantigravity/hub/2.24.0 (...)gemini-weekly: 0.892744 @ 2026-10-28T08:29:53Z,gemini-5h: 0.908306 @ 2026-10-21T18:29:53Z,3p-weekly: 1,3p-5h: 1Notably, on this account
cloudcode-pa.googleapis.comhas now started omitting theGemini Modelsgroup forhub/1.0.0too (while still returning3p-*, which keepssummarynon-empty and prevents thefetchAvailableModelsfallback onmain). Switching the probeUser-Agenttoantigravity/hub/2.24.0restores the consumedgemini-5handgemini-weeklybuckets on both hosts.3. Unit tests#
vp test run apps/server/src/provider/antigravityUsageLimits.test.ts apps/server/src/provider/AntigravityProvider.test.ts: 28 passed (2 files).- Running the new test against
main'santigravityUsageLimits.tsfails as expected (AssertionError: expected +0 to be close to 9).
Thank you to the both of you for testing this!!
@markshan00 @DavidCzartoryski
Happy to help, and thanks for putting this clean fix together so quickly! 🙌
Two small follow-up notes after checking platform headers and edge cases in
antigravityUsageLimits.ts:1. Windows / Linux
os_typeandarchtokens withhub/2.24.0#Since Node's
process.platform/process.archemitos_type=win32; arch=x64on 64-bit Windows andos_type=linux; arch=x64on 64-bit Linux (rather thanwindows/amd64), I tested the exactUser-Agentstrings produced bymakeAntigravityUsageProbefor each target againstdaily-cloudcode-pa.googleapis.comwith the same credential (2026-10-21 18:34 UTC):os_type/archinantigravity/hub/2.24.0 (...)Status Returned buckets ( remainingFraction)os_type=darwin; arch=arm64200gemini-weekly: 0.8882338,gemini-5h: 0.96974814,3p-weekly: 1,3p-5h: 1os_type=darwin; arch=x64200gemini-weekly: 0.8882338,gemini-5h: 0.96974814,3p-weekly: 1,3p-5h: 1os_type=win32; arch=x64200gemini-weekly: 0.8882338,gemini-5h: 0.96974814,3p-weekly: 1,3p-5h: 1os_type=linux; arch=x64200gemini-weekly: 0.8882338,gemini-5h: 0.96974814,3p-weekly: 1,3p-5h: 1So
win32andx64do not preventhub/2.24.0from returning the Gemini group.2. Interaction with
gemini-argon-wtu-weeklyon Argon-enabled accounts (#21361)#One subtle side effect of restoring
gemini-weeklyviahub/2.24.0: insummaryWindows(lines 107–111),familyis currently selected with:const family = bucket.bucketId.startsWith("gemini-") ? "Gemini" : bucket.bucketId.startsWith("3p-") ? "Claude & GPT (shared)" : group.displayName?.trim() || bucket.bucketId;On accounts that also receive the
Gemini 4 Argongroup (bucketId: "gemini-argon-wtu-weekly",window: "weekly"),hub/1.0.0previously hidgemini-weeklyso only the Argon bucket appeared asGemini · Weekly. Withhub/2.24.0, bothgemini-weeklyandgemini-argon-wtu-weeklyare returned, and because both start with"gemini-",summaryWindowsoverridesgroup.displayName("Gemini 4 Argon") and produces two rows both labeledGemini · Weekly.Keeping this PR scoped to the
2.24.0version bump makes sense for #22876, and either #21361 or narrowingbucket.bucketId.startsWith("gemini-")(sogroup.displayNameis preserved for non-defaultgemini-*groups likegemini-argon-*) will cleanly avoid the duplicate label.github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XS
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes