Skip to content

fix(antigravity): show Gemini session and weekly limits - #12445

Closed
lukasbxy wants to merge 3 commits into
pingdotgg:mainfrom
lukasbxy:feat/antigravity-usage-limits
Closed

lukasbxy wants to merge 3 commits into
pingdotgg:mainfrom
lukasbxy:feat/antigravity-usage-limits

Conversation

@lukasbxy

@lukasbxy lukasbxy commented Sep 18, 2026 •

Copy link
Copy Markdown

What Changed

Usage → Limits now shows Antigravity Gemini session and weekly remaining quota from the Google login stored for that instance. Claude and GPT buckets from the same login are omitted. API-key and Vertex connections still report as unsupported.

Mobile /usage-limits and the pooled Limits screen get an Antigravity label so that snapshot is readable there too.

Why

Antigravity could already be signed in, but Limits never asked it for quota, so the provider never appeared. That is #10919.

The health check cannot spawn ACP just to read remaining quota. This reads acp_token.json, refreshes the Google token, and calls daily-cloudcode-pa.googleapis.com retrieveUserQuotaSummary. The cloudcode-pa host answers the same RPC with remainingFraction: 1 on every bucket, so remaining has to come from the daily host.

#10903 is a larger Antigravity quota probe with extra endpoints and UI sorting. This PR only fills the existing Limits cards.

Fixes #10919

UI Changes

Before, top of Limits. Codex, Claude, Cursor. No Antigravity.

Before: Limits tab, top of the list

Before, end of Limits. Cursor, then OpenCode.

Before: Limits tab, end of the list

After. OpenCode, then Antigravity with Gemini session and weekly remaining.

After: Limits tab with Antigravity Gemini limits

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Summary by CodeRabbit

  • New Features

    • Added Antigravity usage-limit reporting for Gemini session and weekly allowances.
    • Usage limits now refresh during sign-in and provider health checks, and clear after sign-out.
    • Added support for displaying “Antigravity” as the provider label.
  • Documentation

    • Documented supported Antigravity subscription-limit reporting and exclusions.

lukasbxy and others added 3 commits September 18, 2026 12:35
Limits skipped Antigravity even when a Google login was present. Probe
the daily Cloud Code quota summary and map Gemini windows onto the
existing Limits cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
Limits stayed on the pre-login unsupported snapshot until the next
health check, and an expired stored access token skipped refresh and
failed the quota read. Re-probe on session start, and retry Cloud Code
once after a 401.

Co-authored-by: Cursor <cursoragent@cursor.com>
onSessionStarted waited on quota before writing, then applied the result
whenever the current account was still signed in. Match the health-check
revision guard so an older callback cannot overwrite a newer session.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 18, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds an automatic Antigravity quota integration that reads and refreshes Google OAuth credentials, calls Cloud Code, and changes provider snapshot behavior. Its new production logic and authentication-sensitive data flow require human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5ea7ea44-a150-4cb3-9ddc-009047010191

📥 Commits

Reviewing files that changed from the base of the PR and between 9ea9c3d and 5fede3e.

📒 Files selected for processing (10)
  • apps/mobile/src/features/threads/ComposerUsageLimits.tsx
  • apps/mobile/src/features/usage/UsageLimitsPooled.tsx
  • apps/server/src/provider/Drivers/AntigravityDriver.test.ts
  • apps/server/src/provider/Drivers/AntigravityDriver.ts
  • apps/server/src/provider/Layers/AntigravityProvider.test.ts
  • apps/server/src/provider/Layers/AntigravityProvider.ts
  • apps/server/src/provider/Layers/antigravityUsageLimits.test.ts
  • apps/server/src/provider/Layers/antigravityUsageLimits.ts
  • apps/server/src/provider/antigravityAuthSupport.ts
  • docs/user/usage.md

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Antigravity now reads Google quota data without launching ACP, converts Gemini session and weekly quotas into usage limits, publishes them through provider lifecycle updates, labels them in mobile views, and documents supported and excluded connection types.

Changes

Antigravity usage limits

Layer / File(s) Summary
Quota retrieval and conversion
apps/server/src/provider/Layers/antigravityUsageLimits.ts, apps/server/src/provider/Layers/antigravityUsageLimits.test.ts
Reads stored Google tokens, refreshes eligible tokens, calls retrieveUserQuotaSummary, converts Gemini quota buckets, and handles unsupported or failed responses.
Provider lifecycle publication
apps/server/src/provider/Layers/AntigravityProvider.ts, apps/server/src/provider/Layers/AntigravityProvider.test.ts
Publishes limits during health checks and session starts, rejects stale updates, and clears limits on sign-out.
Driver and token-path wiring
apps/server/src/provider/Drivers/AntigravityDriver.ts, apps/server/src/provider/Drivers/AntigravityDriver.test.ts, apps/server/src/provider/antigravityAuthSupport.ts
Connects filesystem and HTTP services to quota retrieval and shares the resolved token path. Tests verify quota retrieval without launching a process.
Usage-limit presentation
apps/mobile/src/features/threads/ComposerUsageLimits.tsx, apps/mobile/src/features/usage/UsageLimitsPooled.tsx, docs/user/usage.md
Adds the Antigravity label and documents Gemini session and weekly allowances and excluded connection types.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge, t3dotgg

Merge Risk: ⚪ Minimal · up to 5fede

The change adds Antigravity quota reporting and labels with no supported actionable defect remaining.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 9 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: displaying Antigravity Gemini session and weekly limits.
Description check ✅ Passed The description explains what changed, why it changed, the implementation scope, UI impact, issue reference, screenshots, and checklist status. It matches the focused changeset. The video item is corr…
Linked Issues check ✅ Passed Issue #10919 requires Antigravity usage and limit consumption in the Usage dashboard. antigravityUsageLimits.ts reads the stored Google token, queries retrieveUserQuotaSummary, retries after token…
Out of Scope Changes check ✅ Passed The changed server code implements Antigravity quota retrieval and publication for issue #10919. The mobile label changes display the new provider limits. The authentication-path helper supports the t…
Full details: Docstring Coverage

Explanation

Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 9 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

@nozamdavid

Copy link
Copy Markdown

Could we get this merged into main as #10409 was merged too @juliusmarminge ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: Antigravity usage and limits not showing up in the Usage dashboard

3 participants