Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Antigravity Gemini limits show consumed quota instead of 100% left #23011

Closedwhoisaldo(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/23011/headopened View on GitHub

Problem

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 real gemini-weekly bucket, 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, rewrites os_type/arch to Go spellings, and merges 5-hour readings from fetchAvailableModels. None of that is needed for this bug: the captures show the version is the only variable, the summary returns both 5-hour buckets with 2.24.0 on all three accounts below, and Mark's check shows the win32/x64 and linux/x64 headers 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)
Usage → Limits on main: Gemini 5-hour and weekly both show 100% leftUsage → Limits with this PR: Gemini 5-hour 95% left, weekly 97% left

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):

Hosthub/1.0.0hub/2.24.0
dailyClaude & GPT buckets only, no Geminigemini-5h 0.960, gemini-weekly 0.979
productionevery bucket 1every 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 lint and vp fmt --check on 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

    2. Approvability

      Verdict: Approved at 0d35f99

      Macroscope'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).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.ts
      • apps/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.ts
      gemini-argon-* buckets use their trimmed group name or Gemini 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.ts
      The request User-Agent changes to antigravity/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: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: fixing Antigravity Gemini quota limits that incorrectly showed 100% remaining.
      Description checkPassedThe 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 checkPassedIssue #22876 requires accurate Gemini five-hour and weekly quotas for affected personal Google accounts. antigravityUsageLimits.ts changes the probe identity from antigravity/hub/1.0.0 to `antigra…
      Out of Scope Changes checkPassedThe production changes are limited to the request version required by #22876 and 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 #22876 requires accurate Gemini five-hour and weekly quotas for affected personal Google accounts. antigravityUsageLimits.ts changes the probe identity from antigravity/hub/1.0.0 to antigravity/hub/2.24.0 and 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 keeps Gemini 4 Argon · Weekly distinct from Gemini · Weekly.

      Full details: Out of Scope Changes check

      Explanation

      The production changes are limited to the request version required by #22876 and 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
      Comment `@coderabbitai help` to get the list of available commands.
    4. 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:

      Bucketmain (hub/1.0.0)this PR (hub/2.24.0)agy Models & Quota, ~20 min earlier
      Gemini · 5-hour100% left, resets now + 5h60.77% left, resets 15:09 EDT65.64%, refreshes in 1h 33m
      Gemini · Weekly100% left, resets now + 7d82.69% left, resets Oct 27 23:47 EDT85.23%, refreshes in 154h 11m
      Claude & GPT (shared) · 5-hour100%100%100%
      Claude & GPT (shared) · Weekly100%100%100%

      With this branch the Gemini reset times line up with agy's countdowns. The remaining percentages are a few points lower than agy showed, 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.ts fails as expected (expected +0 to be close to 9).

      I called makeAntigravityUsageProbe directly with FetchHttpClient and a copy of the instance's acp_token.json. I didn't build the desktop app from this branch, so I haven't checked the Limits panel itself.

    5. Verified on my account as well (macOS arm64, personal Google sign-in, running makeAntigravityUsageProbe with FetchHttpClient against the live acp_token.json at 2026-10-21 18:20 UTC).

      1. makeAntigravityUsageProbe output (main vs 0d35f99)

      Windowmain (9179178, hub/1.0.0)This PR (0d35f99, hub/2.24.0)
      gemini-5h (Gemini · 5-hour)not returned8.68% used (91.32% left), resetsAt: 2026-10-21T18:29:53.000Z
      gemini-weekly (Gemini · Weekly)not returned10.54% used (89.46% left), resetsAt: 2026-10-28T08:29:53.000Z
      3p-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 retrieveUserQuotaSummary behavior (2026-10-21 18:21 UTC)

      HostUser-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: 1
      cloudcode-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: 1

      Notably, on this account cloudcode-pa.googleapis.com has now started omitting the Gemini Models group for hub/1.0.0 too (while still returning 3p-*, which keeps summary non-empty and prevents the fetchAvailableModels fallback on main). Switching the probe User-Agent to antigravity/hub/2.24.0 restores the consumed gemini-5h and gemini-weekly buckets 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's antigravityUsageLimits.ts fails as expected (AssertionError: expected +0 to be close to 9).
    6. Thank you to the both of you for testing this!!

      @markshan00 @DavidCzartoryski

    7. markshan00(GitHub profile, opens in a new tab)commented

      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_type and arch tokens with hub/2.24.0

      Since Node's process.platform / process.arch emit os_type=win32; arch=x64 on 64-bit Windows and os_type=linux; arch=x64 on 64-bit Linux (rather than windows / amd64), I tested the exact User-Agent strings produced by makeAntigravityUsageProbe for each target against daily-cloudcode-pa.googleapis.com with the same credential (2026-10-21 18:34 UTC):

      os_type / arch in antigravity/hub/2.24.0 (...)StatusReturned buckets (remainingFraction)
      os_type=darwin; arch=arm64200gemini-weekly: 0.8882338, gemini-5h: 0.96974814, 3p-weekly: 1, 3p-5h: 1
      os_type=darwin; arch=x64200gemini-weekly: 0.8882338, gemini-5h: 0.96974814, 3p-weekly: 1, 3p-5h: 1
      os_type=win32; arch=x64200gemini-weekly: 0.8882338, gemini-5h: 0.96974814, 3p-weekly: 1, 3p-5h: 1
      os_type=linux; arch=x64200gemini-weekly: 0.8882338, gemini-5h: 0.96974814, 3p-weekly: 1, 3p-5h: 1

      So win32 and x64 do not prevent hub/2.24.0 from returning the Gemini group.

      2. Interaction with gemini-argon-wtu-weekly on Argon-enabled accounts (#21361)

      One subtle side effect of restoring gemini-weekly via hub/2.24.0: in summaryWindows (lines 107–111), family is 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 Argon group (bucketId: "gemini-argon-wtu-weekly", window: "weekly"), hub/1.0.0 previously hid gemini-weekly so only the Argon bucket appeared as Gemini · Weekly. With hub/2.24.0, both gemini-weekly and gemini-argon-wtu-weekly are returned, and because both start with "gemini-", summaryWindows overrides group.displayName ("Gemini 4 Argon") and produces two rows both labeled Gemini · Weekly.

      Keeping this PR scoped to the 2.24.0 version bump makes sense for #22876, and either #21361 or narrowing bucket.bucketId.startsWith("gemini-") (so group.displayName is preserved for non-default gemini-* groups like gemini-argon-*) will cleanly avoid the duplicate label.

    8. Note

      🤖 GPT-6.1 Terra [1m] responding on behalf of Theo

      Closing because main already sends the hub/2.24.0 user agent that returns consumed Gemini quota and labels Argon separately from the weekly bucket. #28090 #22876

Sign in to join this conversation.