Skip to content

fix(antigravity): switch saved accounts at once and move each chat at its next message - #50216

Merged
AmoabaKelvin merged 7 commits into
mainfrom
fix/antigravity-chats-follow-account-switch
Nov 28, 2026
Merged

AmoabaKelvin merged 7 commits into
mainfrom
fix/antigravity-chats-follow-account-switch

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

agy (Antigravity's CLI) keeps one Google login on the machine. Selecting another saved account in Orca now swaps that login straight away, so new chats use it at once. A chat that is in the middle of a turn finishes that turn on the old account and says so, then moves to the new account with your next message. Its history stays.

Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​524 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​523
Prod 53 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1350 $\color{#cf222e}{\Huge{\mathbf{−}}}$​190 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1160

What Changed

Before: selecting another saved account wrote agy's login, then stopped only the chats that were idle at that moment. Chats that were busy or starting kept their old agy acp and the old account indefinitely. Bot Home Chats were hit most, because they are often busy. Nothing recorded which account a chat had run on.

After:

  • Instant switch. accounts.antigravitySelect writes agy's login right away, as before. New chats launch on it at once.
  • Every chat moves. Each agy acp launch records the saved account its login was actually put on, as child.accountKey. That is the account the launch's preparation found or restored, not just the selection. If the selection changes between preparation and spawn, the login is prepared once more right before the spawn. Launches that don't use agy's Google login (API key, gcloud) record none. Orca's existing "launched under another account" check now compares that key when the home can't tell accounts apart, which is the case for agy. The same retirement Claude's account switch uses then handles agy:
    • Idle chats stop now.
    • A busy chat finishes its turn, and the next send's handover starts it on the new account (agy session/resume, same home, history kept).
    • This covers bot chats and orchestration workers, which are ordinary sessions on the same host.
  • A busy chat says so. A quiet line appears in that chat, in the same faint style as Claude's "switched models" line: "Finishing this turn on old@x. Your next message uses new@y." Each running agent has one such line. Switching again revises it, and switching back to the account the turn runs on removes it. Older clients, including phones, print the same sentence as plain text.
  • A failed move says so, once. When a launch can't put agy's login on the selected account (for example, the keychain would have to ask), the chat records the account it really runs on and shows "Couldn't move this chat to new@y: {reason}". Orca then holds chats where they are for that selection, so nothing relaunches in a loop. Restores happen only where they already did, off the send path: chat launches, listings, the exit-time restore and the switch itself. Each of those that finds agy's login on the selected account lifts the hold, and every held chat moves at its next send. A send only compares in-memory state, with no reads. Selecting another account lifts it too.
    • Which account a failed launch "really runs on" comes only from fresh evidence that raised no dialog: a no-prompt read made then, or what that restore read itself before it wrote anything. Otherwise it is recorded as unknown, never as the host's default login.
    • A launch on another home or credential store than the host's own reads a login no saved account names. That includes another session bus on Linux, which is another Secret Service. Orca decides this first, before anything about saved accounts. Such a launch records no saved account, so no switch ever retires it, it never holds the host's selection, and it never delays putting the selected login back when old-account agy processes exit.
    • Windows puts no account back at launch, but reading agy's login there raises no dialog, so each launch on the host's own home and store reads who holds it. A login on another account records that account and shows the note.
  • The account survives a restart. record.launchedAccount gains an optional accountId. Older builds ignore it. The stacked usage-limit PR uses it.
  • Write-back healing. An old-account agy that refreshes its token can write the old login back. The selected account is now put back:
    • before every chat launch (as main already did);
    • before every model listing and Enterprise/Orca-home Google launch (newly added);
    • once more when the last agy Orca started on a previous account exits (new). This one runs unasked, so it never reads a login that only a keychain dialog could name; it leaves that case to the next launch.
      All of these use fix(antigravity): list agy accounts without reading its keychain login #51276's capped, latch-guarded reads, so none can raise a keychain dialog.
  • Sign-in exclusion. A select is refused while an in-app sign-in is writing agy's login.
  • Toasts. "Switched to {{account}}" (with "New chats use it now. Chats running a turn switch at their next message."), or "Antigravity account update failed." with the reason.

#50155: this PR is the account switch itself. The stacked PR (usage-limit release and the in-chat "Switch account" menu) completes the issue.

Why

Antigravity's saved accounts swap one login inside one home, so Orca's home comparison never saw a switch. The fix records which saved account each launch used and reuses the existing retirement path.

Kelvin chose instant switching over waiting for running turns, and agy behaves in a way that allows it. A running agy keeps its token in memory, so a busy turn finishes on its own account. Anything it writes back on refresh is undone at the next launch, listing, or exit. Persisting accountId means the account a chat ran on is still known after Orca restarts.

Linked Issue

#50155

Visual Proof

The line in a chat still running a turn when the account switched (light / dark):

account switch light
account switch dark

Selecting an account (light / dark):

switched light
switched dark

A select that can't run (light / dark):

failed light
failed dark

A chat that couldn't start on the selected account (light / dark):

not moved light
not moved dark

All shots are from component fixtures: NativeChatNoticeRow:accountSwitch, NativeChatNoticeRow:accountNotMoved and AntigravityAccountSwitchToast.

Testing

  • 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

  • structured-agent-session-account-switch.test.ts (real host rig):

    • An idle agent on another saved account in the same home is stopped, and one on the selected account is kept.
    • The next send's handover starts it on the new account.
    • A busy chat keeps its agent and gets one account-switch line, revised in place on a second switch and removed when the selection returns to its account.
  • agy-account-selection.test.ts:

    • Only a change of the selected account is announced, and only the latest change stays committed.
    • A launch reads the vault before recording an account.
    • The selected login is put back once the last agy on a previous account exits (including one that started on another account than selected), and not when an agy on the selected account exits.
    • A launch that couldn't move to the selection says so once and stops chats retiring for it, until a later launch reaches it or another account is selected.
  • acp-launch-account-current.test.ts: a login prepared for a selection replaced before the spawn is prepared once more; one prepared for the current selection is kept, failure included.

  • native-account-launch-holder.test.ts:

    • A failed restore names the account it found holding agy's login before it wrote anything.
    • A restore whose write landed but whose readback failed names nobody.
    • Where reading raises no dialog (Windows), who holds the login is read directly.
    • A launch on another home or credential store records no saved account (foreign), never the host's login.
  • agy-launch-credential-authority.test.ts:

    • The same home in another spelling is the host's: a trailing slash, a symlink, or a case-only difference on macOS and Windows. A different home, or a removed HOME, is foreign.
    • The same session bus in another spelling is the host's: guid in any position, doubled or trailing slashes, percent-escapes, the default runtime-folder bus. An address it can't read never makes a launch foreign. Another bus, or another ; fallback list, is foreign.
    • Buses are compared only when both the launch and the host use the keyring rather than agy's token file.
    • A launch elsewhere is classified as foreign before Orca reads the selection, even with none selected.
  • agy-account-selection.test.ts: an agy whose login no saved account names never delays putting the selected login back.

  • structured-agent-session-account-switch.test.ts: a chat held back by a failed move stays on its account at every send, and moves at the first send after agy's login is known to hold the selected one.

  • native-account-quiet-restore.test.ts: the exit-time restore never reads agy's login when its keychain item changed since Orca last read it.

  • agent-session-owner-proof.test.ts: the saved account a launch ran on is recorded in the home it ran in (or the home it moved to), and it reads back through the record validator.

  • pnpm check:changed passes.

  • Not run against a real agy login: per repo rules, nothing here touches the real keychain.

Performance

  • Per send: one synchronous comparison of the child's account key during the handover.
  • Per agy launch: one vault read, only the first time after Orca starts (an encrypted file; no keychain).
  • On a switch: one pass over loaded sessions to release idle chats, plus one journal row per chat that is still busy (revised or removed in place on later switches).
  • On a failed restore: one no-prompt read to name the login agy holds, and one journal row in the chat that launched.
  • On each agy process exit: a check over the agy processes Orca started.
  • Listings: each now runs the selected-account restore before it starts. That restore is a no-prompt fingerprint read that settles at once when nothing moved.
  • Nothing polls.

Risk

Level: Medium

  • Riskiest part: listings now restore the selected account before they start, where before only chats did. If the selected account doesn't match agy's login and exactly one other saved account does, a listing now switches agy back to the selected account, as a chat launch already would.
  • launchedAccount on agy chats: agy chats now record launchedAccount, which they never did before, so usage-limit attribution reads it for them too. It names the same home as before, so homes compare equal.
  • Backing out: a plain revert. The optional accountId field left in records is ignored.

AI Disclosure

Review

One round, Codex and a Claude reviewer. Fixed:

  • Windows never noted the selected account, so chats there didn't move. The selection is now tracked on every platform.
  • A select landing between a launch's start and its spawn could stamp the chat with the new account while agy ran on the old login. The account is now read as the process spawns.
  • The exit-time restore could read agy's login through the keychain when its item had changed. It now skips that case.
  • Listings didn't restore the selected account for host chats. They do now.
  • A busy-chat line could reuse an earlier line's id after a restart. Its id now includes the chat's fence.
  • The very first selection (no previous account) wrote a line naming an empty account. It now writes none.
  • API-key and gcloud chats were stamped with a saved account they don't use. They record none now.
  • The success toast's "running chats switch" line showed for WSL accounts, whose chats this doesn't move. It now shows only for host accounts.

A final Codex check found two more, both fixed:

  • A launch was stamped with the selection at spawn, not the login it got. A switch during an Orca-home launch's preparation, or a failed restore, left a chat recorded on the new account while it ran on the old one, so it never moved. Launches now record the account their preparation verified, and re-prepare once if the selection moved before the spawn. A failed restore records the account the login really holds, shows the chat why, and latches so the chat isn't relaunched for nothing.
  • Switching A→B→A during a running turn left the "next message uses B" line. Each running agent now has one line that follows the selection and goes away when it returns.

A focused Codex check of those fixes found no P0/P1 and no restart loop, and four P2s, all fixed:

  • A held-back chat never recovered on its own next message. It now moves at its next send once a launch, listing, restore or the switch finds agy's login on the selected account.
  • Windows recorded the selection without checking agy's login. It now reads who holds it.
  • On backends without no-prompt reads (Linux), a restore whose write landed but whose readback failed was recorded on the old account. Holder evidence is now dropped before any write, and only fresh evidence names a holder.
  • A launch on another home or credential store was recorded on the host's login. It now records no saved account, and no switch retires it. Windows makes the same check before reading the login.

A Codex check of that redesign found no P0/P1 (a send's check stays memory-only) and three P2s, fixed by making the "is this launch foreign?" decision once, first, and using it everywhere:

  • The check ran after the no-selection early return, so a foreign chat recorded the empty account and was retired when the first account was selected. It now runs first.
  • A foreign chat's process still counted as an old-account agy and delayed putting the selected login back. It no longer counts.
  • On Linux, a launch on another session bus (another Secret Service) counted as the host's store. It is now foreign.

A further Codex check found the foreign test too eager in three places, which matters because a normal launch called foreign quietly stops following switches. A launch is now foreign only when the difference is provable:

  • Session bus addresses are parsed as D-Bus address lists and compared canonically: guid dropped, unix:path normalized, ; fallbacks kept in order. An unreadable address counts as the same bus.
  • Homes are compared by real path, case-folded on macOS and Windows. Where a real path can't be read, only a clearly different spelling counts.
  • File-or-keyring storage uses the same full decision as the credential backend (containers included), and buses are compared only when both sides use the keyring.

A first version of the held-chat recovery restored agy's login inside a send. A Codex check showed two P1s in it: an other-home chat restarted at every send, and sends could wait on account work with no overall deadline. It was replaced by the in-memory check above.

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

  • Platforms:
  • Remote: a remote host runs all of this itself.
  • Mobile: the account-switch line renders on mobile too, and older phones print its text.
  • Folder workspaces: unaffected.

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 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The changes add launch-account identity tracking and coordinate Antigravity account switches with active chats and other processes. The runtime exposes switch progress and failure details, and the settings UI refreshes while a switch is active. Session account keys are carried through acquisition and publication for account comparisons. The CLI polls for switch completion and reports progress or failure.

Merge Risk: Moderate · up to c2e04

Account switching for Antigravity chats has several open concerns. A stuck process shutdown can block new chats. A partial credential write can leave stale login state. The CLI can report success for an account that was never selected. Some settings controls can stay locked. These should be resolved or explicitly accepted before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the two main behaviors of the PR: switching saved Antigravity accounts at once, and moving each chat to the new account at its next message. It matches the changeset, which adds an ins…
Description check Passed The description is detailed and covers most required sections. The ELI5, What Changed, Why, Linked Issue (#50155), Visual Proof (screenshots for light and dark themes), Testing, Performance, Risk (Lev…
Full details: Title check

Explanation

The title names the two main behaviors of the PR: switching saved Antigravity accounts at once, and moving each chat to the new account at its next message. It matches the changeset, which adds an instant account select, records a per-launch account key, and retires or hands over chats. The title is in conventional-commit form and is 86 characters, slightly long but readable.

Full details: Description check

Explanation

The description is detailed and covers most required sections. The ELI5, What Changed, Why, Linked Issue (#50155), Visual Proof (screenshots for light and dark themes), Testing, Performance, Risk (Level: Medium, with a backout plan), Review, and Notes are all filled in. The Performance section gives a concrete reasoned answer. The checklist is mostly completed. The required items that are missing or incomplete are: the Linked Issue is cited as #50155 but the author notes the stacked PR completes the issue, which is acceptable; the AI Disclosure section is empty (it is only required for non-StablyAI team members, so the author's status is unclear); the Testing section leaves the manual-testing checkbox unchecked and the 'pnpm lint, typecheck, test, build' checklist item unchecked, so it is unclear whether these checks were run; and the Review section is included but the Agent skill upstream boundary item is checked. The description is mostly complete, so the check passes, with the minor gaps noted below.

  • 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: f32e76e2-ce84-48f8-b50e-d84f42acc729
Commits

Reviewing files that changed from the base of the PR and between 88e4d57 and c2e04f4.

Files selected for processing: 1

  • src/renderer/src/components/settings/accounts/providers/AntigravityAgyAccountRows.fixture.tsx

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

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: 5b8d27a4-39d6-45e1-8a62-da5f0871440a
Commits

Reviewing files that changed from the base of the PR and between 37b8239 and f60897a.

Files selected for processing: 33

  • src/cli/accounts/account-list-format.ts
  • src/main/acp/launch/acp-launch-contract.ts
  • src/main/acp/launch/acp-launch-gate.ts
  • src/main/acp/session/acp-structured-session-adapter.ts
  • src/main/acp/session/start/acp-structured-start.ts
  • src/main/antigravity/agy-account-switch.test.ts
  • src/main/antigravity/agy-account-switch.ts
  • src/main/antigravity/agy-login-revision.ts
  • src/main/antigravity/antigravity-acp-launch-spec.ts
  • src/main/antigravity/antigravity-chat-sign-in.ts
  • src/main/antigravity/native-account-service.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-acquisition.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-flow.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-orchestration.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-publish.ts
  • src/main/native-chat/agent-session-wire/delivery/structured-agent-session-outgrown-retirement.ts
  • src/main/native-chat/agent-session-wire/host/structured-agent-session-account-switch.ts
  • src/main/native-chat/agent-session-wire/host/structured-agent-session-host-types.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-account-switch.test.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-queued-message-rig-provider.test-fixture.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter-router.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter.ts
  • src/main/native-chat/agent-session-wire/recovery/structured-agent-session-outgrown-child.ts
  • src/main/providers/accounts/provider-account-services.ts
  • src/main/runtime/rpc/methods/accounts/agy-login-change.ts
  • src/main/runtime/rpc/methods/accounts/antigravity-accounts.test.ts
  • src/main/runtime/rpc/methods/accounts/antigravity-accounts.ts
  • src/main/runtime/rpc/methods/accounts/antigravity-chat-backend.ts
  • src/renderer/src/components/settings/accounts/providers/AntigravityAccountsSection.tsx
  • src/renderer/src/components/settings/accounts/providers/AntigravityAgyAccountRows.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/shared/agent-accounts/antigravity/antigravity-account-types.ts

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

Comment thread src/main/acp/launch/acp-launch-gate.ts Resolved
}
answered = true
done.catch(() => {})
const rows = await service.listAccounts()

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.

Minor · Stability & Availability · Quick win

Do not make the early progress reply wait behind the credential write.

The reply timer can fire while selectAccount() is in its serialized section. listAccounts() and selectAccount() both run through AntigravityAccountService.serialize(), and that helper chains each operation after the previous one. The second service.listAccounts() call on the early reply path therefore waits for the in-flight credential write. This delays the reply past the 5-second reply budget.

Keep the full account state from the initial read near line 100, and use it for the early progress reply. The early reply then no longer waits for serialize(). It returns the account rows read before the switch started, with the switching progress. Keep returning the final rows when done settles first.

Suggested fix

-    const active = (await service.listAccounts()).activeAccountId
+    const current = await service.listAccounts()
+    const active = current.activeAccountId
-    const rows = await service.listAccounts()
     if (this.switching === progress) {
-      this.rows = rows
+      this.rows = current
     }
-    return this.withProgress(rows)
+    return this.withProgress(current)

handler: async ({ intent }, ctx) => {
const owner = signInOwner(ctx)
// A switch waiting for chats would write its account over this sign-in's.
if (AGY_HOST_ACCOUNT_SWITCH.running()) {

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.

Minor · Stability & Availability · Quick win

Re-check the account switch immediately before starting the sign-in.

The changeAccount path awaits account-store work after the AGY_HOST_ACCOUNT_SWITCH.running() check at line 186. An account switch can start during those awaits. The handler then starts sign-in at line 197 without another check. startAntigravityChatSignIn and runFlow do not check the switch either. The sign-in agy process can therefore start while the switch drains chats. This breaks the sign-in and switch serialization. The switch can then fail its pre-write check.

Move the check so that no await separates it from startAntigravityChatSignIn. The synchronous start then runs without interleaving.

Suggested fix

+      // Re-check after the awaits above: a switch can start while they run.
+      if (AGY_HOST_ACCOUNT_SWITCH.running()) {
+        throw new Error('Antigravity is switching accounts. Sign in after it finishes.')
+      }
       return startAntigravityChatSignIn(agySignInHost(ctx.runtime), owner, intent)

@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch from f60897a to 0c9b8cf Compare November 27, 2026 01:58

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 5

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: 4f6ff3c4-11c5-4eba-b4da-4a7a48c7cfc7
Commits

Reviewing files that changed from the base of the PR and between f60897a and 0c9b8cf.

Files selected for processing: 19

  • src/cli/accounts/account-selection.ts
  • src/cli/accounts/antigravity-account-select.ts
  • src/main/acp/launch/acp-launch-gate.ts
  • src/main/acp/session/start/acp-structured-start.ts
  • src/main/antigravity/agy-account-switch.test.ts
  • src/main/antigravity/agy-account-switch.ts
  • src/main/antigravity/antigravity-acp-runtime-probe.ts
  • src/main/antigravity/antigravity-chat-account.ts
  • src/main/antigravity/antigravity-chat-sign-in.ts
  • src/main/antigravity/antigravity-host-acp.ts
  • src/main/runtime/rpc/methods/accounts/agy-login-change.ts
  • src/main/runtime/rpc/methods/accounts/antigravity-accounts.ts
  • src/renderer/src/components/native-chat/antigravity-auth/NativeChatAntigravityAuth.fixture.tsx
  • src/renderer/src/components/provider-accounts/use-antigravity-chat-sign-in.ts
  • src/renderer/src/components/settings/accounts/providers/AntigravityAccountsSection.tsx
  • src/renderer/src/components/settings/accounts/providers/AntigravityAgyAccountRows.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/runtime/provider-accounts/sign-in/antigravity-chat-sign-in-status.ts
  • src/shared/agent-accounts/antigravity/antigravity-account-types.ts
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; 7 remain after this review.

return apply()
}
const progress = { accountId, waitingForChats: 0 }
this.switching = progress

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.

Minor · Performance & Scalability · Quick win

Cache the initial account rows before publishing the switch.

While the switch waits for its early reply, this.rows remains null. An accounts.antigravityList request then bypasses waitingRows() and calls service.listAccounts(), which reads the native credentials again.

Keep the full result from Line 113 and assign it to this.rows before publishing progress. Clear it when the switch ends, as the code already does. This also covers reads before the early reply; the previous early-reply correction does not cover that interval.

state={state}
// The pushed progress shows while the select that started it is still answering.
state={
state && signIn.accountSwitch ? { ...state, switching: signIn.accountSwitch } : state

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.

Minor · Functional Correctness · Quick win

Apply host switch progress only to host account rows.

For a WSL target, signIn.accountSwitch still describes the host. This assignment puts that progress into the distro's account state. AntigravityAgyAccountRows then disables Save, Select and Remove until the unrelated host switch ends. Passing no signInControls does not prevent this assignment.

Gate this overlay and the progress reread key with chats. Host rows will retain progress, and WSL rows will retain their own account state.

@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch from 0c9b8cf to 4f5011a Compare November 27, 2026 08:03

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

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: 81a65034-1633-4416-878e-29d5ae897891
Commits

Reviewing files that changed from the base of the PR and between 0c9b8cf and 4f5011a.

Files selected for processing: 14

  • src/cli/accounts/antigravity-account-select.ts
  • src/main/acp/launch/acp-launch-gate.ts
  • src/main/acp/session/acp-structured-session-adapter.ts
  • src/main/acp/session/start/acp-structured-start.ts
  • src/main/antigravity/agy-account-switch.test.ts
  • src/main/antigravity/antigravity-acp-launch-spec.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-acquisition.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-orchestration.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-queued-message-rig-provider.test-fixture.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter-account.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter.ts
  • src/main/runtime/rpc/methods/accounts/antigravity-accounts.ts
  • src/renderer/src/components/settings/accounts/providers/AntigravityAccountsSection.tsx
  • src/renderer/src/i18n/locales/en.json
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; 9 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch 5 times, most recently from 0422a73 to f34c485 Compare November 27, 2026 11:23
@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch from f34c485 to 45dc43c Compare November 28, 2026 04:33
@AmoabaKelvin AmoabaKelvin changed the title fix(antigravity): move every open chat to the newly selected account, after running turns finish fix(antigravity): switch saved accounts at once and move each chat at its next message Nov 28, 2026
@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch from 2435688 to d0253d8 Compare November 28, 2026 07:21
@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch 2 times, most recently from 6dcb769 to 78f8e0e Compare November 28, 2026 08:32
@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch 4 times, most recently from ca5e07d to c355b7b Compare November 28, 2026 10:19
…y host, and heal agy's login without keychain prompts
…on, keep failed moves from relaunching, and revise one switch note per chat
… cached evidence, and other-authority launches stay foreign
@AmoabaKelvin
AmoabaKelvin force-pushed the fix/antigravity-chats-follow-account-switch branch from c355b7b to f0d8b89 Compare November 28, 2026 10:43
@AmoabaKelvin
AmoabaKelvin merged commit 5d7416c into main Nov 28, 2026
66 checks passed
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.

1 participant