Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): exhausted Antigravity quotas show as used up instead of disappearing #29565

Closedsaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/29565/headopened View on GitHub

Problem

When an Antigravity quota runs out, it disappears from the usage limits instead of showing 100% used with its reset time. The user sees fewer rows than usual at the exact moment the limit matters most.

Google's quota endpoints (v1internal:fetchAvailableModels and retrieveUserQuotaSummary) return proto3 JSON, which leaves out zero-valued fields. An exhausted quota therefore arrives as {"resetTime": "..."} with no remainingFraction. Other Antigravity tools have seen this on real accounts (for example gajae-code#7267, where every exhausted gemini-* model returned only {"resetTime":"2026-10-31T00:30:21Z"}). quotaWindow dropped any quota with a missing remainingFraction, so these pools vanished. In the model fallback, an exhausted model could also be hidden behind a less-used sibling in the same family.

Change

In quotaWindow, a quota that has a valid resetTime but no remainingFraction is now read as remainingFraction: 0 (fully used). A quota with neither field is still skipped, as before. Untouched-bucket reset hiding (summaryResetTime) only applies when remainingFraction === 1, so it is unaffected.

Scope and approval

Very small, focused fix for an obvious bug, so no prior issue: one parser function treats the API's encoding of "0 remaining" as "no data". The change is 5 non-test lines plus extensions of two existing test cases.

Overlap search: local PR index and gh search for Antigravity quota/remaining/exhausted. The closest is open #21020, a broad, conflicting PR that also resolves quota projects and changes the UI. It guesses a zero for summary buckets from description text and does not cover model quotas. #23558 and #20081 (merged) cover untouched resets and endpoint merging, not missing fractions.

Verification

  • Red on main (cd apps/server && vp test run src/provider/antigravityUsageLimits.test.ts): falls back to model quotas… failed with expected 40 to be 100, and the summary case failed because the exhausted gemini-weekly window was missing.
  • Green on this branch: 16/16 in antigravityUsageLimits.test.ts, 22/22 in AntigravityProvider.test.ts.
  • vp run check:changed: format, lint, knip, typecheck (3 packages), and tests all pass.
  • Not checked: a live Antigravity account with an exhausted quota. The payload shape comes from the linked reports.

Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

    1. Approvability

      Verdict: Approved at 04f77b7

      Macroscope's review found this PR approvable — Exhausted Antigravity quotas with an omitted remaining fraction and valid reset time now appear as fully used rather than disappearing. The change is confined to quota reporting and retains existing validation safeguards.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    2. Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between cbd3e149a130f1d99d2d067c77b9889d64e28755 and 04f77b76a03d1ddd6d44ca67e07ff1df83501c84.

      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; 7 remain after this review.

      Walkthrough

      Quota windows now treat a missing remaining fraction as exhausted when the reset time is valid. Tests cover model fallback and summary-bucket results.

      Changes: Quota window handling

      Layer / File(s)Summary
      Missing-fraction quota handling
      apps/server/src/provider/antigravityUsageLimits.ts, apps/server/src/provider/antigravityUsageLimits.test.ts
      quotaWindow defaults a missing fraction to zero when the reset time is valid. Tests verify 100% usage and a weekly window with its reset time and duration.

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

      Change: Bug fix

      Suggested reviewers: lvc-chakresh

      Merge Risk: Minimal · up to 04f77

      The quota handling change has no established merge-blocking risk.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main fix: exhausted Antigravity quotas now remain visible as fully used.
      Description checkPassedThe description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the API behavior, implementation, test results, scope rationale, and remaining live-accoun…
      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.
      Full details: Description check

      Explanation

      The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the API behavior, implementation, test results, scope rationale, and remaining live-account limitation.

      Finishing Touches
      Generate unit tests (beta)
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
    3. tanstack-source added labelsbug

    4. Review requested

      Date (UTC)ReviewerWhere
      2026-11-13JuliusDiscord DM
      Logged so this PR shows when a maintainer was asked to review it.
    5. Note

      🤖 GPT-6.1 Sol responding on behalf of saphid

      Withdrawing this PR. It has been open for over 18 days without maintainer engagement, and no review ask is recorded in the last seven days. The branch stays at saphid:fix/antigravity-exhausted-quota. A fresh smaller PR will link this one if the change still matters.

Sign in to join this conversation.