Skip to content

[Bug]: Antigravity adapter and health check do not discover ACP sessions (~/.gemini/antigravity-acp/acp_token.json) #132

Closed

Description

@SlobCoder

Plugin version

2.5.0 (15b29f6)

Area

Provider usage helper

Environment

  • Dux Shell: dms v2.1.0-268-g6a6c5f745
  • Quickshell: 0.3.2
  • Compositor: Hyprland (Wayland)
  • Distro: CachyOS
  • bash/jq/curl: bash 5.3.20 / jq 1.8.2 / curl 8.23.0

Steps to reproduce

  1. Sign in with Antigravity ACP (e.g., via Zed's antigravity-acp external agent), without installing the standalone Antigravity IDE or agy CLI. This writes the OAuth credentials to ~/.gemini/antigravity-acp/acp_token.json.
  2. Enable antigravity in providerSelection.
  3. Run ./providers/get-antigravity-usage and ./providers/get-provider-health antigravity.

Expected behavior

  • providers/native/antigravity.bash discovers ~/.gemini/antigravity-acp/acp_token.json, refreshes the access token, and returns the account's quota windows.
  • providers/get-provider-health antigravity detects ~/.gemini/antigravity-acp/acp_token.json as login evidence (even when refresh_token is a top-level field rather than nested under .token.refresh_token).

Actual behavior

./providers/get-antigravity-usage returns:

[{"provider":"antigravity","source":"antigravity-local","error":{"code":2,"kind":"provider","message":"No usable Antigravity session was found. Open Antigravity and sign in, or install the agy CLI."}}]

The Antigravity widget/dashboard card shows an error with no quota data.

Local checks

# Schema of ~/.gemini/antigravity-acp/acp_token.json (types only, no values):
$ jq 'with_entries(.value = (.value | type))' ~/.gemini/antigravity-acp/acp_token.json
{
  "client_id": "string",
  "client_secret": "string",
  "refresh_token": "string",
  "token_uri": "string",
  "scopes": "array",
  "project_id": "string"
}

# Before fix:
$ ./providers/get-antigravity-usage
[{"provider":"antigravity","source":"antigravity-local","error":{"code":2,"kind":"provider","message":"No usable Antigravity session was found. Open Antigravity and sign in, or install the agy CLI."}}]

Root cause & suggested fix

  1. providers/native/antigravity.bash only searches IDE state.vscdb databases, desktop keyring entries, and agy CLI token files (~/.gemini/antigravity-cli/antigravity-oauth-token and ${XDG_CONFIG_HOME:-$HOME/.config}/antigravity-cli/antigravity-oauth-token). Adding ${HOME}/.gemini/antigravity-acp/acp_token.json to that fallback list works directly because acp_token.json uses the same Google OAuth client (token_uri: https://oauth2.googleapis.com/token) and extract_antigravity_keyring_refresh already supports top-level .refresh_token.
  2. has_antigravity_file_credentials in providers/get-provider-health only checks the two antigravity-cli paths and only accepts .token.refresh_token. Extending it to check ~/.gemini/antigravity-acp/acp_token.json and accept .refresh_token // .refreshToken // .token.refresh_token // .token.refreshToken brings health detection in line with extract_antigravity_keyring_refresh.

Tested locally with acp_token.json added to both files: ./providers/get-provider-health antigravity reports ready with login evidence ~/.gemini/antigravity-acp/acp_token.json, and ./providers/get-antigravity-usage successfully refreshes and returns the quota windows (Claude & OpenAI Models (5h) and Weekly).

Activity

  1. bernardopg commented on Nov 22, 2026

    @bernardopg
    Owner

    Thanks for the report, @SlobCoder. The diagnosis was spot on: you identified both exact points (adapter discovery and health readiness) and also confirmed that extract_antigravity_keyring_refresh already accepted top-level refresh_token.

    What was happening

    The Antigravity native adapter only looked for file credentials in the antigravity-cli token paths, and the health check only accepted token.refresh_token in those same files. ACP sessions stored at ~/.gemini/antigravity-acp/acp_token.json with a top-level refresh_token were not discovered, so the provider appeared as having no usable session.

    Fix

    I opened PR #138 with the fix:

    • The native adapter now includes ~/.gemini/antigravity-acp/acp_token.json in the token-file fallback.
    • The health check now recognizes that ACP token file and accepts the same refresh-token shapes already supported by the extractor (refresh_token, refreshToken, token.refresh_token, token.refreshToken).
    • I added regression coverage in tests/test-antigravity-live.sh for adapter discovery and health readiness with a top-level ACP token.

    Validation

    I ran locally:

    • bash tests/test-antigravity-live.sh
    • bash -n providers/native/antigravity.bash providers/get-provider-health
    • shellcheck -S warning providers/native/antigravity.bash providers/get-provider-health

    When PR #138 is merged and you update, could you confirm whether get-provider-health antigravity reports ready and get-antigravity-usage reads the ACP session normally in your environment? If any case is still missing, please share the anonymized file shape and I’ll adjust it. Thanks again!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions