Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Antigravity 1.5.16 breaks isolated file token storage & usage limits (expects AGY_CLI_FORCE_FILE_TOKEN_STORAGE instead of AGY_ACP_FORCE_FILE_STORAGE / SSH_CONNECTION) #41973

Openfanbuz(GitHub profile, opens in a new tab) opened this issue 37 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Run T3 Code (Nightly 0.1.12-nightly.20261124.5178) on macOS with the Antigravity provider configured for Google account sign-in (oauth-personal).
  2. Allow T3 Code to auto-install/upgrade the managed Antigravity ACP runtime to 1.5.16.
  3. Sign in with Google (or start an Antigravity session after upgrading from 1.5.15 to 1.5.16).
  4. Check ~/.t3/userdata/providers/antigravity/<profile-hash>/antigravity-acp/, the latest acp-server-*.log, and Antigravity usage limits in T3 Code.

Expected behavior

Antigravity 1.5.16 continues using T3 Code's isolated file-based token storage (~/.t3/userdata/providers/antigravity/<profile-hash>/antigravity-acp/antigravity-oauth-token), staying isolated from the macOS system Keychain (and any external agy CLI / Antigravity IDE login), and makeAntigravityUsageProbe reads the token to populate usageLimits.

Actual behavior

  1. Token isolation breaks on Antigravity 1.5.16 (silently falls back to macOS system Keychain):
    • In src/provider/antigravityAuthSupport.ts, antigravityEnvironment injects SSH_CONNECTION="127.0.0.1 0 127.0.0.1 0" and AGY_ACP_FORCE_FILE_STORAGE="1" (and lists AGY_ACP_FORCE_FILE_STORAGE in removedEnvironmentKeys).
    • In Antigravity 1.5.15, composite_token_storage.go fell back to file-based token storage when SSH_CONNECTION was set (Using file-based token storage because SSH session detected).
    • In Antigravity 1.5.16, the SSH session detected fallback was removed, and the binary checks AGY_CLI_FORCE_FILE_TOKEN_STORAGE (not AGY_ACP_FORCE_FILE_STORAGE).
    • As a result, 1.5.16 ignores both env vars, skips file storage, and reads/writes the shared macOS system Keychain (gemini / antigravity). Signing out or switching accounts in external agy CLI / Antigravity IDE (or clicking Sign out in T3 Code) interferes across environments, and immediately after upgrading from 1.5.15 to 1.5.16, ACP loaded a stale token from the macOS Keychain instead of the newly authenticated session.
  2. Antigravity Usage Limits break and falsely prompt to sign in:
    • Because antigravity-acp/antigravity-oauth-token is never written under 1.5.16, makeAntigravityUsageProbe (which only falls back to readKeyringSecret for oauth-business, not oauth-personal) reports:
      "usageLimits": {
        "unavailable": {
          "reason": "unsupported",
          "message": "Sign in with Google to see Antigravity limits."
        }
      }
    • Combined with makeAntigravityProvider initializing auth.status to "unknown" after nightly updates/restarts, this makes Antigravity appear signed out and triggers unnecessary sign-out / re-login loops.

Suggested fix: Set AGY_CLI_FORCE_FILE_TOKEN_STORAGE: "1" in antigravityEnvironment (and include it in removedEnvironmentKeys), keeping backward compatibility if needed for older runtimes.

Impact

Major degradation or frequent failure

Version or commit

0.1.12-nightly.20261124.5178

Environment

macOS 27.2.1 (arm64), T3 Code Desktop Nightly 0.1.12-nightly.20261124.5178, Antigravity ACP 1.5.16 (oauth-personal)

Logs or stack traces

# On 1.5.15 (file storage active via SSH_CONNECTION):
I1124 14:38:59.261102      25 server.go:2715] Language server version: 1.5.15
I1124 14:38:59.304952      68 composite_token_storage.go:176] Using file-based token storage because SSH session detected
I1124 14:38:59.305682     168 keyring.go:64] keyringAuth: loaded token, expiry=2026-11-24 15:38:58 +0800 CST expired=false

# Immediately after upgrading to 1.5.16 (no file-storage log; silently falls back to macOS Keychain stale token):
I1124 14:39:32.941767      66 server.go:2782] Language server version: 1.5.16
I1124 14:39:32.989254      53 manager.go:819] ACP authenticate: methodId="oauth-personal" meta=map[]
I1124 14:39:33.034162     209 keyring.go:64] keyringAuth: loaded token, expiry=2026-11-23 22:26:57 +0800 CST expired=true
I1124 14:39:33.684842     209 browser.go:265] token refreshed, new expiry=2026-11-24 15:39:32 +0800 CST

# Meanwhile ~/.t3/userdata/providers/antigravity/<profile-hash>/antigravity-acp/antigravity-oauth-token does not exist,
# and ~/.t3/caches/antigravity.json records:
# "usageLimits": { "windows": [], "unavailable": { "reason": "unsupported", "message": "Sign in with Google to see Antigravity limits." } }

# After adding AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 to providerInstances.antigravity.environment and signing in again:
I1124 15:02:36.371128      25 server.go:2782] Language server version: 1.5.16
I1124 15:02:36.411380      84 composite_token_storage.go:207] Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set
I1124 15:02:36.412188     222 keyring.go:64] keyringAuth: loaded token, expiry=2026-11-24 16:02:20 +0800 CST expired=false
# antigravity-oauth-token is created (0600) and usageLimits immediately recovers.

Workaround

In T3 Code Settings → Providers → Antigravity → Environment variables, add:

  • Name: AGY_CLI_FORCE_FILE_TOKEN_STORAGE
  • Value: 1

Then sign in with Google once (without clicking Sign out beforehand, so the system Keychain entry isn't cleared). This restores isolated file token storage and usageLimits immediately on Antigravity 1.5.16.

  1. tanstack-source added labelsbug

  2. +1, hitting the exact same issue on macOS (arm64), T3 Code Nightly 0.1.12-nightly.20261124.5178, Antigravity 1.5.16 (oauth-personal).

    auth.status is authenticated, while usageLimits shows Sign in with Google to see Antigravity limits. because antigravity-oauth-token is never written and oauth-personal skips the keyring fallback. Looking forward to a fix!

  3. Same root cause, additional (more severe) symptom: multiple T3 Antigravity profiles cross-authenticate as the same Google account.

    Setup: macOS (arm64), T3 Code Nightly 0.1.12-nightly.20261124.5178, two Antigravity provider instances (oauth-personal), each with its own profile/GEMINI_HOME under ~/.t3/userdata/providers/antigravity/<profile-hash>/antigravity-acp, intended for two different Google accounts ("account A" and "account B"). Managed runtime was on 1.5.16.

    Observed on 1.5.16 (22 acp-server-*.log launches for profile A between 16:48 and 17:53 local time):

    • Profile A (should be account A) authenticated as <account-B> on every launch — applyAuthResult: email=<account-B> + OAuth: authenticated successfully as <account-B>.
    • Profile B also authenticated as <account-B>.
    • No Using file-based token storage … line in any 1.5.16 log; only keyringAuth: loaded token / ChainedAuth: authenticated via keyring (effective: keyring).
    • T3 listed both instances as authenticated, so the mix-up was silent: profile A's turns, quota and conversation history ran under account B.

    After pinning providerInstances.<id>.config.binaryPath to 1.5.15 and signing each profile in once:

    • Profile A → <account-A>, profile B → <account-B>.
    • Each profile has its own antigravity-oauth-token (0600) again and logs Using file-based token storage because SSH session detected.

    This is more than a usage-limits breakage: with two or more T3-managed profiles, 1.5.16 collapses identity into the single shared OS keyring entry (gemini / antigravity), and whichever profile signed in last wins. That is a silent cross-account leak (requests and conversation context for one profile executing under another Google account), not just a wrong banner.

    Redacted excerpts:

    # Antigravity 1.5.16 — profile A (expected account A), every launch
    I1124 17:07:40.908894  24 server.go:2782] Language server version: 1.5.16
    I1124 17:07:41.008418  72 keyring.go:64] keyringAuth: loaded token, expiry=... expired=false
    I1124 17:07:41.008496  56 auth.go:157] ChainedAuth: authenticated via keyring (effective: keyring)
    I1124 17:07:41.008512  56 server_oauth.go:221] applyAuthResult: email=<account-B>, authMethod=consumer, quotaProject=
    I1124 17:07:41.008529  56 server_oauth.go:226] OAuth: authenticated successfully as <account-B>
    
    # Antigravity 1.5.15 (pinned) — same profile, after one sign-in
    I1124 18:32:22.350579  67 server.go:2715] Language server version: 1.5.15
    I1124 18:32:22.440015  31 composite_token_storage.go:176] Using file-based token storage because SSH session detected
    I1124 18:32:22.443221  31 auth.go:157] ChainedAuth: authenticated via keyring (effective: keyring)
    I1124 18:32:22.443269  31 server_oauth.go:221] applyAuthResult: email=<account-A>, authMethod=consumer, quotaProject=
    I1124 18:32:22.443309  31 server_oauth.go:226] OAuth: authenticated successfully as <account-A>

    Related: #41982 (adds AGY_CLI_FORCE_FILE_TOKEN_STORAGE for oauth-personal) should fix this and restore per-profile isolation. Multi-profile setups are the loudest reproducer, and anyone who already signed in on 1.5.16 must sign in again per profile after the fix.

  4. +1, same root cause on macOS 15.5 (Darwin 24.5.0, arm64), T3 Code Desktop Nightly 0.1.12-nightly.20261124.5178, and can confirm the fix in #41982 works. Before switching to nightly, the stable build showed no Antigravity limits at all, not even an error.

  5. +1, same issue on stable T3 Code Desktop 0.1.11 (not only nightly), macOS arm64, managed Antigravity ACP 1.5.16 (version hash 33f5617d…), oauth-personal, no custom binary path.

    Symptom: Gemini turns work, but Antigravity quotas never show up. The usage probe returns "Sign in with Google to see Antigravity limits."

    What we tried:

    1. Checked the T3 profile: ~/.t3/userdata/providers/antigravity/<profile-hash>/antigravity-acp/ contains only settings.json ({"auth":{"type":"oauth-personal"}}). Neither acp_token.json nor antigravity-oauth-token exists.
    2. The sign-in is in the macOS Keychain (service gemini, account antigravity). acp-server-*.log shows authenticated via keyring and no file-based token storage.
    3. Signed out and back in through T3's Antigravity settings. The Keychain entry was rewritten and still no token file appeared.
    4. Deleted the Keychain entry (security delete-generic-password -s gemini -a antigravity), then signed out and back in through T3 again. The Keychain entry was created fresh and there was still no token file in the profile.

    So even with no prior Keychain credential, 1.5.16 launched by T3 (with AGY_ACP_FORCE_FILE_STORAGE=1) still stores the sign-in in the Keychain. Because the oauth-personal usage probe only reads the two profile token files (the Keychain fallback is only used for oauth-business), limits can't be shown at all. Waiting on #41982 to reach stable.

  6. Still reproduced on T3 Code Nightly 0.1.12-nightly.20261125.5222 (macOS arm64) with the managed Antigravity ACP 1.5.16 and oauth-personal.

    The bundled server still exports only AGY_ACP_FORCE_FILE_STORAGE=1 and a loopback SSH_CONNECTION. It does not set AGY_CLI_FORCE_FILE_TOKEN_STORAGE. Chat works because ACP 1.5.16 loads the macOS keychain entry (gemini / antigravity), but the profile has neither acp_token.json nor antigravity-oauth-token. makeAntigravityUsageProbe then returns unsupported / "Sign in with Google to see Antigravity limits." The keychain fallback in that probe is still limited to oauth-business.

    Local check against ACP 1.5.16: with AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1, authenticate succeeds once antigravity-acp/antigravity-oauth-token (mode 0600) contains the same JSON the keychain stores, including auth_method. A file with only token.access_token fails (unknown auth method). That file is also what the usage probe already knows how to read for oauth-personal.

    This nightly does not include #41982 yet.

  7. +1 — also reproducing on macOS with T3 Code 0.1.11 and Antigravity 1.5.17 (oauth-personal). Antigravity authenticates via macOS Keychain (gemini / antigravity), neither acp_token.json nor antigravity-oauth-token is written in the profile dir, and Usage → Limits hides Antigravity completely.

  8. +1, still reproducing on T3 Code (Nightly) 0.1.12-nightly.20261125.5230 (macOS 26.6 arm64) with managed Antigravity ACP 1.5.16 (oauth-personal).

    • antigravity acp is still launched with AGY_ACP_FORCE_FILE_STORAGE=1 (not AGY_CLI_FORCE_FILE_TOKEN_STORAGE).
    • 1.5.16 authenticates via macOS Keychain (gemini / antigravity), so neither acp_token.json nor antigravity-oauth-token is written in the profile directory.
    • makeAntigravityUsageProbe returns Sign in with Google to see Antigravity limits. in Usage → Limits.

    Looking forward to #41982 landing in nightly.

  9. +1 — reproducing on T3 Code 0.1.12 (ca81b7b97a1c, macOS arm64) with Antigravity CLI 1.5.16 (oauth-personal).

    • Keychain entry (gemini / antigravity) exists and chat works.
    • Neither acp_token.json nor antigravity-oauth-token is written under antigravity-acp/.
    • makeAntigravityUsageProbe skips readCliKeyringSecret for oauth-personal and shows Sign in with Google to see Antigravity limits.
  10. +1 — reproducing on T3 Code 0.1.12 (macOS arm64) with managed Antigravity ACP 1.5.17 (oauth-personal).

    • Worked yesterday on 1.5.14 (Using file-based token storage because SSH session detected).
    • After auto-updating to 1.5.17 and re-logging in, Antigravity authenticates via macOS Keychain (ChainedAuth: authenticated via keyring), neither acp_token.json nor antigravity-oauth-token is written under antigravity-acp/, and Usage → Limits shows Antigravity: Sign in with Google to see Antigravity limits..
  11. +1 repro on my end

    Hitting this across three Macs on a fresh setup with T3 Code Nightly 0.1.12-nightly.20261125.5230, managed Antigravity ACP 1.5.17, oauth-personal.

    Sessions work fine and the acp-server log shows keyringAuth loading the token from macOS Keychain, but neither acp_token.json nor antigravity-oauth-token ever gets written under antigravity-acp/, so Usage Limits just says Sign in with Google to see Antigravity limits.

  12. +1 — still reproducing on T3 Code Nightly 0.1.13-nightly.20261125.5245 (macOS 27.2.1 arm64) with managed Antigravity ACP 1.5.17 (oauth-personal).

    • Sessions work normally and acp-server-*.log confirms ChainedAuth: authenticated via keyring (effective: keyring).
    • The macOS login Keychain entry (gemini / antigravity) has a valid, unexpired go-keyring-base64: token payload, while neither acp_token.json nor antigravity-oauth-token is written under ~/.t3/userdata/providers/antigravity/<hash>/antigravity-acp/.
    • Because makeAntigravityUsageProbe only falls back to readKeyringSecret for oauth-business, Usage → Limits shows Antigravity: Sign in with Google to see Antigravity limits..
  13. For context: since #43026, T3 Code no longer reads Antigravity usage limits at all, so the usage-limits half of this no longer applies. Leaving this open for the token-storage isolation problem on 1.5.16.

  14. Local migration repro on Beta 0.1.12 (ca81b7b97a1c), macOS arm64, managed ACP 1.5.17: two personal provider instances with neither profile token file failed to open a session after enabling AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1. The desktop showed only “Failed to open antigravity provider session”. The server trace contained the CLI's “No browser is available here” sign-in error.

    I reproduced the underlying failure in a temporary empty profile with the same binary and T3's SSH hint: initialize succeeded, then authenticate(oauth-personal) returned -32603. With an expired profile credential present, a separate local test confirmed that session/new succeeded and renewed it. A test with an existing credential therefore misses the migration case. A new browser sign-in for each intended account is needed when switching a Keychain-only profile to file storage. Please cover that transition and surface the sign-in action on session-open failure. The removal of the private quota probe in #43026 is a separate change.

  15. Confirmed still reproducing on 0.1.13-nightly.20261125.5245 with Antigravity 1.5.17 on macOS (3 isolated instances). Setting AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 per instance under Settings -> Agents -> Providers -> Environment -> Variables works around it.

  16. Confirmed the account-switch impact on macOS arm64 with T3 Code Nightly 0.1.13-nightly.20261125.5258 and managed Antigravity 1.5.17. The provider profile already had an antigravity-oauth-token file for account B. Fresh T3 processes authenticated as account A from the OS keyring and received HTTP 429 for A's individual quota.

    I ran the same managed binary against the same profile and sent ACP initialize and authenticate with oauth-personal. With AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 in addition to T3's existing environment, the CLI logged “Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set” and authenticated as B without another Google login. This checks the existing-profile case for #41982. I did not run a model turn in this probe.

  17. Still reproducing on stable T3 Code 0.1.12 (macOS arm64) with Antigravity 1.5.18 (oauth-personal, 3 provider instances):

    • T3 Code 0.1.12 still only exports AGY_ACP_FORCE_FILE_STORAGE=1 (not AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1).
    • Even after signing out and re-signing in all 3 profiles, agy 1.5.18 still authenticates via macOS Keychain (keyringAuth: loaded token / ChainedAuth: authenticated via keyring), no acp_token.json or antigravity-oauth-token is written in any profile directory, and all 3 instances show Sign in with Google to see Antigravity limits. in usageLimits while silently overwriting each other's Keychain session.

    Looking forward to #41982 landing in stable!

  18. Still reproduces on the Beta channel with Antigravity ACP 1.5.18, so this isn't just nightly or 1.5.16.

    Environment

    • T3 Code (Beta) desktop 0.1.12, macOS 27.2.1 (arm64)
    • Managed Antigravity ACP runtime 1.5.18 (release d10e124f5eb4…, auto-installed 2026-11-26 13:30)
    • Auth method oauth-personal; antigravity-acp/settings.json = {"auth":{"type":"oauth-personal"}}

    What happens

    Usage → Limits shows Antigravity: Sign in with Google to see Antigravity limits. while Antigravity is signed in and working in T3. Signing out and back in, and disabling and re-enabling the provider, don't help: each new sign-in goes to the Keychain again.

    Evidence

    1. The bundled server still sets the old name only (apps/server/dist/server-*.mjs in the 0.1.12 Beta app.asar):
      AGY_ACP_FORCE_FILE_STORAGE: "1",          // antigravityEnvironment
      "AGY_ACP_FORCE_FILE_STORAGE",             // removedEnvironmentKeys
    2. The 1.5.18 binary only knows the new name. strings antigravity | grep -E 'AGY_ACP_FORCE_FILE_STORAGE|AGY_CLI_FORCE_FILE_TOKEN_STORAGE|SSH session detected':
      1 AGY_CLI_FORCE_FILE_TOKEN_STORAGE
      (AGY_ACP_FORCE_FILE_STORAGE and the SSH session detected fallback are both gone.)
    3. The T3-driven sign-in and the next ACP start both use the Keychain. No composite_token_storage line appears:
      # acp-login-20261126_133000.log
      I1126 13:30:30.529956 browser.go:145] consumerOAuth: token acquired, expiry=2026-11-26 14:30:29 +0200 CAT
      I1126 13:30:30.531858 auth.go:174] ChainedAuth: interactive auth completed via consumer
      
      # acp-server-20261126_133146.log
      I1126 13:31:46.078354 server.go:2846] Language server version: 1.5.18
      I1126 13:31:48.127666 keyring.go:64] keyringAuth: loaded token, expiry=2026-11-26 14:30:29 +0200 CAT expired=false
      I1126 13:31:48.128156 auth.go:157] ChainedAuth: authenticated via keyring (effective: keyring)
      The Keychain item gemini / antigravity was created at 13:30:30, which matches the sign-in.
    4. <profile>/antigravity-acp/ contains neither acp_token.json nor antigravity-oauth-token, so makeAntigravityUsageProbe (which reads the keyring only for oauth-business) returns:
      "usageLimits": { "windows": [], "unavailable": { "reason": "unsupported", "message": "Sign in with Google to see Antigravity limits." } }

    Workaround (confirmed)

    Add the new name through the instance environment in settings.json, then put the token file in place (I copied the existing Keychain secret into antigravity-acp/antigravity-oauth-token, mode 0600):

    "providerInstances": {
      "antigravity": {
        "driver": "antigravity",
        "enabled": true,
        "environment": [{ "name": "AGY_CLI_FORCE_FILE_TOKEN_STORAGE", "value": "1" }]
      }
    }

    After Refresh limits, the cache filled immediately with 4 windows: Gemini 5-hour/Weekly and Claude & GPT (shared) 5-hour/Weekly. The next ACP start picked up the variable, and the runtime refreshed the file itself before the 14:30 expiry, so the fix holds without re-syncing from the Keychain:

    # acp-server-20261126_135459.log
    I1126 13:54:59.747064 server.go:2846] Language server version: 1.5.18
    I1126 13:54:59.876522 composite_token_storage.go:207] Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set
    I1126 14:26:00.590032 browser.go:268] token refreshed, new expiry=2026-11-26 15:25:59 +0200 CAT

    antigravity-oauth-token was rewritten at 14:26:00 (new expiry 15:25:59), and Limits kept updating after the original token's 14:30 expiry.

    Suggested fix

    Same as the original report:

    • Set AGY_CLI_FORCE_FILE_TOKEN_STORAGE: "1" in antigravityEnvironment and add it to removedEnvironmentKeys. Keep the old name too, for runtimes before 1.5.16.
    • Belt and braces: let makeAntigravityUsageProbe fall back to readKeyringSecret for oauth-personal as well. Then a future rename can't silently blank the Limits view again.
    • Optional: a one-time migration that moves an existing gemini/antigravity Keychain token into the profile's file, so people who already signed in under 1.5.16+ don't have to sign in again.
  19. I tested this behavior on Windows 10 x64 with T3 Code Nightly 0.1.13-nightly.20261125.5258 and Antigravity 1.5.18.

    The T3 Code server still sets AGY_ACP_FORCE_FILE_STORAGE="1" and does not set AGY_CLI_FORCE_FILE_TOKEN_STORAGE. agy.EXE 1.5.18 contains AGY_CLI_FORCE_FILE_TOKEN_STORAGE and does not contain AGY_ACP_FORCE_FILE_STORAGE.

    Unlike macOS, the 1.5.18 language server on Windows still uses the SSH_CONNECTION check to select file storage. Every profile wrote its own antigravity-oauth-token file and authenticated as a separate Google account.

    I1126 20:01:39.357711     117 server.go:2846] Language server version: 1.5.18
    I1126 20:01:39.514144      63 composite_token_storage.go:135] Using file-based token storage because SSH session detected
    I1126 20:01:39.515326     255 keyring.go:64] keyringAuth: loaded token, expiry=2026-11-26 21:00:54.9246695 +0700 +07 expired=false
    I1126 20:01:39.515326      63 auth.go:157] ChainedAuth: authenticated via keyring (effective: keyring)
    I1126 20:01:39.515326      63 server_oauth.go:221] applyAuthResult: email=<redacted>, authMethod=consumer, quotaProject=

    On this nightly build, usageLimits is null in every profile cache because PR #43026 removed Antigravity usage limits. Windows profile isolation works only through SSH_CONNECTION. PR #41982 will move Windows to AGY_CLI_FORCE_FILE_TOKEN_STORAGE before Google removes the SSH_CONNECTION check on Windows.

  20. +1 on T3 Code Nightly 0.1.12-nightly.20261125.5222, macOS arm64, oauth-personal, Antigravity CLI 1.5.17 (Homebrew antigravity-cli cask). Same symptoms: chat works, the token is only in the Keychain (gemini / antigravity), and there is no acp_token.json or antigravity-oauth-token.

    A stopgap for limits until #41982 lands: copy the Keychain token into the file the probe reads. The go-keyring-base64: payload decodes to the {"token":{access_token,refresh_token,expiry}} shape that CliToken expects. Re-run it on a timer (I use a 5-minute LaunchAgent), because the CLI refreshes the token in the Keychain about every hour and never updates the file.

    secret=$(security find-generic-password -s gemini -a antigravity -w)
    print -rn -- "${secret#go-keyring-base64:}" | base64 -D \
      > ~/.t3/userdata/providers/antigravity/<profile-hash>/antigravity-acp/antigravity-oauth-token
    chmod 600 ~/.t3/userdata/providers/antigravity/<profile-hash>/antigravity-acp/antigravity-oauth-token

    It only fixes the limits display. It doesn't give each profile its own token: with several provider instances, they all share the one Keychain account. For that, use the AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 env-var workaround mentioned above, plus a new browser sign-in for each profile.

  21. 🤖 Opus 5.5 via Claude Code on behalf of @cardoso-neto

    Still happens on stable T3 Code 0.1.13 (macOS arm64) with the managed Antigravity runtime 1.5.18 (~/.t3/tools/antigravity-acp/darwin-arm64/…), oauth-personal, two instances for two Google accounts. Both instances signed in as whichever account signed in last.

    agy changelog gives the cause. A 1.5.16 entry says that over SSH on macOS, agy now uses the login Keychain when it is unlocked and uses file storage only when it is locked. T3's loopback SSH_CONNECTION no longer forces file storage.

    Workaround until #41982 ships (no T3 build change): add AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 as an environment variable on each Antigravity instance (Settings → Providers → instance → Environment, or providerInstances.<id>.environment in settings.json). Then sign in to each instance again. T3 passes this variable through to agy acp and to the --login sign-in.

    Verified on 0.1.13:

    • Sign-in log: Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set, then authenticated successfully as <account-A>.
    • The profile now has its own antigravity-acp/antigravity-oauth-token (0600).
    • The shared Keychain item (gemini / antigravity) kept its earlier modification time and still holds <account-B>, so the sign-in did not overwrite it.
    • Same A/B check as above against an empty --gemini-dir: without the variable, authenticate succeeded through the Keychain as the other account. With it, authenticate returned -32603 No browser is available here …, which T3's --login flow handles.

    When #41982 lands, the per-instance variable is redundant and can be removed.

  22. Confirming this still reproduces on T3 Code Desktop 0.1.14-nightly.20261130.5465 with the T3-managed Antigravity runtime 1.5.20 on macOS.

    Environment

    • T3 Code: Desktop 0.1.14-nightly.20261130.5465 (local server, commit 4d01919)
    • OS: macOS arm64 (darwin 27.0.0)
    • Antigravity runtime: T3-managed ~/.t3/tools/antigravity-acp/darwin-arm64 — auto-upgraded from 1.5.14 to 1.5.20 on 2026-11-30
    • Setup: Two oauth-personal instances (antigravity for account A, antigravity_5x for account B) plus another local tool using agy (1.5.18) on the same Mac

    Evidence (1.5.14 → 1.5.20 transition on the same profile)

    1. Before upgrade (1.5.14) — antigravity_5x profile (acp-server-*.log):

      agentInfo: "Antigravity ACP Server" version "1.5.14"
      composite_token_storage.go:176] Using file-based token storage because SSH session detected
      keyring.go:64] keyringAuth: loaded token, ...
      server_oauth.go:221] applyAuthResult: email=<account-B>, authMethod=consumer, quotaProject=

      Its profile directory had its own antigravity-acp/antigravity-oauth-token file.

    2. Immediately after upgrade to 1.5.20 — same antigravity_5x profile, no config changes:

      agentInfo: "Antigravity ACP Server" version "1.5.20"
      manager.go:819] ACP authenticate: methodId="oauth-personal" meta=map[]
      keyring.go:64] keyringAuth: loaded token, ... expired=false
      auth.go:157] ChainedAuth: authenticated via keyring (effective: keyring)
      server_oauth.go:221] applyAuthResult: email=<account-A>, authMethod=consumer, quotaProject=

      Using file-based token storage because SSH session detected disappeared, and the antigravity_5x instance silently authenticated as <account-A> from the shared macOS Keychain (svce="gemini", acct="antigravity").

    3. Impact on delegated subagents & external agy tools:

      • Once the shared macOS Keychain entry was later updated to <account-B>, delegated subagents explicitly targeting provider_instance_id="antigravity" (account A) silently authenticated as <account-B> and consumed account B's quota.
      • Re-signing in on antigravity under 1.5.20 still wrote no antigravity-oauth-token file into ~/.t3/userdata/providers/antigravity/<hash>/antigravity-acp/ and instead recreated/updated the shared macOS Keychain entry (gemini / antigravity), overwriting credentials shared with other local agy sessions on the same Mac.
      • Verified in the managed 1.5.20 binary strings that it checks AGY_CLI_FORCE_FILE_TOKEN_STORAGE (not AGY_ACP_FORCE_FILE_STORAGE) and now reuses an unlocked macOS login Keychain even when SSH_CONNECTION is set.

    Prepared via a T3 Code triage session using Gemini 4 Neon (High) on the Antigravity harness.

  23. +1, same issue on T3 Code Nightly 0.1.14-nightly.20261129.5452, macOS 27.2 (arm64), managed Antigravity ACP 1.5.20, oauth-personal.

    I have two Antigravity instances for two Google accounts. Signing in on one instance signed the other out. Both profile logs then showed ChainedAuth: authenticated via keyring with the same account, and neither profile had an antigravity-oauth-token file. The modification time on the gemini Keychain item matched the second sign-in to the second. So when one account hit its individual quota (429), both instances were stuck, even though the other account had capacity.

    Applying the AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 per-instance workaround for now. It would be great to get #41982 merged.

  24. Also ran into this problem with stock 0.1.13 while having multiple agy sessions open (agy shell, webstorm plugin and T3). Claude also suggested me to write a wrapper startup script and setting the env var there but i will ride it out by not using webstorm or shell in parallel.

  25. Still reproduces on T3 Code Nightly 0.1.14-nightly.20261203.5637 (macOS arm64), the build that brings back Antigravity limits through agy usage --json. Managed Antigravity runtime 1.5.22, oauth-personal, one instance.

    • Usage → Limits shows Antigravity: Sign in with Google to see Antigravity limits., while chat works fine.
    • acp-server-*.log after a fresh sign-out and sign-in: Language server version: 1.5.22, then ChainedAuth: authenticated via keyring (effective: keyring).
    • The profile's antigravity-acp/ has only an old acp_token.json. No antigravity-oauth-token is written. The new probe returns SIGN_IN_MESSAGE as soon as that file is missing, so it never runs agy usage.
    • Copying acp_token.json into the probe's isolated home as .gemini/antigravity-cli/antigravity-oauth-token doesn't work either: agy usage --json answers Please sign in to view account usage. The two files use different formats.
    • The bundled server still sets only AGY_ACP_FORCE_FILE_STORAGE, not AGY_CLI_FORCE_FILE_TOKEN_STORAGE.
    • Running agy usage --json directly, with the normal Keychain login, returns all four buckets. So the account and the CLI are fine.

    The limits feature now ships, but it can't work for oauth-personal users on macOS until #41982 (or an equivalent fix) lands. Applying the per-instance AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 workaround for now.

  26. Still reproduces on T3 Code Desktop Nightly 0.1.14-nightly.20261203.5637 (macOS) with managed Antigravity 1.5.22, oauth-personal, after #47750 moved limits to agy usage.

    • acp-server log on 1.5.22: keyringAuth: loaded token → ChainedAuth: authenticated via keyring (effective: keyring). No file-based token storage line, despite the loopback SSH_CONNECTION.
    • The Keychain entry (gemini / antigravity) exists. The profile's antigravity-acp/ has no antigravity-oauth-token (or acp_token.json).
    • Provider status: auth.status: authenticated, usageLimits.unavailable: { reason: "unsupported", message: "Sign in with Google to see Antigravity limits." }. The probe returns early at the fs.exists(tokenPath) check in antigravityUsageLimits.ts, so agy usage never runs.
    • Pinning to 1.5.15 is no longer a workaround, since agy usage needs ≥ 1.5.22. #41982 is still unmerged.

    Found by Claude Opus 5.5 (Claude Code) via T3 triage.

  27. Also still reproduces with the newer Antigravity 1.5.23 on T3 Code Desktop Nightly 0.1.14-nightly.20261203.5637 (macOS, oauth-personal):

    • acp-server-*.log: ChainedAuth: authenticated via keyring, then OAuth: authenticated successfully. Chat works.
    • The profile's antigravity-acp/ has no antigravity-oauth-token, so Usage → Limits shows Sign in with Google to see Antigravity limits.
    • agy usage --json run directly as the same user, with the real HOME, returns SUCCESS with weekly usage. The keychain token is enough for agy usage; only the probe's early fs.exists(tokenPath) return blocks it.
    • agy 1.5.23 still recognises AGY_CLI_FORCE_FILE_TOKEN_STORAGE (found in the binary's strings).
    • Linux hosts with file token storage on the same versions show limits normally.
  28. Also reproducing on T3 Code Nightly 0.1.14-nightly.20261203.5637 across two macOS hosts + one linked Linux host, with managed Antigravity 1.5.23 and two oauth-personal instances (antigravity and antigravity_2):

    • Linux host: stores antigravity-oauth-token on disk and shows limits normally for both instances in Usage → Limits.
    • Both macOS hosts: show Sign in with Google to see Antigravity limits. in Usage → Limits, while chat works normally via Keychain (keyringAuth: loaded token).
    • Fresh sign-out & sign-in on macOS (1.5.23): completes acp-login and updates cache/acp-auth-state.json, but still creates no antigravity-oauth-token file in ~/.t3/userdata/providers/antigravity/<hash>/antigravity-acp/.
    • Running the managed antigravity usage --json directly with SSH_CONNECTION="127.0.0.1 0 127.0.0.1 0" and AGY_ACP_FORCE_FILE_STORAGE=1 (against real HOME) still succeeds via macOS Keychain even with no token file on disk, confirming AGY_ACP_FORCE_FILE_STORAGE is not sufficient on macOS 1.5.23 and the probe returns early on the missing antigravity-oauth-token file.
  29. same problem on macOS arm64, nightly 0.1.14-nightly.20261203.5651 + antigravity 1.5.23. chat with gemini working fine from keychain, no antigravity-oauth-token file in profile dir, so limits always say "Sign in with Google to see Antigravity limits.". also checked running antigravity usage --json directly with normal HOME, it works and show all limits ok, only fail when HOME is usage-home. waiting for #41982, thanks!

  30. Also reproduces on macOS arm64 with a build from main as of 2026-12-03 (includes #47750) and managed Antigravity 1.5.23, oauth-personal:

    • Upgraded the runtime 1.5.18 -> 1.5.23 from the provider settings, then signed in again with Change account. The acp-login-*.log shows the browser flow (consumerOAuth: starting OAuth flow -> ChainedAuth: interactive auth completed via consumer), and the next acp-server-*.log reports keyringAuth: loaded token -> ChainedAuth: authenticated via keyring (effective: keyring).
    • No antigravity-oauth-token was written to ~/.t3/userdata/providers/antigravity/<hash>/antigravity-acp/ after the fresh sign-in, and there is no usage-home/ in the profile, so agy usage was never spawned.
    • Provider settings show Authenticated · Google account and chat works, while Usage -> Limits shows Sign in with Google to see Antigravity limits. The probe returns at the fs.exists(tokenPath) check in antigravityUsageLimits.ts.
    • Re-signing in is not a workaround on macOS: the sign-in path itself lands in the Keychain, so the usage probe can never see it.

    +1 for #41982

  31. Confirmed on macOS arm64, T3 Nightly 0.1.14-nightly.20261203.5651, and Antigravity 1.5.23. Adding AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 to the provider, then choosing the same Google account via Change account, restored all four usage limits.

  32. Still reproducing on T3 Code Nightly 0.1.14-nightly.20261203.5651 with managed Antigravity 1.5.23 on macOS (arm64) using multiple Antigravity instances (oauth-personal).

    • An older instance originally authenticated on 1.5.4 still had antigravity-acp/antigravity-oauth-token on disk and immediately showed usage limits once moved to 1.5.23.
    • A second instance authenticated directly on 1.5.18 / 1.5.23 never writes antigravity-acp/antigravity-oauth-token (even after Sign out -> Sign in with Google), so makeAntigravityUsageProbe hits !fs.exists(tokenPath) and keeps showing Sign in with Google to see Antigravity limits.

    Adding AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 in antigravityEnvironment would fix this cleanly for all 1.5.16+ / 1.5.23 profiles.

  33. I have already commented on https://github.com/pingdotgg/t3code/pull/41982. I don't feel this is a appropriate fix. It degrades security for everybody at the benefits of few. This should probably be optional.

  34. Analyzed with Claude Opus 5.5 via Claude Code

    Confirmed on macOS arm64, T3 Code Nightly 0.1.14-nightly.20261203.5651, managed Antigravity 1.5.23, oauth-personal, one instance.

    Before the workaround • The profile's antigravity-acp/ had only a legacy acp_token.json from November, with no antigravity-oauth-token • Chat worked through the Keychain, and Usage showed "Sign in with Google to see Antigravity limits."

    After adding AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 to the provider and running Change account with the same Google account • The acp-server log shows "file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set" • antigravity-oauth-token was written to the profile • All four limits (Gemini and Claude/GPT, 5-hour and weekly) appeared right away

    The legacy acp_token.json alone is not enough for the new agy usage probe, so existing macOS profiles need a fresh sign-in even with the env var set.

Sign in to join this conversation.