You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(desktop): restore Gemini quota in Antigravity usage - #10199
The Antigravity card in Settings → Usage can show the Claude/GPT meters while omitting both Gemini meters. The Antigravity CLI can return all four windows through its read-only /usage command.
Use the CLI’s JSON output on versions that support read-only slash commands in print mode. Map the native buckets to the existing Usage rows and retain the existing fallback for older or unavailable CLIs. Google introduced non-interactive /usage in Antigravity CLI 1.1.11.
How I tested it
The focused Bun tests passed for both the native CLI response and the legacy response.
The patched quota reader returned the Gemini and Claude/GPT session and weekly meters against Antigravity CLI 1.5.16 on macOS.
Repository-wide Biome 2.4.2 and bun run typecheck passed.
The full bun run test run stopped on a shared recurrence assertion and local server and filesystem watcher errors. The live check exercised the patched reader directly.
Checklist
PR title follows conventional commits
Lint and typecheck pass
Allow edits from maintainers
CLA confirmed
Summary by cubic
Restores the Gemini quota meters that the Antigravity usage card was omitting by reading all four quota windows from the Antigravity CLI's read-only /usage command.
On macOS, runs agy --print /usage --output-format json when the CLI is at least 1.1.11 and maps the Gemini and Claude/GPT session and weekly buckets from its JSON output.
Falls back to the existing keychain-based quota fetch for older or unavailable CLIs.
mapAgyQuotaWindows now accepts both the native CLI field names (id, remaining_fraction, reset_time) and the existing keychain shape.
Written for commit 625d1c6. Summary will update on new commits.
Summary by CodeRabbit
New Features
On macOS, quota usage can now be retrieved from a supported Antigravity CLI, showing usage percentages, quota labels, and reset times. If the CLI is unavailable or cannot provide usable quota data, the app continues to use its existing quota retrieval method.
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.
I have read the CLA Document and I hereby sign the CLA
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.
No actionable comments were generated in the recent review.
Walkthrough
On macOS, Antigravity account fetching now tries supported agy CLI quota output first, maps accepted bucket formats into quota windows, and falls back to the existing Keychain and token API path when CLI windows are unavailable. Fetch and request timeouts use abort signals.
Quota mapping accepts camelCase and snake_case bucket fields, rejects unknown IDs and non-finite remaining values, and clamps the calculated used percentage. The CLI mapper accepts successful usage results. Tests cover recognized buckets, duplicates, string values, and unknown buckets.
CLI-first retrieval and fallback packages/host-service/src/trpc/router/usage/agy-quota.ts
On macOS, account fetching checks for CLI version 1.1.11 or later and requests headless usage output. When CLI quota windows are unavailable, fetching uses the Keychain and quota API path. Keychain and API calls receive abort signals.
sequenceDiagram
participant fetchAgyAccounts
participant agyCLI
participant quotaMapper
participant Keychain
participant quotaAPI
fetchAgyAccounts->>agyCLI: Check version and request usage
agyCLI-->>fetchAgyAccounts: Return usage result
fetchAgyAccounts->>quotaMapper: Map CLI result
alt CLI quota windows are available
quotaMapper-->>fetchAgyAccounts: Return quota windows
else CLI quota windows are unavailable
fetchAgyAccounts->>Keychain: Read credentials with shared abort signal
Keychain-->>fetchAgyAccounts: Return credentials
fetchAgyAccounts->>quotaAPI: Request quota with combined timeout signal
quotaAPI-->>fetchAgyAccounts: Return quota response
end
Loading
Suggested reviewers:kitenite
Merge Risk: Minimal · up to 625d1
This change restores Gemini usage meters in the Antigravity card by reading the Antigravity CLI's usage output. It keeps the existing fallback for older or unavailable CLIs. No actionable merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(desktop): restore Gemini quota in Antigravity usage" matches the main change. The raw summary and PR objectives show the change maps native Antigravity CLI usage buckets so the Gemini m…
Description check
The description fills the template's main sections. The 'What & why' section explains the missing Gemini meters, the CLI-based fix, the fallback, and links the CLI changelog for version 1.1.11. The 'H…
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.
Full details: Title check
Explanation
The title "fix(desktop): restore Gemini quota in Antigravity usage" matches the main change. The raw summary and PR objectives show the change maps native Antigravity CLI usage buckets so the Gemini meters return in the Antigravity usage card. It follows conventional commit format and is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description fills the template's main sections. The 'What & why' section explains the missing Gemini meters, the CLI-based fix, the fallback, and links the CLI changelog for version 1.1.11. The 'How I tested it' section lists the Bun tests, the live check against Antigravity CLI 1.5.16 on macOS, and the Biome and typecheck runs. The checklist is present, with the CLA item unchecked. No screenshots are attached, although the template strongly prefers before/after screenshots for user-visible bug fixes. The description does not link a related issue, and the template only asks for one when one exists.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The Antigravity card in Settings → Usage can show the Claude/GPT meters while omitting both Gemini meters. The Antigravity CLI can return all four windows through its read-only
/usagecommand.Use the CLI’s JSON output on versions that support read-only slash commands in print mode. Map the native buckets to the existing Usage rows and retain the existing fallback for older or unavailable CLIs. Google introduced non-interactive
/usagein Antigravity CLI 1.1.11.How I tested it
bun run typecheckpassed.bun run testrun stopped on a shared recurrence assertion and local server and filesystem watcher errors. The live check exercised the patched reader directly.Checklist
Summary by cubic
Restores the Gemini quota meters that the Antigravity usage card was omitting by reading all four quota windows from the Antigravity CLI's read-only
/usagecommand.agy --print /usage --output-format jsonwhen the CLI is at least 1.1.11 and maps the Gemini and Claude/GPT session and weekly buckets from its JSON output.mapAgyQuotaWindowsnow accepts both the native CLI field names (id,remaining_fraction,reset_time) and the existing keychain shape.Written for commit 625d1c6. Summary will update on new commits.
Summary by CodeRabbit