# fix\(server\): Antigravity Change account opens Google sign-in again · PR \#21085 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/21085)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: open

Source repository: Unavailable fork

Source branch: fix/antigravity-windows-sign-in

Target branch: main

Head commit: 77e0962918907476c155f586154b4a4c0cacc81c

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/21085)

[Commits](https://git.cafe/pingdotgg/t3code/pull/21085/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/21085/diffs?format=markdown)

## Description

---

Change account could reuse Antigravity’s saved Google token and skip Google sign-in. Browser authentication now stops the instance’s sessions and owned processes, hides that token before native startup, and settles credentials after the native runtime closes.

A focused credential service owns isolation and recovery. Cancellation or failure before Google saves a new token restores the previous account; a newly saved token wins even if later authentication/model discovery fails. Recovery atomically installs the backup without replacing a concurrent writer. Sign out retires obsolete backups and reports cleanup failures. Cancellation stays nonterminal until runtime and credential cleanup finish; a restoration failure reports failed sign-in and retains the recoverable backup. API-key and other non-browser methods keep their existing behavior.

Continues @kharitonov-egor’s work in [#21085](https://github.com/pingdotgg/t3code/pull/21085), preserving contributor history and merging main. The takeover replaces the free filesystem effects with the owning service, fixes the recovery race, and updates both account-switch instructions.

Verification on [77e0962918](https://github.com/kharitonov-egor/t3code/commit/77e0962918907476c155f586154b4a4c0cacc81c), Linux x64, Node 24.21.0:

- Auth/support tests: original 59 → rebuilt 63, preserving all 52 baseline cases. The startup cases fail with the main controller; concurrent-write recovery fails with the original PR; disabling backup retirement makes both sign-out regressions fail. A cancellation restore failure was red before the review fix and now reports failed through both the return value and subscription; its Deferred gate also proves admission stays closed during cleanup.
- 144 focused tests passed across Auth, support, Driver, Provider, ACP support and Antigravity adapter suites. Targeted lint/formatting, server typecheck and server export checks passed.
- Running web app with the real pinned Antigravity ACP 1.3.0 Linux runtime (verified release checksum), isolated profile and synthetic saved token: sign-in exposes a fresh Google OAuth link while the old token is absent, Cancel closes the native process and restores the original token byte for byte, the retry/cancel path succeeds. The final head was also cancelled during startup before a link appeared, restoring the token correctly. [Sanitized filesystem/process proof](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/254c4a5c7bab3c45/21085-live-proof-current.json).
- This uses the shared Sign in / Change account backend flow, but the UI showed Sign in because no real Google account was authenticated. Completing Google authentication, switching between real accounts, native logout against Google, Windows/macOS filesystem behavior, iOS, Android and Electron desktop were not verified. Controller/service tests cover successful replacement and logout cleanup. Atomic writes by the native token writer were not verified. Unsupported hard-link restoration retains the backup and reports failure. A persistent startup recovery error makes the instance unavailable until filesystem access is repaired and the instance recreated (settings change or server restart); native Windows filesystem verification remains a human check.
- Screenshot font loading required a local verification font in this headless environment; no product styles were changed.

**Waiting for Google sign-in, old token isolated**

![Antigravity waiting for Google sign-in](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/ae6e13765b123509/21085-google-waiting-current.png)

**After Cancel, original token restored**

![Antigravity after cancelling sign-in](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0dbfc09791fe586e/21085-cancelled-current.png)

[Cancellation recording](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/67f977112bdd80f2/21085-cancel-current.mp4)

Independent full-diff reviews: both round-1 reviewers found cancellation could hide a credential restoration failure. Fixed with one regression and explicit settlement outcome handling. Round 2: Claude Opus 5.5 and GPT-6-Sol independently reviewed the complete diff at this head and found no code blockers.

Model and harness: tests by GPT-6-Astra and implementation/integration by GPT-6.1-Sol in Codex through T3 Code; independent reviews by Claude Opus 5.5 and GPT-6-Sol.

