Skip to content

fix(antigravity): detect Orca Chat sign-in via antigravity-acp/acp_token.json - #39398

Merged
nwparker merged 1 commit into
stablyai:mainfrom
Manho:fix/antigravity-managed-token-detection
Nov 8, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
Manho:fix/antigravity-managed-token-detection

Conversation

@Manho

@Manho Manho commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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: hasManagedAntigravityChatSignIn used to scan the managed home and every folder under it for any file ending in oauth-token (a name from agy's own store, not the managed server's). It now does a single stat of <managedHome>/antigravity-acp/acp_token.json — the path agy-acp-server 1.4.1 uses for the personal sign-in — reusing the existing ANTIGRAVITY_ACP_HOME constant. 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.ts with the updated fixture (antigravity-acp/acp_token.json) on main fails — 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 stat on 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The managed Chat sign-in check now looks for acp_token.json under ANTIGRAVITY_ACP_HOME. It no longer searches the managed home and its immediate subfolders for filenames ending in oauth-token. The test fixture now uses acp_token.json.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to c45dc

No merge-blocking issue is established. The reported fix has not been verified in a running app or on other platforms.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive [#39395] The reviewed head changes hasManagedAntigravityChatSignIn to a single stat of <managedHome>/<ANTIGRAVITY_ACP_HOME>/acp_token.json. The test fixture now writes that file, and the selecti… Establish whether the Orca Chat managed sign-in flow, or the pinned agy-acp-server 1.4.1 runtime, can write acp_business_token.json for a signed-in Orca Chat user. If it can, the reviewer must decide whether this PR must also detect that …
Passed Passed checks: 4 passed

Check name Status Explanation
Out of Scope Changes check Passed [#39395] The whole-PR diff touches only src/main/antigravity/antigravity-host-acp.ts and src/main/antigravity/antigravity-host-acp.test.ts. The source change replaces the directory scan and `oauth…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Title check Passed The title names the change: Orca Chat sign-in detection now uses the antigravity-acp/acp_token.json file. It matches the summary, which says the check now looks only for that file and no longer scans …
Description check Passed The description follows the repository template and fills in every required section. It has an ELI5, a before/after account of What Changed, a Why section that compares the approach with the earlier d…
Full details: Out of Scope Changes check

Explanation

[#39395] The whole-PR diff touches only src/main/antigravity/antigravity-host-acp.ts and src/main/antigravity/antigravity-host-acp.test.ts. The source change replaces the directory scan and oauth-token suffix match with the check for the managed token path. It also adds the ANTIGRAVITY_ACP_HOME import and removes the unused readdir import. The test change updates the fixture file name to acp_token.json. All changes support the managed Chat sign-in detection in the issue. No unrelated code, configuration, or documentation changes appear in the reviewed diff.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Full details: Title check

Explanation

The title names the change: Orca Chat sign-in detection now uses the antigravity-acp/acp_token.json file. It matches the summary, which says the check now looks only for that file and no longer scans for names ending in oauth-token. The title is 77 characters, slightly long but within a reasonable range for a conventional-commit title.

Full details: Description check

Explanation

The description follows the repository template and fills in every required section. It has an ELI5, a before/after account of What Changed, a Why section that compares the approach with the earlier directory scan, a linked issue (Fixes #39395), N/A for Visual Proof with a reason, Testing steps with a repro and platform note, a Risk section with level and revert path, and the Agent skill upstream boundary checkbox. Some items are open: the 'pnpm lint, typecheck, test, and build' checkbox is unchecked, and the AI Disclosure section is blank. The author also marked the 'Every added test fails' checkbox as checked. The description is mostly complete, so the check passes.

Full details: Linked Issues check

Explanation

[#39395] The reviewed head changes hasManagedAntigravityChatSignIn to a single stat of &lt;managedHome&gt;/&lt;ANTIGRAVITY_ACP_HOME&gt;/acp_token.json. The test fixture now writes that file, and the selection test expects null from selectAcpHostAccountHome. This fixes the personal sign-in case in the issue reproduction. The issue Evidence section states that the pinned agy-acp-server 1.4.1 binary also contains acp_business_token.json, and the PR objectives summary lists both names. The head does not check acp_business_token.json. The PR description limits the fix to the personal sign-in path. The reviewed evidence does not establish whether Orca Chat sign-in can produce acp_business_token.json. If it can, a signed-in business user still reads as signed out, which is the bug in the issue. The previous PASS relied on a version that checked both names. That evidence no longer applies to the head. The change for the personal token is supported by the diff.

Resolution

Establish whether the Orca Chat managed sign-in flow, or the pinned agy-acp-server 1.4.1 runtime, can write acp_business_token.json for a signed-in Orca Chat user. If it can, the reviewer must decide whether this PR must also detect that file and add a selection test for it. If it cannot, the reviewer must record that the personal token is the only Orca Chat sign-in form.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 33399b0d-8acc-4737-a320-c1168aecd5f4
Commits

Reviewing files that changed from the base of the PR and between 4a504ac and c45dc7c.

Files selected for processing: 2

  • src/main/antigravity/antigravity-host-acp.test.ts
  • src/main/antigravity/antigravity-host-acp.ts

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

…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]>
@nwparker
nwparker force-pushed the fix/antigravity-managed-token-detection branch from 4a504ac to c45dc7c Compare November 8, 2026 11:23
@nwparker nwparker changed the title fix(antigravity): detect Orca's Chat sign-in from the server's token files fix(antigravity): detect Orca Chat sign-in via antigravity-acp/acp_token.json Nov 8, 2026
@nwparker
nwparker merged commit 448aaad into stablyai:main Nov 8, 2026
42 checks passed
@Manho
Manho deleted the fix/antigravity-managed-token-detection branch November 8, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Antigravity Chat sign-in is not detected, so new chats can move to the host's agy account

2 participants