Skip to content

Add Antigravity CLI provider#477

Open
zabrodsk wants to merge 2 commits into
robinebers:mainfrom
zabrodsk:antigravity-cli-provider
Open

Add Antigravity CLI provider#477
zabrodsk wants to merge 2 commits into
robinebers:mainfrom
zabrodsk:antigravity-cli-provider

Conversation

@zabrodsk
Copy link
Copy Markdown

@zabrodsk zabrodsk commented May 20, 2026

Summary

  • Add a separate antigravity-cli bundled provider for Google Antigravity CLI (agy)
  • Read CLI auth from macOS keychain service gemini, account antigravity, with raw, JSON, and go-keyring-base64: token support
  • Query Cloud Code quota endpoints and map model pools to Gemini Pro, Gemini Flash, and Claude
  • Document setup/data sources and add README supported-provider entry
  • Extend readGenericPassword(service, account?) host API docs and implementation for explicit account lookup

Testing

  • bun run test plugins/antigravity-cli/plugin.test.js
  • bun run test plugins

Notes

  • cargo/rustc are not installed in this shell, so I could not run a local Rust compile/test for the host API change.
  • No screenshots: provider-only change, no rendered UI layout change.

Summary by cubic

Add the antigravity-cli provider to track Google Antigravity CLI (agy) Cloud Code quotas for Gemini Pro, Gemini Flash, and Claude. Extends the macOS keychain host API to support account-scoped reads for CLI auth and hardens request handling with timeouts, auth checks, and clear errors.

  • New Features

    • Added bundled antigravity-cli provider that calls loadCodeAssist, fetchAvailableModels, and retrieveUserQuota; maps model pools to Gemini Pro, Gemini Flash, and Claude (merges multiple buckets by the lowest remaining).
    • Reads auth from macOS keychain service gemini, account antigravity; supports raw tokens, JSON payloads, and go-keyring-base64: values; only reads non-secret CLI context ~/.gemini/antigravity-cli/ (does not touch legacy Gemini OAuth files).
    • Extended host API to host.keychain.readGenericPassword(service, account?) with account-level lookup and updated docs; added plugin docs, icon, and tests.
  • Bug Fixes

    • Hardened HTTP flow: 15s timeouts, auth status detection triggers the agy login message, and clearer network/HTTP error messages.
    • Fallback to retrieveUserQuota when fetchAvailableModels lacks quotas; shows a "No quota data" badge when none are available.

Written for commit 6a7b5b5. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings May 20, 2026 21:06
@zabrodsk zabrodsk requested a review from davidarny as a code owner May 20, 2026 21:06
@github-actions github-actions Bot added rust Pull requests that update rust code plugin docs labels May 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new bundled antigravity-cli provider plugin to track Google Antigravity CLI (agy) quota usage via Cloud Code quota endpoints, along with documentation updates and a small macOS keychain host API enhancement to support account-scoped lookups.

Changes:

  • Add plugins/antigravity-cli bundled plugin (manifest, implementation, icon) plus Vitest coverage.
  • Add user-facing documentation for setup/data sources and link it from the main README.
  • Extend host.keychain.readGenericPassword(service, account?) to support explicit account scoping, and document the new signature.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src-tauri/src/plugin_engine/host_api.rs Adds optional account parameter to readGenericPassword and scopes the security find-generic-password call accordingly.
README.md Adds Antigravity CLI to the supported providers list.
plugins/antigravity-cli/README.md Documents plugin-specific setup/auth expectations and data sources.
plugins/antigravity-cli/plugin.test.js Adds unit tests for keychain token parsing and quota parsing/fallback behaviors.
plugins/antigravity-cli/plugin.json Adds plugin manifest (id/name/icon/overview lines).
plugins/antigravity-cli/plugin.js Implements keychain token extraction + quota endpoint querying and mapping to overview lines.
plugins/antigravity-cli/icon.svg Adds provider icon asset.
docs/providers/antigravity-cli.md Adds provider documentation page.
docs/plugins/api.md Updates keychain API docs to include the optional account parameter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/antigravity-cli/plugin.js Outdated
Comment on lines +120 to +139
var resp = request({
method: "POST",
url: url,
headers: {
Authorization: "Bearer " + token,
Accept: "application/json",
"Content-Type": "application/json",
"User-Agent": "agy",
},
bodyText: JSON.stringify(body || {}),
timeoutMs: 15000,
})
if (ctx.util.isAuthStatus(resp.status)) {
throw LOGIN_MESSAGE
}
if (resp.status < 200 || resp.status >= 300) {
throw "Antigravity CLI quota request failed (HTTP " + String(resp.status) + "). Try again later."
}
var data = ctx.util.tryParseJson(resp.bodyText)
return data && typeof data === "object" ? data : null
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread plugins/antigravity-cli/plugin.js Outdated
@zabrodsk
Copy link
Copy Markdown
Author

@copilot check latest commit

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

Labels

docs plugin rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants