Repository navigation
fix(antigravity): detect Orca Chat sign-in via antigravity-acp/acp_token.json - #39398
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
…ken.json agy-acp-server 1.4.1 keeps the personal sign-in at <GEMINI_HOME>/antigravity-acp/acp_token.json; nothing it writes ends in oauth-token, so a signed-in Chat read as signed out and new chats could move to the host's ~/.gemini account. Fixes stablyai#39395 Co-authored-by: Wenhao <[email protected]>
4a504ac to
c45dc7c
Compare
ELI5
Orca checks for a saved login file to tell whether you already use its own Chat sign-in. It was looking for a file name the Chat server never writes, so a signed-in person looked signed out and a new chat could be moved onto a different account. It now looks for the file the server actually writes.
What Changed
Before: someone signed in to Orca's managed Antigravity Chat read as signed out, so a new chat could be pinned to the host's own
agy(~/.gemini) account instead of staying on Orca's Chat.After: that person's new chats stay on Orca's managed Chat.
Mechanism:
hasManagedAntigravityChatSignInused to scan the managed home and every folder under it for any file ending inoauth-token(a name from agy's own store, not the managed server's). It now does a singlestatof<managedHome>/antigravity-acp/acp_token.json— the path agy-acp-server 1.4.1 uses for the personal sign-in — reusing the existingANTIGRAVITY_ACP_HOMEconstant. The test fixture writes that real file.Why
#39006 promises existing Chat users are not moved off Orca's Chat; that promise depended on this check. Checking the one exact path the pinned server writes is simpler and cheaper than a two-level directory scan with a suffix match, and can't false-positive on unrelated files.
Linked Issue
Fixes #39395
Original fix by @Manho in #39398; final version reworked during the bug bash.
Reported by @Manho
Visual Proof
N/A: no UI change. This only changes which backend a new chat is pinned to, which is covered by the unit test below.
Testing
Repro:
pnpm test src/main/antigravity/antigravity-host-acp.test.tswith the updated fixture (antigravity-acp/acp_token.json) onmainfails — the managed sign-in isn't detected, so the host ACP is still selected.Verification: the same test passes with this change (4/4), and the surrounding antigravity suite passes (22 files, 138 tests).
CI static gates on the touched files pass: anti-slop oxlint, code-quality native plugins, ast-grep, changed-code quality, oxfmt.
Platform: macOS. The check is a plain path
staton the same managed home on every platform; it runs on the host launching the chat, so SSH/remote hosts behave the same.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Risk
Riskiest part: a token file left behind after its login is no longer valid would keep new chats on the managed runtime rather than the host's
agy— that keeps the person on Orca's Chat rather than moving their account. Chats already pinned to the host stay there; only new chats are affected. No saved data or settings change; a plain revert backs it out.Level: Low
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance. Mobile is not touched; folder workspaces are unaffected (the check reads Orca's managed state directory, not the workspace).
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)