Skip to content

Antigravity: all provider instances share the same account (ACP spawned without --app-data-dir) #37587

Closed

Description

@muinoscaio

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 on 4709 and 4736), 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

  1. Add several Antigravity provider instances (antigravity, antigravity_2, … antigravity_9).
  2. Sign in to a different Google account on each instance.
  3. Start a thread on instance A, then a thread on instance B.
  4. 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.

Activity

  1. iLiranS commented on Nov 16, 2026

    @iLiranS

    Confirming this on macOS (T3 Code nightly, managed Antigravity runtime, binary path empty).

    In my case, it also syncs bidirectionally with Antigravity IDE:

    1. Creating a new Antigravity provider in T3 Code and clicking Sign in immediately authenticates using Antigravity IDE's active Google account without opening a browser.
    2. Clicking Sign out in T3 Code signs out Antigravity IDE as well.
    3. Switching accounts in either app switches the account in the other.

    Diagnostics from ~/.t3/userdata/providers/antigravity/: (using Gemini 4 Hydrogen medium, don't fully trust it)

    • 3 separate provider directories exist, and each has its own antigravity-acp/ state files (jetski_state.pbtxt, settings.json, installation_id, conversation_summaries.db), so GEMINI_HOME isolation is active for non-credential state.
    • However, across all 3 provider directories, only 1 acp_token.json exists ; newly created providers never write their own acp_token.json.

    So on macOS, it looks like AGY_ACP_FORCE_FILE_STORAGE=1 is either not being passed or not honored by the managed runtime (in addition to --app-data-dir if needed), causing all T3 Code providers and Antigravity IDE to read/write the same shared credential store (macOS Keychain).

  2. KitsuneKode commented on Nov 17, 2026

    @KitsuneKode

    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-acp per 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 ignores AGY_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 and agy read 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 HOME and a fresh --gemini-dir. The never-signed-in profile authenticates as the seeded account, and dbus-monitor shows the only lookup is {service: gemini, username: antigravity}. With no D-Bus session bus, the CLI logs Using file-based token storage because no D-Bus session bus detected and reads <profile>/antigravity-acp/antigravity-oauth-token instead, but that is Linux-only and isn't something T3 should rely on. Windows uses the un-namespaced Credential Manager target gemini: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.

  3. vedmalex commented on Nov 19, 2026

    @vedmalex
    Contributor

    Same on the latest provider!

  4. vedmalex commented on Nov 19, 2026

    @vedmalex
    Contributor

    Building on @KitsuneKode's root-cause analysis: there is a way to force the native agy 1.5.x CLI into per-profile file-based token storage on macOS (and likely Linux/Windows as well) without waiting on google-antigravity/antigravity-cli#1610.

    Finding (agy 1.5.10 on macOS)

    agy has an internal shouldBypassKeyring check (composite_token_storage.go) that disables OS keyring access when SSH_CONNECTION is set in the process environment.

    Tested directly with agy 1.5.10 using T3's existing flags (--gemini-dir <profile> --app-data-dir antigravity-acp) and without overriding HOME:

    SSH_CONNECTION="127.0.0.1 1 127.0.0.1 2" agy acp --gemini-dir <profile> --app-data-dir antigravity-acp --login

    Both agy acp --login and agy acp (authenticate) log:

    composite_token_storage.go:176] Using file-based token storage because SSH session detected
    

    With this set:

    Workaround today

    Because AntigravityDriver merges per-instance ProviderInstanceConfig.environment and antigravityAuthSupport.ts does not strip SSH_CONNECTION, setting SSH_CONNECTION=127.0.0.1 1 127.0.0.1 2 in 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_CONNECTION unconditionally has real tradeoffs:

    1. It leaks into child shell commands run by the agent (which can affect tools like gpg/pinentry, gh, xdg-open, etc.).
    2. Existing single-account users signed in via the OS keyring / Antigravity IDE would appear signed out.
    3. It relies on an undocumented agy heuristic rather than an official flag.

    Would maintainers be open to an opt-in per-instance isolation toggle (passing SSH_CONNECTION for native CLI spawns and skipping the OS keyring fallback in antigravityUsageLimits.ts when enabled), or would you prefer to keep this as a workaround until google-antigravity/antigravity-cli#1610 adds a proper flag?

  5. imatheus-lucas commented on Nov 19, 2026

    @imatheus-lucas

    Confirming this regression on macOS (darwin-arm64), T3 Code 0.1.10, managed antigravity-acp 1.5.12 (upgraded from 1.4.5 yesterday).

    • Previously on 1.4.5, my two Antigravity instances (antigravity and antigravity_secondary) stayed logged into separate Google accounts via their per-instance acp_token.json files.
    • 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 both acp-server-*.log files show ChainedAuth: 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#1610 or an opt-in isolation toggle in T3 Code.

  6. juliusmarminge commented on Nov 19, 2026

    @juliusmarminge
    Member

    Checked on main @ 420d1b5 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 plain agy 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.

  7. juliusmarminge commented on Nov 20, 2026

    @juliusmarminge
    Member

    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: #37587 (comment)).

  8. juliusmarminge commented on Nov 20, 2026

    @juliusmarminge
    Member

    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, account antigravity) 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/2123565176565952968

  9. daviesayo commented on Nov 20, 2026

    @daviesayo

    Confirming this on macOS (Apple Silicon) with the latest nightly.

    Environment

    • T3 Code: 0.1.11-nightly.20261120.4969 (Desktop + local server, commit db51b6719f116de156401ed264b5d732f35b2c93)
    • OS: macOS (darwin arm64, kernel 27.0.0)
    • Antigravity runtime: 1.5.9 (managed by T3)

    What happened

    1. Had an existing Antigravity provider instance (antigravity) signed into Google account A (set up Nov 14).
    2. Added a second Antigravity provider instance (antigravity_agy_rocket) in Settings → Providers and signed into Google account B (different email).
    3. 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 an acp_token.json file.
    • 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.fetchWindows succeeded for both instances, but because both read the same Keychain token and resolve to the same Google account ID, collectLimitAccounts collapses them into one entry.

    Generated by Gemini 4 Neon (Antigravity agent in T3 Code).

  10. added a commit that references this issue on Nov 20, 2026
    16cf3a5
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