You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(antigravity): run new chats on a signed-in agy so chat, quota and the picked account agree - #44943
Orca can run Antigravity chats two ways: on the agy you installed yourself, or on a copy Orca bundles that has its own sign-in. Once you had signed in to Orca's copy even once, Orca kept every new chat on it, even when your own agy was signed in, newer, and had more models. The usage meter and the account switcher still pointed at your own agy. So you could chat on account A, watch the meter for account B, switch accounts, and see nothing change. Now new chats use your own agy whenever it is signed in and can serve chats. Orca's copy is the fallback for when it can't. Settings says which one new chats use, and switching accounts restarts idle chats so they move to the new account.
Files
Added
Deleted
Net
Test
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$50
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$50
Prod
9
$\color{#1a7f37}{\Huge{\mathbf{+}}}$130
$\color{#cf222e}{\Huge{\mathbf{−}}}$40
$\color{#1a7f37}{\Huge{\mathbf{+}}}$90
What Changed
Backend selection (antigravity-acp-launch-spec.ts, antigravity-host-acp.ts): a saved Orca Chat sign-in (acp_token.json, or auth state signedIn) no longer stops new chats from running on the host's agy acp. The other conditions stay the same:
the saved Chat account type is personal, so API-key, ADC and business methods keep the managed server;
agy has no API-key provider;
agy has a credential;
the agy acp probe passes (≥ 1.5.2, answers session/list).
The now-unused hasManagedAntigravityChatSignIn and selectionRevision are removed.
accounts.antigravity{List,AddCurrent,Select,Remove} gain an optional chatUsesAgy field for the host target. The host computes it from structuredAgentHostAlternativeReady, waiting at most 1.5 s. Older hosts and WSL omit it.
Settings → Accounts → Antigravity uses it to say whether switching agy's account also applies to Antigravity chats. The Chat group says when its own sign-in is only the fallback.
Account switch ([Bug] The AI provider account does not change #43375): after accounts.antigravitySelect on the host, idle chats whose agent runs on the host's agy are stopped. Their next send resumes on the newly selected account.
This goes through the existing idle-sweep release path with a new anyway flag, so viewed or "Never stop" chats are included.
Owed work (an active turn, held or queued sends, a pending prompt) still keeps the agent running.
The cached agy acp readiness answer is also cleared, so the next check runs against the new login.
Why
hostBackend.select refused the host whenever the managed token existed. That rule came from #39006: "existing users of Orca's Chat sign-in are never moved". It left chat, quota and the picked account out of agreement:
Chat ran on the bundled 1.5.0 server with the Orca sign-in account, and lacked the Orchestrator models that host 1.5.12 lists.
The usage meter (agy -p /usage) read agy's own account.
Accounts → "agy in the terminal" switched agy's account, which managed chats never use.
The UI gave no way to see this or to leave the managed server. Making a signed-in agy the source of truth means the account picker, the quota and new chats are one account. The Settings group already describes Orca's own sign-in as the way "Chat works without agy installed".
Deliberate behavior change: someone who signed in to Orca's Chat with account X while agy holds account Y now gets Y for new chats. Settings now says so. Existing chats stay pinned to the backend they were created on, so managed chats keep Orca's sign-in.
Linked Issue
Fixes#44613
Refs #43375 (STA-12717): idle chats on the host's agy now follow an account switch. Chats on Orca's managed server and busy chats do not; see the remaining risks below.
Testing
antigravity-host-backend-select.test.ts: with a managed acp_token.json present and the Chat auth state signedIn, select returns agy's home. Without this fix it returns null; I checked by reverting.
structured-agent-session-early-release.test.ts: releaseIdleSession(id, true) stops a viewed chat's idle agent while "Never stop" is set.
Verified in a real dev Orca (Electron, macOS, host agy 1.5.13); see Visual Proof. Not checked against a real two-account setup: this host has no saved agy accounts in Orca, so the switch path was triggered through a temporary, uncommitted RPC seam.
structured-agent-session-early-release.test.ts: a running ACP-style agent with no adapter-reported home is found through its record's pinned home (the bug fixed in the third commit).
Remaining risks / follow-ups
Not verified with two real accounts: that a long-running agy acp keeps its starting login after a keyring switch, and that session/resume under a different Google account works.
Managed chats are not moved: chats created on the managed server stay on it, with Orca's sign-in account and no quota reading. Their history lives in the managed home, so moving them is not possible.
Busy chats at switch time keep the old account: a chat with a turn running when you switch stays on the old account until the regular idle sweep stops it.
Quota for the managed account isn't read. The meter has no reading for Orca's own sign-in when agy can't serve chats (not installed, older than 1.5.2, API-key provider, or a non-personal Chat account type). Reading it would need Google to expose usage for the managed server's token, either through agy-acp-server or by having agy -p /usage accept that token.
Orchestrator models on the managed server: the bundled agy-acp-server 1.5.0 does not list them. That needs a newer server build from Google, and a pin bump here.
Visual Proof
Real dev Orca on this branch (macOS, host agy 1.5.13, signed in). Process checks used ps.
a. No managed token: a new Antigravity chat spawns agy acp --dangerously-skip-permissions, answers "OK", and the picker lists Gemini 4 Carbon / Neon / Argon.
(screenshot removed: contained real product data) (screenshot removed: contained real product data)
b. Dummy managed acp_token.json planted in the dev profile: the new chat still spawns host agy acp (no agy_acp_server) and the Orchestrator models show. Running this PR's selection test against origin/main's launch spec returns null (managed), so main would have used the managed server.
(screenshot removed: contained real product data)
c. Settings > AI Provider Accounts > Antigravity: with a personal Chat account type, it says new chats use agy's account. With the Chat account type set to Gemini Enterprise, it says switching does not apply to chats.
(screenshot removed: contained real product data) (screenshot removed: contained real product data)
Non-personal Chat auth stays managed: with Gemini Enterprise, a new chat does not start host agy acp. It asks to install Orca's copy.
(screenshot removed: contained real product data)
d. Account switch path: when triggered (through a temporary seam, since there's no second saved account), the idle chat's agy acp stopped even though the chat was open. The busy chat, mid sleep 40, kept running. The next send to the idle chat started a new agy acp, and the chat resumed with its history.
(screenshot removed: contained real product data) (screenshot removed: contained real product data)
No actionable comments were generated in the recent review.
Walkthrough
The host Antigravity backend selector now uses personal-auth, API-key, credential, and host-readiness checks. Account RPC responses can report whether chats use agy’s account, and settings descriptions reflect that state. Selecting an account clears cached host ACP checks and releases eligible idle Antigravity sessions. The idle release API accepts an optional flag that permits release when the normal idle policy would not stop a chat.
Severity of issue fixed: Medium
Merge Risk: Low · up to 57872
New Antigravity chats can now use the host's signed-in agy, and idle host chats are released after an account switch. The settings copy may still overstate how account selection affects existing chats. That wording issue is small and does not block the merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title describes the main change: new Antigravity chats run on a signed-in host agy so chat, quota, and the selected account agree. It matches the changeset's core behavior (backend selection plus …
Linked Issues check
Directly linked issue #44613 has two coding objectives. (1) Consistent chat and quota attribution, or clear UI disclosure of any mismatch. (2) Backend visibility or selection when a compatible host ag…
Out of Scope Changes check
Each changed area connects to the #44613 objective of consistent account attribution or to its visibility objective. The backend selection change (antigravity-acp-launch-spec.ts, antigravity-host-acp.…
Description check
The description follows the repository template closely. It has an ELI5 section, a What Changed section that covers backend selection, visibility, and the account switch, and a Why section that explai…
Full details: Title check
Explanation
The title describes the main change: new Antigravity chats run on a signed-in host agy so chat, quota, and the selected account agree. It matches the changeset's core behavior (backend selection plus account visibility and idle-chat release). The title is a single line, uses the conventional prefix, and is specific enough for a teammate scanning history. Its length is at the upper end but acceptable.
Full details: Linked Issues check
Explanation
Directly linked issue #44613 has two coding objectives. (1) Consistent chat and quota attribution, or clear UI disclosure of any mismatch. (2) Backend visibility or selection when a compatible host agy is installed. The reviewed head addresses both. In antigravity-acp-launch-spec.ts, the host-backend selector no longer rejects the host agy when a managed acp_token.json or Chat auth state signedIn exists. It selects the host agy when the other conditions pass: personal Chat account type, no API-key provider, a host credential, and a passing agy acp probe (>= 1.5.2, answers session/list). New chats therefore use the account that the usage meter reads. antigravity-host-backend-select.test.ts covers the managed-token case. antigravity-chat-backend.ts sets chatUsesAgy for the host target, and AntigravityAccountsSection.tsx and en.json use it to state which account new chats use and when Orca's sign-in is only the fallback. The incremental changes since the previous review (childAccountHome orPinned, the anyway idle-release flag, restartIdleAgyChats, forgetAntigravityHostAcpChecks) support the account-switch part of the objective and the pinning of existing chats. Two parts of the issue remain outside this change and are stated in the PR body: managed-server chats keep the 1.5.0 runtime without Orchestrator models, and no quota reading is provided for the managed account. The issue's expected behavior allows either a backend choice or clear visibility, and the managed-runtime pin update depends on a newer Google build, so these limits do not fail the assessment. Not verified: runtime behavior with two real accounts, and Electron. This assessment relies on the supplied summary and the prior assessment; no additional source inspection was run for the incremental changes.
Full details: Out of Scope Changes check
Explanation
Each changed area connects to the #44613 objective of consistent account attribution or to its visibility objective. The backend selection change (antigravity-acp-launch-spec.ts, antigravity-host-acp.ts) implements the core requirement, and removal of hasManagedAntigravityChatSignIn and selectionRevision follows from it. chatUsesAgy, the withAntigravityChatBackend wrapper, and the Settings copy implement the visibility requirement. The account-switch path (restartIdleAgyChats, the anyway flag in structured-agent-session-idle-sweep.ts and structured-agent-session-host.ts) keeps idle host-agy chats on the selected account. The childAccountHome orPinned flag supports the stated rule that existing chats stay pinned to their backend. The PR body cites #43375 for the account-switch part, but #43375 is not in the linked issue list. The change is still justified by the #44613 attribution objective, and the PR body states its limits (busy chats and managed chats are not moved). The anyway flag can stop viewed or Never-stop idle chats. This is a wider behavior change, but it is used only by the account-switch path, so it is not a demonstrated unrelated change. Tests (antigravity-host-backend-select.test.ts, structured-agent-session-early-release.test.ts) and i18n strings support the implemented behavior. No change was found that lacks a connection to the linked objectives.
Full details: Description check
Explanation
The description follows the repository template closely. It has an ELI5 section, a What Changed section that covers backend selection, visibility, and the account switch, and a Why section that explains the reversal of the #39006 rule and the deliberate behavior change. It links an issue (Fixes #44613) and gives a Testing section with the two targeted tests and check commands. It includes a Visual Proof section with before and after screenshots for the settings text, the chat backend, and the account switch. The Risk section is not a separate heading, but the Remaining risks / follow-ups section covers what could break, the affected users, and the managed-server boundary. It does not give a rollback plan. The Risk Level, AI Disclosure, Agent skill upstream boundary, and Checklist items are not filled in, and the Testing checkboxes are not ticked. The Linked Issue section uses 'Fixes #44613', which matches the template. The Notes section is not addressed for Security, Cross-platform, Remote SSH, Mobile, or performance, and the description does not state platform coverage beyond macOS.
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.
Files skipped from review as they are similar to previous changes: 1
src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Limit these descriptions to the chats that use agy.
chatUsesAgy describes new chats, not all existing chats. When it is true, existing managed chats still keep their original account. When it is false, existing host agy chats can still be affected by restartIdleAgyChats.
Describe new-chat selection separately from existing host agy chats. Update the matching English catalog entries as well.
… the picked account agree
A saved Orca Chat sign-in no longer keeps new chats off the host's agy. When agy is
signed in and compatible, new chats use agy's account, which Accounts switches and the
usage meter reads, and agy's own (newer) model list. Orca's sign-in remains the fallback
when agy can't serve chats. Settings now says which account new chats use, and switching
agy's account stops idle chats on agy so their next send resumes on the new account.
Fixes#44613
Refs #43375
ACP adapters report no launch account home, so the post-switch sweep never
found a chat running on the host's agy and stopped nothing. Fall back to the
record's pinned home while a child runs.
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Orca can run Antigravity chats two ways: on the
agyyou installed yourself, or on a copy Orca bundles that has its own sign-in. Once you had signed in to Orca's copy even once, Orca kept every new chat on it, even when your ownagywas signed in, newer, and had more models. The usage meter and the account switcher still pointed at your ownagy. So you could chat on account A, watch the meter for account B, switch accounts, and see nothing change. Now new chats use your ownagywhenever it is signed in and can serve chats. Orca's copy is the fallback for when it can't. Settings says which one new chats use, and switching accounts restarts idle chats so they move to the new account.What Changed
Backend selection (
antigravity-acp-launch-spec.ts,antigravity-host-acp.ts): a saved Orca Chat sign-in (acp_token.json, or auth statesignedIn) no longer stops new chats from running on the host'sagy acp. The other conditions stay the same:agy acpprobe passes (≥ 1.5.2, answerssession/list).The now-unused
hasManagedAntigravityChatSignInandselectionRevisionare removed.Visibility (
antigravity-chat-backend.ts,AntigravityAccountsSection.tsx):accounts.antigravity{List,AddCurrent,Select,Remove}gain an optionalchatUsesAgyfield for the host target. The host computes it fromstructuredAgentHostAlternativeReady, waiting at most 1.5 s. Older hosts and WSL omit it.Account switch ([Bug] The AI provider account does not change #43375): after
accounts.antigravitySelecton the host, idle chats whose agent runs on the host's agy are stopped. Their next send resumes on the newly selected account.anywayflag, so viewed or "Never stop" chats are included.agy acpreadiness answer is also cleared, so the next check runs against the new login.Why
hostBackend.selectrefused the host whenever the managed token existed. That rule came from #39006: "existing users of Orca's Chat sign-in are never moved". It left chat, quota and the picked account out of agreement:agy -p /usage) read agy's own account.The UI gave no way to see this or to leave the managed server. Making a signed-in agy the source of truth means the account picker, the quota and new chats are one account. The Settings group already describes Orca's own sign-in as the way "Chat works without agy installed".
Deliberate behavior change: someone who signed in to Orca's Chat with account X while agy holds account Y now gets Y for new chats. Settings now says so. Existing chats stay pinned to the backend they were created on, so managed chats keep Orca's sign-in.
Linked Issue
Fixes #44613
Refs #43375 (STA-12717): idle chats on the host's agy now follow an account switch. Chats on Orca's managed server and busy chats do not; see the remaining risks below.
Testing
antigravity-host-backend-select.test.ts: with a managedacp_token.jsonpresent and the Chat auth statesignedIn,selectreturns agy's home. Without this fix it returnsnull; I checked by reverting.structured-agent-session-early-release.test.ts:releaseIdleSession(id, true)stops a viewed chat's idle agent while "Never stop" is set.pnpm tc:node,pnpm tc:web, oxlint, andpnpm check:changed(40 checks) pass.structured-agent-session-early-release.test.ts: a running ACP-style agent with no adapter-reported home is found through its record's pinned home (the bug fixed in the third commit).Remaining risks / follow-ups
agy acpkeeps its starting login after a keyring switch, and thatsession/resumeunder a different Google account works.agy-acp-serveror by havingagy -p /usageaccept that token.agy-acp-server1.5.0 does not list them. That needs a newer server build from Google, and a pin bump here.Visual Proof
Real dev Orca on this branch (macOS, host
agy1.5.13, signed in). Process checks usedps.a. No managed token: a new Antigravity chat spawns
agy acp --dangerously-skip-permissions, answers "OK", and the picker lists Gemini 4 Carbon / Neon / Argon.(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
b. Dummy managed
acp_token.jsonplanted in the dev profile: the new chat still spawns hostagy acp(noagy_acp_server) and the Orchestrator models show. Running this PR's selection test againstorigin/main's launch spec returnsnull(managed), so main would have used the managed server.(screenshot removed: contained real product data)
c. Settings > AI Provider Accounts > Antigravity: with a personal Chat account type, it says new chats use agy's account. With the Chat account type set to Gemini Enterprise, it says switching does not apply to chats.
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
Non-personal Chat auth stays managed: with Gemini Enterprise, a new chat does not start host
agy acp. It asks to install Orca's copy.(screenshot removed: contained real product data)
d. Account switch path: when triggered (through a temporary seam, since there's no second saved account), the idle chat's
agy acpstopped even though the chat was open. The busy chat, midsleep 40, kept running. The next send to the idle chat started a newagy acp, and the chat resumed with its history.(screenshot removed: contained real product data)
(screenshot removed: contained real product data)