Multi-Account Antigravity Provider Instances in T3 Code¶
Status: Accepted (Amends ADR 0025)
We added support for multiple simultaneous Google Antigravity accounts inside Modal sandboxes launched with T3 Code (--t3 or --t3code). Sandboxes automatically stage and decrypt three separate OAuth credentials (antigravity-oauth-token.json, antigravity-oauth-token-mgh.json, and antigravity-oauth-token-anv.json), synthesizing isolated ACP agent runtime credentials and status caches for each account in T3 Code (antigravity, antigravity-mgh, and antigravity-anv).
Considered Options¶
- Single Global Account with Manual Profile Switching: Retaining only a single active Antigravity account in T3 Code and requiring developers to run
agyprofile(formerlyswitch-agy-profile.sh) in the terminal to switch accounts. Rejected because T3 Code threads and background orchestrator delegates require distinctproviderInstanceIdtargets to run tasks across accounts concurrently without clashing on local state or quota limits. - Renaming All Instances (
antigravity-m47,antigravity-mgh,antigravity-anv): Renaming the default instance toantigravity-m47. Rejected to maintain full backwards compatibility with existing thread metadata, persisted project configurations, and default orchestrator delegates expectinginstanceId: "antigravity". - Pre-Decrypted Offline Profiles Directory: Staging decrypted tokens into
~/.gemini/antigravity-cli/profiles/{m47,mgh,anv}with 0600 permissions at container boot, enablingscripts/agyprofileto switch CLI profiles instantly without needing lingering raw files in/root/secrets/or live SOPS age keys. Accepted because it cleanly satisfies both T3 Code multi-account runtime requirements and the ephemeral secret scrubbing invariant.
Consequences¶
- Staging (
shared/image.py):LOCAL_ANTIGRAVITY_SECRET_MGHandLOCAL_ANTIGRAVITY_SECRET_ANVare defined and staged alongsideLOCAL_ANTIGRAVITY_SECRETwhenever--t3or--agyis enabled. - Decryption & Provisioning (
scripts/setup.shandshared/startup.sh): - Automatically decrypts the three tokens into
~/.gemini/antigravity-cli/profiles/{m47,mgh,anv}and initializes~/.gemini/antigravity-cli/antigravity-oauth-tokentom47. - For each account (
antigravity,antigravity-mgh,antigravity-anv), generates an isolated ACP token (/root/.t3/userdata/providers/antigravity/<sha256>/antigravity-acp/acp_token.json) and settings. - Registers each instance in
/root/.t3/userdata/settings.jsonunderproviderInstanceswith respective display names (Antigravity,Antigravity (MGH),Antigravity (ANV)). - Pre-seeds
/root/.t3/caches/{antigravity,antigravity-mgh,antigravity-anv}.jsonwith Gemini 3.8 models to eliminate initial UI sign-in and model probing latency. - Offline CLI Profile Switching (
scripts/agyprofile): Updated to switch directly from~/.gemini/antigravity-cli/profiles/<profile>without requiring/root/secrets/(switch-agy-profile.shretained as symlink). - Secret Scrubbing: All
/root/secrets/antigravity-oauth-token*.jsonfiles are wiped from disk immediately following setup. - Universal File Line Budget: All modified code and test files remain strictly within the 500 line budget.