fix(server): each Antigravity Google sign-in stays in its own instance #39485
main fromrefs/pull/39485/head·merged by juliusmarminge View on GitHubOn the 1.5 Antigravity CLI, every Antigravity provider instance signed in as the same Google account: the last one signed in anywhere, including the Antigravity IDE. Signing out of one signed out all of them. The CLI keeps Google sign-ins in one shared OS keyring entry unless it thinks it runs over SSH, so T3 now launches Google-account instances in that mode and each instance keeps its own sign-in in its profile.
antigravityEnvironmentsetsSSH_CONNECTIONfor theoauth-personalmethod, which makes the CLI store the sign-in in the instance's profile. Sign-in already usesagy acp --login, which works in that mode.- The usage-limits probe reads the shared keyring entry only for Gemini Enterprise, so a Google-account instance never shows another account's limits.
- The internal provider doc now explains the 1.5 storage behaviour.
Fixes pingdotgg/t3code#37587
Reproduction on main#
Commit 09b79941a5 (origin/main), agy 1.5.12 on PATH, Linux. Under headless-desktop (Xvfb + D-Bus session + unlocked gnome-keyring) with a scratch XDG_DATA_HOME: (1) seeded the OS keyring entry agy 1.5.x uses, secret-tool store service gemini username antigravity with {"token":{"access_token":"ya29.SEEDED-BY-OTHER-APP",...,"expiry":<+1h>},"auth_method":"consumer"}, standing in for another app (Antigravity IDE / agy) being signed in; (2) started the real server T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --base-dir <scratch> with settings.json defining two instances antigravity and antigravity_2 (driver antigravity, authMethod oauth-personal, binaryPath agy), neither ever signed in; (3) t3 project add, then t3 thread start --provider antigravity and --provider antigravity_2. Result: each instance got its own profile <userdata>/providers/antigravity/<sha256>/antigravity-acp (T3's --gemini-dir/--app-data-dir/GEMINI_HOME isolation is in place) with no token file of its own, yet both instances' acp-server logs show ACP authenticate: methodId="oauth-personal" -> keyringAuth: loaded token, expiry=<same seeded expiry> -> OAuth: authenticated successfully on every authenticate. dbus-monitor showed the only Secret Service lookup is {service: gemini, username: antigravity}. Extra check at CLI level with T3's exact spawn args: setting SSH_CONNECTION makes agy log Using file-based token storage because SSH session detected and ignore the shared entry, but plain ACP authenticate then refuses with 'No browser is available here (this is a remote (SSH) session...)', so a T3 fix on that flag also needs the headless --login sign-in path.
Evidence#
Verified in the real app on macOS with a real Keychain (agy 1.5.12): two Google-account instances signed into two different Google accounts, on main and on this head. Full table and screenshots: https://github.com/pingdotgg/t3code/pull/39485#issuecomment-7031794220
| Before (main) | After (this PR) | |
|---|---|---|
| Both signed in | ![]() | ![]() |
| After signing out of B | ![]() | ![]() |
- Before: both instances end up as the last account signed in (one shared Keychain item), Limits merge into one account, and signing out of B deletes the shared item, so A loses its limits too.
- After: each instance keeps its own token file and its own limits, signing out of B leaves A signed in, and the Keychain is never touched. T3's Sign in → code-paste flow works in SSH mode.
Tests#
vp test run src/provider/antigravityAuthSupport.test.ts src/provider/antigravityUsageLimits.test.ts src/provider/Drivers/AntigravityDriver.test.ts src/provider/AntigravityAuth.test.ts(apps/server): 78 passed, 1 skipped (Windows-only)vp run check:changed: format, lint, knip, graphql, typecheck (3 packages) and tests all pass- Manual agy 1.5.12 check under
headless-desktopwith a fake token in the shared keyring entry: a fresh profile used the shared entry withoutSSH_CONNECTION, and with it used only its own token file
Not in this change#
- Gemini Enterprise (oauth-business) instances still share the keyring entry: agy's
--loginis Google-only, so isolating them would break their sign-in until upstream google-antigravity/antigravity-cli#1610 adds a storage flag. - Agent tool commands inherit the
SSH_CONNECTIONplaceholder from the agy process; agy offers no way to keep it out of child shells. AGY_ACP_FORCE_FILE_STORAGE=1is still set even though 1.5 ignores it; it may still matter for older runtimes.- Users signed in via the shared keyring entry today will be asked to sign in again per Google-account instance; no migration copies the shared token into a profile.
Who did the work#
- Written by Claude Opus 5.5, in Claude Code
- Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
- Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5; verified in the real app on macOS by Claude Opus 5.5, in Claude Code
Run by the t3code factory in T3 Code.



