Skip to content

fix(server): Antigravity 1.5.16 Google sign-ins stay in profile storage - #41982

Open
berkpolatCE wants to merge 3 commits into
pingdotgg:mainfrom
berkpolatCE:BP/antigravity_force_file_token_storage
Open

berkpolatCE wants to merge 3 commits into
pingdotgg:mainfrom
berkpolatCE:BP/antigravity_force_file_token_storage

Conversation

@berkpolatCE

@berkpolatCE berkpolatCE commented Nov 24, 2026 •

Copy link
Copy Markdown

Problem

Starting with Antigravity CLI 1.5.16, composite_token_storage.go no longer falls back to file-based token storage solely because SSH_CONNECTION is set when a system keyring (such as macOS Keychain) is available, and it ignores AGY_ACP_FORCE_FILE_STORAGE. Instead, 1.5.16 checks AGY_CLI_FORCE_FILE_TOKEN_STORAGE.

Because antigravityEnvironment did not set AGY_CLI_FORCE_FILE_TOKEN_STORAGE, personal Google (oauth-personal) sign-ins (agy acp --login) and sessions on 1.5.16 silently read and wrote the shared OS keyring instead of <profile>/antigravity-acp/antigravity-oauth-token. That broke per-instance account isolation and caused makeAntigravityUsageProbe (which skips the shared keyring for oauth-personal) to report "Sign in with Google to see Antigravity limits.".

Change

  • In apps/server/src/provider/antigravityAuthSupport.ts:
    • Add AGY_CLI_FORCE_FILE_TOKEN_STORAGE to removedEnvironmentKeys so ambient values (including case-insensitive Windows aliases) cannot override "1" for oauth-personal or leak into other auth methods.
    • Set AGY_CLI_FORCE_FILE_TOKEN_STORAGE: "1" in antigravityEnvironment for oauth-personal, keeping SSH_CONNECTION (needed by 1.5.12–1.5.15 for file storage and by 1.5.16 for headless No browser is available here detection) and AGY_ACP_FORCE_FILE_STORAGE: "1".
    • Leave oauth-business (Gemini Enterprise) unchanged so existing Enterprise keyring sign-ins and antigravityUsageLimits.ts's keyring fallback keep working.
  • In apps/server/src/provider/antigravityAuthSupport.test.ts:
    • Assert that ambient AGY_CLI_FORCE_FILE_TOKEN_STORAGE (and its lowercase alias) is stripped and set to "1" for oauth-personal, and stripped (undefined) for gemini-api-key, agent-platform, and oauth-business.

Note: oauth-personal users who already signed in on 1.5.16 before this fix have their token only in the shared OS keyring and will need to sign in once after upgrading so antigravity-oauth-token is written into the profile (any previous shared keyring entry is left untouched).

Scope

Fixes #41973

Verification

  1. Before (main @ 4afdfefde0, macOS arm64 with live macOS Keychain, managed Antigravity CLI 1.5.16):
    • Spawning antigravity acp with SSH_CONNECTION="127.0.0.1 0 127.0.0.1 0" and AGY_ACP_FORCE_FILE_STORAGE=1 (no AGY_CLI_FORCE_FILE_TOKEN_STORAGE) against a profile containing a synthetic antigravity-oauth-token ignored the profile file and loaded the macOS Keychain account instead; antigravity acp --login did not log file-based token storage.
    • vp test run apps/server/src/provider/antigravityAuthSupport.test.ts failed the 2 updated assertions (AGY_CLI_FORCE_FILE_TOKEN_STORAGE=0 and lowercase alias leaked through; ambient AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 leaked into non-personal methods).
  2. After fix:
    • Live checks against managed Antigravity CLI 1.5.16 via prepareAntigravityProfile + buildAntigravityAcpSpawnInput with real HOME (macOS Keychain active):
      • oauth-personal with a synthetic profile antigravity-oauth-token and ambient AGY_CLI_FORCE_FILE_TOKEN_STORAGE=0: logged composite_token_storage.go:207] Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set and authenticated as the profile token (e2e-profile@example.com), not the macOS Keychain account.
      • oauth-personal with an empty profile: logged file-based token storage and returned JSON-RPC error -32603 (No browser is available here...), without reading macOS Keychain.
      • oauth-personal acp --login (matching AntigravityDriver.codeLogin env): logged file-based token storage and printed the Google OAuth URL.
      • oauth-business with ambient AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1: stripped (undefined).
    • vp test run apps/server/src/provider/antigravityAuthSupport.test.ts apps/server/src/provider/Drivers/AntigravityDriver.test.ts apps/server/src/provider/antigravityUsageLimits.test.ts → 59 passed, 1 skipped (Windows-only).
    • vp run check:changed → format, lint, knip, graphql, typecheck (3 packages), and tests (2 files) all pass.
    • Did not test Linux or Windows runtime hosts directly; Windows case-insensitive stripping is covered by unit tests.

Built with Gemini 4 Neon in T3 Code (Antigravity harness); independently reviewed by Claude Fable 5.2 and GPT-6.2-Sol.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Antigravity child environment now removes inherited AGY_CLI_FORCE_FILE_TOKEN_STORAGE values and sets the variable to "1" for personal OAuth. Tests cover ambient values and verify the variable and SSH_CONNECTION across authentication methods.

Changes: Antigravity environment

Layer / File(s) Summary
Personal OAuth storage flag
apps/server/src/provider/antigravityAuthSupport.ts, apps/server/src/provider/antigravityAuthSupport.test.ts
The environment removes inherited AGY_CLI_FORCE_FILE_TOKEN_STORAGE values and sets the variable to "1" for personal OAuth. Tests check default-environment normalization and confirm the variable and SSH_CONNECTION are absent for other authentication methods.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • Issue 41990 describes personal OAuth using Keychain storage instead of creating a profile token file. This change sets the file-storage variable for personal OAuth, but does not change the usage probe’s Keychain fallback.
  • Issue 34381 describes a usage probe reading a profile token that the runtime does not update. This change selects file-based token storage for personal OAuth, but its effect on the token path described by that issue is unverified.

Suggested reviewers: juliusmarminge, mameli, macroscopeapp

Merge Risk: Minimal · up to 02f8f

Antigravity personal Google sign-ins on 1.5.16 are now kept in the profile token file rather than the shared OS keyring. Business OAuth is unchanged. No concrete merge-blocking risk was found. Users who signed in before this fix will need to sign in again.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Antigravity 1.5.16 personal Google sign-ins are kept in profile token storage instead of the shared OS keyring. It uses a conventional commit prefix and matches the ob…
Description check Passed The description follows the template well. It has Problem, Change, Scope, and Verification sections. The problem is clearly stated with the affected version and reproduction context. The change lists …
Linked Issues check Passed Directly linked issue #41973 has coding requirements only. No contextual or parent issues apply. (1) [#41973] Keep oauth-personal tokens in the profile file, not the shared OS keyring. The whole-PR di…
Out of Scope Changes check Passed All changes map to issue #41973 or its tests. The source change in antigravityAuthSupport.ts adds one removedEnvironmentKeys entry and one oauth-personal-only environment entry. The comment block is r…
Full details: Title check

Explanation

The title names the main change: Antigravity 1.5.16 personal Google sign-ins are kept in profile token storage instead of the shared OS keyring. It uses a conventional commit prefix and matches the objectives and code changes, which set AGY_CLI_FORCE_FILE_TOKEN_STORAGE for oauth-personal and strip it from inherited environments.

Full details: Description check

Explanation

The description follows the template well. It has Problem, Change, Scope, and Verification sections. The problem is clearly stated with the affected version and reproduction context. The change lists the specific file edits. Scope links issue #41973 as the bug. Verification gives concrete before and after results with commands and observed outcomes, and it notes what was not tested (Linux and Windows runtime hosts). It also includes the agent model and harness line the template asks for. The one gap is that the template's conventional-commit title guidance is not restated, but the title already follows that format.

Full details: Linked Issues check

Explanation

Directly linked issue #41973 has coding requirements only. No contextual or parent issues apply. (1) [#41973] Keep oauth-personal tokens in the profile file, not the shared OS keyring. The whole-PR diff against the merge base adds AGY_CLI_FORCE_FILE_TOKEN_STORAGE: "REDACTED_SECRET_ASSIGNMENT" to the oauth-personal branch of antigravityEnvironment in apps/server/src/provider/antigravityAuthSupport.ts. The issue names this variable as the one Antigravity 1.5.16 checks. (2) [#41973] Ambient values must not override or leak. The diff adds AGY_CLI_FORCE_FILE_TOKEN_STORAGE to removedEnvironmentKeys, so inherited values are stripped before the forced value is applied. (3) [#41973] Keep compatibility with older runtimes. SSH_CONNECTION and AGY_ACP_FORCE_FILE_STORAGE remain set for oauth-personal, and the comment now explains the 1.5.16 and older behavior. oauth-business is unchanged, as the issue scope allows. (4) [#41973] Usage limits. The PR does not change makeAntigravityUsageProbe. The issue attributes the usage failure to the missing profile token file, which this change restores by enabling file storage. This link is inferred from the issue text and the PR's live macOS 1.5.16 checks. No automated test covers the probe path. Unit tests in antigravityAuthSupport.test.ts cover stripping and per-method behavior. The PR changes since the previous review are limited to the test assertions and the comment wording, so the earlier conclusions still hold.

Full details: Out of Scope Changes check

Explanation

All changes map to issue #41973 or its tests. The source change in antigravityAuthSupport.ts adds one removedEnvironmentKeys entry and one oauth-personal-only environment entry. The comment block is reworded to describe the 1.5.16 variable. This is a documentation change that supports the code change. The test file adds assertions for the new variable across auth methods. No unrelated behavior change was found in the whole-PR diff.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1facd7b and 02f8fd0.

Files selected for processing: 1

  • apps/server/src/provider/antigravityAuthSupport.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

The automated pipeline stopped on this pull request and will not merge it:

the fix is written and reviewed, but proving it needs something no worker has:

  • Permanent blocker: Antigravity Google account sign-in and the usage-limits panel are explicitly unavailable in the worker environment. Proving personal sign-ins use the selected profile token instead of the shared macOS Keychain requires those capabilities on both commits.
  • Permanent blocker: Gemini Enterprise sign-in is explicitly unavailable, so preservation of enterprise keyring behavior could not be verified.

It stays open for a person to finish or close.

@jknthn

jknthn commented Nov 24, 2026

Copy link
Copy Markdown

Tested this branch locally on macOS (arm64) with managed Antigravity 1.5.16 (oauth-personal) against an isolated --home-dir:

  • Before (0.1.11 / without AGY_CLI_FORCE_FILE_TOKEN_STORAGE): 1.5.16 fell back to macOS Keychain (ChainedAuth: authenticated via keyring), never wrote antigravity-oauth-token, and Usage → Limits returned "Sign in with Google to see Antigravity limits."
  • After (#41982): both acp-login and acp-server log Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set, <profile>/antigravity-acp/antigravity-oauth-token (0600) is written on sign-in, and Usage → Limits immediately populates all 4 quota windows (Gemini · 5-hour, Gemini · Weekly, Claude & GPT (shared) · 5-hour, Claude & GPT (shared) · Weekly).
  • Unit tests (antigravityAuthSupport.test.ts, antigravityUsageLimits.test.ts): 51 passed, 1 skipped.

@jdqniel

jdqniel commented Nov 24, 2026

Copy link
Copy Markdown

Tested the env change from this PR on macOS arm64 with T3 Code Nightly 0.1.12-nightly.20261124.5209, oauth-personal, and an external Homebrew agy 1.5.16 (antigravity-cli cask, found on PATH, no managed runtime, no binaryPath).

I didn't build the branch. The PR's only runtime change for oauth-personal is AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1, and the current Nightly passes that variable through, so I set it with launchctl setenv AGY_CLI_FORCE_FILE_TOKEN_STORAGE 1, restarted T3, then signed out and back in.

A/B with the same binary, a fresh empty profile per run (agy acp --gemini-dir <tmp> --app-data-dir antigravity-acp), T3's current env (SSH_CONNECTION=127.0.0.1 0 127.0.0.1 0, AGY_ACP_FORCE_FILE_STORAGE=1), then ACP initialize and authenticate("oauth-personal"):

without the variable with AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1
storage log no file-storage line Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set
auth ChainedAuth: authenticated via keyring, signed in as my Google account No browser is available here (this is a remote (SSH) session…)

Without the variable, an empty profile signs in with whatever account is in the shared Keychain entry (gemini/antigravity).

My real T3 profile, before:

  • No acp_token.json or antigravity-oauth-token in <profile>/antigravity-acp/.
  • ACP log: ChainedAuth: authenticated via keyring, no file-storage line.
  • Usage → Limits: "Sign in with Google to see Antigravity limits."

After:

  • antigravity-oauth-token written with mode 0600.
  • ACP log: Using file-based token storage because AGY_CLI_FORCE_FILE_TOKEN_STORAGE is set.
  • The Keychain item's mdat stayed at the time of the earlier session, before the new sign-in.
  • Usage → Limits shows all 4 windows: Gemini · 5-hour, Gemini · Weekly, Claude & GPT (shared) · 5-hour, Claude & GPT (shared) · Weekly.

With file storage, 1.5.16 still logs ChainedAuth: authenticated via keyring. The keyringAuth token expiry in that log matches the expiry in the profile's token file.

I didn't test Gemini Enterprise (oauth-business).

@BelKed BelKed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this! :)
i can confirm manually setting AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 makes the limits show up as they should

Before After

@berkpolatCE

Copy link
Copy Markdown
Author

My pleasure!

ryush00 pushed a commit to ryush00/t3code that referenced this pull request Nov 25, 2026
…ge (pingdotgg#41982)

agy 1.5.16 stopped switching to file token storage when SSH_CONNECTION is
set and reads AGY_CLI_FORCE_FILE_TOKEN_STORAGE instead. Without it, personal
Google sign-ins went to the shared OS keyring, which broke per-instance
account isolation and left Usage limits saying "Sign in with Google".

Squashed from upstream PR pingdotgg#41982, which is not merged yet.
Drop this patch once upstream lands it.

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ryush00 pushed a commit to ryush00/t3code that referenced this pull request Nov 25, 2026
…ge (pingdotgg#41982)

agy 1.5.16 stopped switching to file token storage when SSH_CONNECTION is
set and reads AGY_CLI_FORCE_FILE_TOKEN_STORAGE instead. Without it, personal
Google sign-ins went to the shared OS keyring, which broke per-instance
account isolation and left Usage limits saying "Sign in with Google".

Squashed from upstream PR pingdotgg#41982, which is not merged yet.
Drop this patch once upstream lands it.

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Tom-R-Main

Copy link
Copy Markdown

Tested this fix on agy 1.5.17 across macOS arm64 and Linux arm64 (16 KiB pages).

  • Google OAuth stays in profile file storage (antigravity-oauth-token) on both hosts instead of writing to the OS keyring, and sessions survive across restarts.
  • On macOS, AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 only affects Google CLI auth. Hosted plugin OAuth tokens stored under Keychain service antigravity.plugins (tested with the Notion plugin) still read and authenticate normally.

@yuearc

yuearc commented Nov 26, 2026

Copy link
Copy Markdown

Adding an independent multi-profile verification on macOS arm64 with T3 Code's managed Antigravity CLI 1.5.16 (~/.t3/tools/antigravity-acp/darwin-arm64/.../antigravity), since this fix still matters for per-instance account isolation even after #43026 removed usage-limits polling:

  1. A/B isolation check against two fresh, empty --gemini-dir profiles (profileA and profileB) using T3's env (SSH_CONNECTION="127.0.0.1 0 127.0.0.1 0", AGY_ACP_FORCE_FILE_STORAGE=1), sending ACP initialize then authenticate("oauth-personal"):
    • Without AGY_CLI_FORCE_FILE_TOKEN_STORAGE: both empty profiles silently authenticated via the shared macOS Keychain ({"result":{"_meta":{"antigravity":{"tier":{"name":"Google AI Pro","id":"g1-pro-tier",...}}}}}), causing multiple configured Antigravity instances to collapse onto the same shared Keychain account/quota.
    • With AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1: both empty profiles stayed isolated from Keychain and returned JSON-RPC error -32603 (No browser is available here (this is a remote (SSH) session...)), requiring per-profile token storage.
  2. PR branch unit tests (02f8fd0c52): vp test run apps/server/src/provider/antigravityAuthSupport.test.ts passed (31/31) on macOS arm64.

(Did not test Gemini Enterprise / oauth-business.)

vincent-design-for-me added a commit to vincent-design-for-me/p3code that referenced this pull request Nov 26, 2026
The Daily Notes build patched the official 0.1.11 app's minified bundles,
so its features could not ship or merge. This re-implements them in source
under apps/web/src/components/p3, with small mount points in upstream files:

- Daily notes page (/daily-notes): sessions per project grouped by day,
  reachable from the sidebar and the command palette.
- /usage?view=limits opens Usage on Limits.
- Limits page shows one card per account, with a dial for the main window.
- Composer usage strip: context use, last turn tokens and cache hits,
  remaining quota for the current model.
- Thread details quota card: segmented bars for the model's windows and
  an Other Models list.
- Right-edge quota rail with per-provider rings, account breakdowns and a
  burn forecast. Animations play only on hover or when a value changes.
- Compact composer model picker: provider tabs, per-model quota badges
  and an effort slider.
- Antigravity personal sign-ins keep tokens in profile storage (same change
  as upstream PR pingdotgg#41982).

All features read existing client state only; no new network traffic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vincent-design-for-me added a commit to vincent-design-for-me/p3code that referenced this pull request Nov 26, 2026
The Daily Notes build patched the official 0.1.11 app's minified bundles,
so its features could not ship or merge. This re-implements them in source
under apps/web/src/components/p3, with small mount points in upstream files:

- Daily notes page (/daily-notes): sessions per project grouped by day,
  reachable from the sidebar and the command palette.
- /usage?view=limits opens Usage on Limits.
- Limits page shows one card per account, with a dial for the main window.
- Composer usage strip: context use, last turn tokens and cache hits,
  remaining quota for the current model.
- Thread details quota card: segmented bars for the model's windows and
  an Other Models list.
- Right-edge quota rail with per-provider rings, account breakdowns and a
  burn forecast. Animations play only on hover or when a value changes.
- Compact composer model picker: provider tabs, per-model quota badges
  and an effort slider.
- Antigravity personal sign-ins keep tokens in profile storage (same change
  as upstream PR pingdotgg#41982).

All features read existing client state only; no new network traffic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryush00 pushed a commit to ryush00/t3code that referenced this pull request Nov 26, 2026
…ge (pingdotgg#41982)

agy 1.5.16 stopped switching to file token storage when SSH_CONNECTION is
set and reads AGY_CLI_FORCE_FILE_TOKEN_STORAGE instead. Without it, personal
Google sign-ins went to the shared OS keyring, which broke per-instance
account isolation and left Usage limits saying "Sign in with Google".

Squashed from upstream PR pingdotgg#41982, which is not merged yet.
Drop this patch once upstream lands it.

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

8 participants