fix(desktop): restore Gemini quota in Antigravity usage
YO
9h ago+157+157+012345678901234567890123456789-22-22-01234567890123456789
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 /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 typecheckpassed. - The full
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
- 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 jsonwhen 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.
mapAgyQuotaWindowsnow accepts both the native CLI field names (id,remaining_fraction,reset_time) and the existing keychain shape.
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.