Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(usage): show Antigravity Gemini limits when one quota endpoint omits them #20081

Mergedpauliusiv123-rgb(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/20081/headmerged by juliusmarminge View on GitHub

Problem

On some Google sign-ins, Usage → Limits shows only the shared Claude & GPT allowance for Antigravity and never the Gemini allowance, although the user guide says both appear. The quota probe asked daily-cloudcode-pa first and returned the first non-empty answer, and that host can return only the "Claude and GPT models" group.

Change

fetchWindows in apps/server/src/provider/antigravityUsageLimits.ts now queries both Cloud Code hosts concurrently and merges their windows by bucket id. When both hosts report the same bucket, the more-used reading wins, the same rule modelWindows already applies to duplicate model quotas. A host that fails or times out contributes nothing, as before. The fetchAvailableModels fallback goes through the same function, so it merges both hosts too.

Trade-off: each probe now always makes two quota requests instead of usually one, and waits for the slower host. That wait is still bounded by the existing 10-second per-request timeout.

Scope and approval

Related: #16104. An earlier comment there found both hosts returned the same response, which is why the first-non-empty fallback was reasonable when #17530 added it. That no longer holds for every account. This PR does not close the issue.

This is a very small, focused fix for an obvious bug. The probe already parses both quota groups (#17530) and the user guide promises both, but only the first host's answer was used. The change only alters how the two existing endpoint responses are combined. It adds no setting, contract, UI or endpoint.

Verification

Reproduction. Installed T3 Code Nightly 0.0.46-nightly.20261015.3171, Windows x64, Antigravity with a personal Google sign-in (oauth-personal), 2026-10-16. I called both hosts with the request T3 sends (same User-Agent, { project } body, access token from the instance's sign-in). Tokens, ids and reset times removed, fractions rounded.

HostPOST /v1internal:retrieveUserQuotaSummary
daily-cloudcode-pa.googleapis.comHTTP 200. One group, "Claude and GPT models": 3p-weekly (weekly, ≈ 0.0001 remaining), 3p-5h (5h, 1). No Gemini group.
cloudcode-pa.googleapis.comHTTP 200. "Gemini Models": gemini-weekly (weekly, ≈ 0.63), gemini-5h (5h, 1). "Claude and GPT models": same 3p-* values.

With the installed nightly, Usage → Limits showed only "Claude & GPT (shared) · Weekly" and "Claude & GPT (shared) · 5-hour".

After the fix. I ran the patched makeAntigravityUsageProbe once against the same live sign-in (a throwaway local test, not committed). It returned four windows: 3p-5h (0% used), 3p-weekly (100%), gemini-5h (0%), gemini-weekly (37.1%).

Tests

  • New merges quota groups that only one endpoint reports: the daily host returns only the Claude/GPT group, with readings that differ from the other host. It asserts all four windows are present and that the more-used reading wins regardless of which host reported it.
  • New keeps one endpoint's quotas when the other fails: the daily host returns 503, and the other host's four windows are still reported.
  • The existing probe test now expects four quota-summary requests across its two probes.
  • Against the previous fetchWindows, the first two of those fail (expected [ '3p-5h', '3p-weekly' ] to deeply equal [ … 4 ids ], and expected … to have a length of 4 but got 2).
  • vp test run apps/server/src/provider/antigravityUsageLimits.test.ts: 10 passed.
  • vp lint on both files: no findings. vp fmt --check on both files: clean.
  • Server typecheck (tsc-rs --noEmit in apps/server): exit 0, no diagnostics in the changed files.

Not checked

  • The patched server inside a running app. The after-fix evidence is the probe function run directly against Google.
  • Whether the daily host's missing Gemini group is persistent or specific to this account. One account was checked.
  • Workspace (oauth-business) sign-ins, and older accounts that only expose fetchAvailableModels.
  • Hosts disagreeing right after a reset: the more-used (pre-reset) reading would show until both hosts agree.

No docs change: the user guide already describes the behavior this restores.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at 1c7a857

      Macroscope's review found this PR approvable — This is a small, well-scoped usage bug fix that merges quota data from the two existing endpoints while preserving partial-failure behavior. The only notable runtime change is two concurrent quota requests per probe, covered by focused tests and existing timeouts.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. 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: ba7a3318-aed6-48db-8003-7ab2c3859397
      📥 Commits

      Reviewing files that changed from the base of the PR and between fa1184d29eb0ecad789129118c592d3c8303ee97 and 1c7a857b84425cb984781b487949a7dedac9a495.

      📒 Files selected for processing: 2
      • apps/server/src/provider/antigravityUsageLimits.test.ts
      • apps/server/src/provider/antigravityUsageLimits.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      📝 Walkthrough

      The quota probe now queries both Antigravity endpoints concurrently. It merges windows from successful responses and keeps the higher-usage reading when both endpoints return the same window ID.

      Changes: Antigravity quota aggregation

      Layer / File(s)Summary
      Fetch and merge quota windows
      apps/server/src/provider/antigravityUsageLimits.ts, apps/server/src/provider/antigravityUsageLimits.test.ts
      fetchWindows queries both endpoints concurrently and merges parsed windows. For duplicate IDs, it keeps the reading with higher usedPercent. Tests cover four requests per probe, results from both endpoints, duplicate windows, and an HTTP 503 response from one endpoint.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to 1c7a8

      No merge-blocking issue is identified; the quota change is ready for normal merge checks.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly identifies the Antigravity usage-limit fix and the missing Gemini limits caused by an incomplete quota endpoint response.
      Description checkPassedThe description covers the problem, implementation, scope and approval rationale, verification results, trade-offs, and known limitations. It includes focused test and manual verification details.
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      ✨ 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. juliusmarminge merged this340ee23

    5. juliusmarminge closed this

Sign in to join this conversation.