fix(usage): show Antigravity Gemini limits when one quota endpoint omits them #20081
main fromrefs/pull/20081/head·merged by juliusmarminge View on GitHubProblem#
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.
| Host | POST /v1internal:retrieveUserQuotaSummary |
|---|---|
daily-cloudcode-pa.googleapis.com | HTTP 200. One group, "Claude and GPT models": 3p-weekly (weekly, ≈ 0.0001 remaining), 3p-5h (5h, 1). No Gemini group. |
cloudcode-pa.googleapis.com | HTTP 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 ], andexpected … to have a length of 4 but got 2). vp test run apps/server/src/provider/antigravityUsageLimits.test.ts: 10 passed.vp linton both files: no findings.vp fmt --checkon both files: clean.- Server typecheck (
tsc-rs --noEmitinapps/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 exposefetchAvailableModels. - 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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
1c7a857Macroscope'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).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.tsapps/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.tsfetchWindowsqueries both endpoints concurrently and merges parsed windows. For duplicate IDs, it keeps the reading with higherusedPercent. 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:
4-
Check name Status Explanation Title check The title clearly identifies the Antigravity usage-limit fix and the missing Gemini limits caused by an incomplete quota endpoint response. Description check The 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 check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check 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
-
juliusmarminge merged this340ee23
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes