Antigravity: all provider instances share the same account (ACP spawned without --app-data-dir) #37587
Summary#
Multiple Antigravity provider instances all authenticate as the same Google account. Switching provider instance in the UI does not switch the account: every instance reports the same quota / same signed-in user.
Environment#
- T3 Code:
0.1.10-nightly.20261115.4749(also reproduced on4709and4736), Linux x64 (.deb) - Antigravity CLI bundled by T3:
1.5.9(~/.t3/tools/antigravity-acp/linux-x64/versions/<sha>/antigravity) - OS: Ubuntu 24.04, KDE Plasma (X11)
Steps to reproduce#
- Add several Antigravity provider instances (
antigravity,antigravity_2, …antigravity_9). - Sign in to a different Google account on each instance.
- Start a thread on instance A, then a thread on instance B.
- Compare the account shown / the quota reported.
Expected#
Each instance uses the account that was signed in for that instance.
Actual#
All instances use the same account. Both threads report the same error, e.g.:
Antigravity stopped this turn because of an error.
Individual quota reached. Please upgrade your subscription to increase your limits. Resets in 14m59s.
Evidence#
1. Per-instance credentials are stored correctly, and they are different accounts#
Each provider instance has its own token at
<userdata>/providers/antigravity/<sha256(instanceId)>/antigravity-acp/acp_token.json
and each one resolves to a different Google account when exchanged at Google's token endpoint (verified via oauth2/v3/userinfo). So this is not a token-storage problem.
2. The ACP process is spawned with an identical environment for every instance#
Three concurrent sessions, three different instances, captured from /proc/<pid>/environ:
pid A: antigravity acp - HOME=/home/muinos cwd=~/.t3/scratch/<thread A>
pid B: antigravity acp - HOME=/home/muinos cwd=~/.t3/scratch/<thread B>
pid C: antigravity acp - HOME=/home/muinos cwd=~/.t3/scratch/<thread C>
No XDG_CONFIG_HOME, no XDG_DATA_HOME, no ANTIGRAVITY_*, nothing that identifies the instance. Only cwd differs.
3. ProviderInstanceConfig.environment does not help — it is only applied to terminals#
The settings schema does accept per-instance environment:
ProviderInstanceConfig = Struct({
driver: ProviderDriverKind,
displayName: optional(TrimmedNonEmptyString),
accentColor: optional(TrimmedNonEmptyString),
environment: optionalKey(ProviderInstanceEnvironment),
enabled: optionalKey(Boolean),
config: optionalKey(Unknown)
});
I added environment: [{name:"HOME", value:"<instanceDir>/home", …}, XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME]
to all 10 instances and restarted the app. The ACP processes still came up with HOME=/home/muinos.
Tracing where that resolver is used in the packaged app shows it is wired into TerminalManager / terminal.resolveLaunchInputEnvironment, i.e. the integrated terminal path — not the provider/ACP process.
4. The Antigravity CLI already supports isolation, but T3 does not use it#
antigravity acp --help
--app-data-dir Path where application data is stored (default antigravity-cli)
--cli_dir_name Subdirectory under app_data_dir for CLI settings and logs
The CLI stores its session/auth state under ~/.gemini/antigravity-cli, which is shared by every instance because T3 never passes --app-data-dir (nor an equivalent env var). That is why the last account that signed in wins for all instances.
Suggested fix#
When spawning the ACP for an Antigravity provider instance, isolate its application data, e.g.:
antigravity acp --app-data-dir <userdata>/providers/antigravity/<sha256(instanceId)>/antigravity-cli
or export the equivalent (ANTIGRAVITY_EXECUTABLE_DATA_DIR / --app-data-dir) per spawn.
Additionally, it would help to apply ProviderInstanceConfig.environment to the ACP spawn as well, not only to terminals — that alone would let users work around this today by setting HOME/XDG_CONFIG_HOME per instance from the settings file.
Impact#
Multi-account Antigravity setups are unusable: signing in to a second account silently changes the account used by every other instance, and all instances share one quota.
tanstack-source added labelsbug
Root cause (reproduced on Arch Linux, KDE + gnome-keyring, managed CLI 1.5.10): this isn't a missing
--app-data-dir. T3 already passes--gemini-dir <profile> --app-data-dir antigravity-acpper instance. The 1.5.x CLI keeps the Google sign-in in a single OS keyring entry (service=gemini,account=antigravity) whatever those flags say, and ignoresAGY_ACP_FORCE_FILE_STORAGE, which is what kept instances apart on 1.4.x. Since #35409 moved the managed runtime to 1.5.x, every instance, the Antigravity app andagyread and overwrite that one entry, so the last sign-in wins and a sign-out in one signs out all of them. That matches the two-way sync with the IDE described above.Repro: private D-Bus session, a throwaway gnome-keyring seeded with a fake token, scratch
HOMEand a fresh--gemini-dir. The never-signed-in profile authenticates as the seeded account, anddbus-monitorshows the only lookup is{service: gemini, username: antigravity}. With no D-Bus session bus, the CLI logsUsing file-based token storage because no D-Bus session bus detectedand reads<profile>/antigravity-acp/antigravity-oauth-tokeninstead, but that is Linux-only and isn't something T3 should rely on. Windows uses the un-namespaced Credential Manager targetgemini:antigravity(google-antigravity/antigravity-cli#1261), and macOS the matching Keychain item.So T3 can't give each instance its own Google account until the CLI stores sign-ins per profile; I filed that upstream as google-antigravity/antigravity-cli#1610. Meanwhile a Gemini API key or Agent Platform instance keeps its own credentials.
#38097 (stacked on #36733) makes the shared sign-in visible instead: the card shows the signed-in email and marks a keyring sign-in as shared, follows a sign-in or sign-out made elsewhere, and the user guide stops promising one Google account per instance.
Same on the latest provider!
Building on @KitsuneKode's root-cause analysis: there is a way to force the native
agy1.5.x CLI into per-profile file-based token storage on macOS (and likely Linux/Windows as well) without waiting ongoogle-antigravity/antigravity-cli#1610.Finding (
agy1.5.10 on macOS)#agyhas an internalshouldBypassKeyringcheck (composite_token_storage.go) that disables OS keyring access whenSSH_CONNECTIONis set in the process environment.Tested directly with
agy 1.5.10using T3's existing flags (--gemini-dir <profile> --app-data-dir antigravity-acp) and without overridingHOME:SSH_CONNECTION="127.0.0.1 1 127.0.0.1 2" agy acp --gemini-dir <profile> --app-data-dir antigravity-acp --loginBoth
agy acp --loginandagy acp(authenticate) log:composite_token_storage.go:176] Using file-based token storage because SSH session detectedWith this set:
agyreads/writes<profile>/antigravity-acp/antigravity-oauth-tokeninstead of the shared OS keyring entry (service=gemini,account=antigravity).- A fresh profile does not inherit the shared macOS Keychain / Antigravity IDE account and does not trigger macOS Keychain prompts.
- Multiple Google accounts can run concurrently across separate T3 provider instances (verified with 6 separate accounts in ACP mode).
antigravityUsageLimits.ts(PR #36733 / #38957) already checks<profile>/antigravity-acp/antigravity-oauth-tokenbefore falling back to the OS keyring.
Workaround today#
Because
AntigravityDrivermerges per-instanceProviderInstanceConfig.environmentandantigravityAuthSupport.tsdoes not stripSSH_CONNECTION, settingSSH_CONNECTION=127.0.0.1 1 127.0.0.1 2in an Antigravity instance's Environment settings isolates that instance's Google sign-in into its own profile directory.Possible T3-side fix & caveats#
Because setting
SSH_CONNECTIONunconditionally has real tradeoffs:- It leaks into child shell commands run by the agent (which can affect tools like
gpg/pinentry,gh,xdg-open, etc.). - Existing single-account users signed in via the OS keyring / Antigravity IDE would appear signed out.
- It relies on an undocumented
agyheuristic rather than an official flag.
Would maintainers be open to an opt-in per-instance isolation toggle (passing
SSH_CONNECTIONfor native CLI spawns and skipping the OS keyring fallback inantigravityUsageLimits.tswhen enabled), or would you prefer to keep this as a workaround untilgoogle-antigravity/antigravity-cli#1610adds a proper flag?Confirming this regression on macOS (
darwin-arm64), T3 Code0.1.10, managedantigravity-acp1.5.12(upgraded from1.4.5yesterday).- Previously on
1.4.5, my two Antigravity instances (antigravityandantigravity_secondary) stayed logged into separate Google accounts via their per-instanceacp_token.jsonfiles. - On
1.5.11/1.5.12, T3 Code still spawns both with separate--gemini-dir ~/.t3/userdata/providers/antigravity/<sha256>and--app-data-dir antigravity-acp, but bothacp-server-*.logfiles showChainedAuth: authenticated via keyring (effective: keyring)loading the exact same account and token expiry timestamp. - Signing into Account B on the secondary instance immediately switches the primary instance to Account B, and signing back into Account A on primary overwrites the secondary instance back to Account A.
Big +1 for #38097 (showing the signed-in email and shared status in Settings → Providers would have saved a lot of confusion) and for restoring multi-account isolation per instance, either via upstream
google-antigravity/antigravity-cli#1610or an opt-in isolation toggle in T3 Code.- Previously on
Checked on main @ 420d1b59003 with agy 1.5.12: each Antigravity instance now runs with its own
GEMINI_HOME(<userdata>/providers/antigravity/<sha256(instanceId)>) plus--gemini-dir/--app-data-dir antigravity-acp. A Google sign-in made with plainagy acp --login(global~/.gemini) was not visible to a new instance, which stayed 'Not authenticated' until it signed in through its own profile; an API-key instance on the same host stayed on its key. So instances no longer share one account on the native CLI. Not checked: the managed 1.4.5 runtime.Closing: fixed on main. Each Antigravity instance now runs with its own GEMINI_HOME and --gemini-dir/--app-data-dir, so instances keep separate sign-ins (verified with a real Google account: https://github.com/pingdotgg/t3code/issues/37587#issuecomment-7025118200).
juliusmarminge closed this
Reopening: my earlier "fixed on main" was wrong. nucbox-1 is headless with no OS keyring, so agy 1.5.x fell back to per-profile files and the instances looked isolated. On a desktop with a keyring (macOS Keychain, Windows Credential Manager, Linux Secret Service), agy 1.5.x keeps the Google sign-in in one entry (service
gemini, accountantigravity) and ignores--gemini-dir/--app-data-dir/AGY_ACP_FORCE_FILE_STORAGE. The agy 1.5.12 binary has no reference to that variable. So instances still share whichever account signed in last; see the repro in #38097. A user reports the same on Linux nightly: https://x.com/muinoscaio/status/2123565176565952968juliusmarminge reopened this
Confirming this on macOS (Apple Silicon) with the latest nightly.
Environment#
- T3 Code:
0.1.11-nightly.20261120.4969(Desktop + local server, commitdb51b6719f116de156401ed264b5d732f35b2c93) - OS: macOS (
darwin arm64, kernel27.0.0) - Antigravity runtime:
1.5.9(managed by T3)
What happened#
- Had an existing Antigravity provider instance (
antigravity) signed into Google account A (set up Nov 14). - Added a second Antigravity provider instance (
antigravity_agy_rocket) in Settings → Providers and signed into Google account B (different email). - Checked Usage → Limits: only the newly added instance (
AGY (Rocket)) appears as a single 100%-width bar; the original instance's limits disappeared.
Evidence#
- Both per-instance directories exist under
<state-dir>/providers/antigravity/<hash>/, and neither contains anacp_token.jsonfile. - macOS Keychain has only a single entry (
service: "gemini",account: "antigravity"):cdat:2026-11-14T03:46:13Z(original instance login)mdat:2026-11-20T05:43:01Z(exact timestamp of the second instance login, overwriting the first)
- In
server.trace.ndjson,AntigravityUsageProbe.fetchWindowssucceeded for both instances, but because both read the same Keychain token and resolve to the same Google account ID,collectLimitAccountscollapses them into one entry.
Generated by Gemini 4 Neon (Antigravity agent in T3 Code).
- T3 Code:
juliusmarminge closed this
Sign in to join this conversation.
Confirming this on macOS (T3 Code nightly, managed Antigravity runtime, binary path empty).
In my case, it also syncs bidirectionally with Antigravity IDE:
Diagnostics from
~/.t3/userdata/providers/antigravity/: (using Gemini 4 Hydrogen medium, don't fully trust it)antigravity-acp/state files (jetski_state.pbtxt,settings.json,installation_id,conversation_summaries.db), soGEMINI_HOMEisolation is active for non-credential state.acp_token.jsonexists ; newly created providers never write their ownacp_token.json.So on macOS, it looks like
AGY_ACP_FORCE_FILE_STORAGE=1is either not being passed or not honored by the managed runtime (in addition to--app-data-dirif needed), causing all T3 Code providers and Antigravity IDE to read/write the same shared credential store (macOS Keychain).