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
feat(mobile): switch a usage-limited Antigravity chat to another saved account from the phone - #51582
When an Antigravity chat runs out of quota, the phone can now move it to another saved Google account, the same way desktop's usage-limit row does. Switching an Antigravity account on the phone's Accounts screen now shows the same confirmation desktop does.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
14
$\color{#1a7f37}{\Huge{\mathbf{+}}}$288
$\color{#cf222e}{\Huge{\mathbf{−}}}$33
$\color{#1a7f37}{\Huge{\mathbf{+}}}$255
What Changed
Builds on #50216, #51498 and #49584 (the Accounts screen sections), all now on main.
Chat usage-limit row (phone)
Before: an Antigravity chat that hit its limit offered only Continue at the reset.
It opens a sheet of that host's saved accounts (accounts.antigravityList), with the account the chat's next message runs on checked. A pick re-reads agentSession.options, then calls accounts.antigravitySelect with { target: { runtime: 'host' }, accountId } on the chat's own client, so a chat on another server switches that server's account.
The sheet lives with the chat rather than the row, so a switch that lets the host continue the chat (which removes the row) still finishes.
Accounts screen: switching an Antigravity account shows the same success toast; a failure uses desktop's title.
Toast: a two-line toast now keeps clear of the screen edges.
Why
#51498 added the desktop menu and noted the phone's menu as a separate PR. A separate host field keeps older phones from offering a switch that dead-ends. Mounting the sheet with the chat (not in the row) is what keeps a switch from being cut off when the chat is freed.
Rendered from the branch's real components on a phone-sized page, iPhone 18 Pro size, dark and light. The host is faked; it answers the list, select and options calls the real host serves.
Usage-limited Antigravity chat with Switch Account:
(screenshot removed: contained real product data)
The sheet (dark / light):
(screenshot removed: contained real product data) (screenshot removed: contained real product data)
After picking an account (dark / light):
(screenshot removed: contained real product data) (screenshot removed: contained real product data)
Accounts screen, before and after a switch, and a refused switch:
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)
Testing
Drove the real phone components (Accounts screen, usage-limit row, sheet, toast) against a fake host in a browser at phone size. Recorded calls: accounts.antigravityList {"runtime":"host"}, then agentSession.options {"sessionId":…}, then accounts.antigravitySelect {"target":{"runtime":"host"},"accountId":"a2"}. The failure path shows the host's message.
Checked that the host's caller scope now lets a phone (including a delegated one) call accounts.antigravityList, accounts.antigravitySelect and accounts.selectData. accounts.antigravityRemove stays refused.
pnpm -C mobile typecheck, pnpm check:changed against the stack base.
I manually tested these changes locally
Automated tests added/updated, or explained why not below: UI and RPC wiring, which the repo's test rules leave to running it.
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because the only new host read (accounts.antigravityList) runs when the sheet opens. The usage-limit row reads the same agentSession.options answer it already fetched.
Risk
The riskiest part is mixed versions. Each case:
Older phone: ignores canSwitchAntigravityAccount and keeps canSwitchAccount, which the host leaves false for Antigravity.
Older host: sends neither the field nor the capability, so the phone shows no button.
Host that lists accounts but refuses a phone: has no capability, so the phone shows no section.
New server relayed through an older Mac: the phone may offer the button and show the Mac's refusal as a failure. Other server-only phone methods behave the same way.
A plain revert backs this out.
Level: Low
AI Disclosure
Review
One review round (Codex and a Claude reviewer). Fixed:
Select now waits 90 s, as desktop does, for a keychain prompt on the host.
The sheet opens at once, and closes when no accounts are left.
The switch toast stays up 4 s.
The "native account changed" note shows only where desktop shows it.
agy's moved login can be picked.
A Codex reset reply keeps the OpenCode/Devin profiles.
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
A phone's select sends no terminal choice, so the host's agy terminals follow its running-sessions setting from #51652.
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
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)
…the phone
The chat's usage-limit row offers Switch Account for Antigravity only when
the host sends canSwitchAntigravityAccount (never canSwitchAccount, which
older phones offer for any agent) and advertises the phone switch. It opens
a sheet of that host's saved accounts; a pick re-checks the chat, calls
accounts.antigravitySelect on the chat's host and shows desktop's toast.
The sheet lives with the chat, so a switch that lets the host continue the
chat still finishes.
Switching on the Accounts screen shows the same toast, and its failure
uses desktop's title.
The change adds Antigravity account switching to mobile account settings and usage-limited chats. The chat account model is exposed when host support and session options allow switching. A new account sheet lists and selects host accounts, and the usage-limit notice can open it. Toasts report switch results. The account schema also permits a missing or null subject.
Merge Risk: Low · up to d2c13
Account switching from a usage-limited chat is gated by host capability checks and works as described. In a rare case, such as a tab closing while the picker is open, the picker could stay visible and act on the previous chat. This is a low-risk follow-up and not a merge blocker.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: letting a phone move a usage-limited Antigravity chat to another saved account. The changeset adds the chat row action, account sheet, host capability gating, and the …
Description check
The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, upstream boundary, Notes, an…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: letting a phone move a usage-limited Antigravity chat to another saved account. The changeset adds the chat row action, account sheet, host capability gating, and the Accounts screen toast, which all match the title's scope. The title uses the conventional feat(mobile) prefix and is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, upstream boundary, Notes, and Checklist sections, and each is filled in with specific, concrete content. The Visual Proof section links before/after screenshots for the chat row, sheet, toast, and Accounts screen. Minor gaps: the Performance line is filled in, but the Risk Level is set to Low with no reasoning beyond the mixed-version list; the AI Disclosure section is empty; and the Linked Issue section cites #50155 without the 'Fixes #' form the template uses. These gaps are non-critical, so the check passes.
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.
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
Bind the account picker to the chat it was opened from.
The picker keeps the account adapter from the chat that opened it. The overlay is not keyed by chat, and the picker's visibility does not depend on the active chat. If the active chat changes while the picker is open, for example after the active tab closes or is reconciled, the picker stays visible over the new chat. A selection then still calls the adapter for the previous chat.
Define the required behavior before changing the code. When the active chat changes while the picker is open, the picker must either close or stop acting on the previous chat. The picker must not select an account for a chat the user is no longer viewing. Keep the intended behavior when only the usage-limit row disappears: the picker still completes its selection.
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
When an Antigravity chat runs out of quota, the phone can now move it to another saved Google account, the same way desktop's usage-limit row does. Switching an Antigravity account on the phone's Accounts screen now shows the same confirmation desktop does.
What Changed
Builds on #50216, #51498 and #49584 (the Accounts screen sections), all now on main.
Chat usage-limit row (phone)
agentSession.optionsanswer hascanSwitchAntigravityAccount(from fix(antigravity): free quota-limited chats when another saved account is selected, and switch it from the chat #51498) and the host advertisesaccounts.phone-provider-switch.v1(from feat(mobile): switch OpenCode, Devin and Antigravity accounts from the Accounts screen #49584). It never usescanSwitchAccountfor this, since older phones show Switch Account for any agent on that field.accounts.antigravityList), with the account the chat's next message runs on checked. A pick re-readsagentSession.options, then callsaccounts.antigravitySelectwith{ target: { runtime: 'host' }, accountId }on the chat's own client, so a chat on another server switches that server's account.Accounts screen: switching an Antigravity account shows the same success toast; a failure uses desktop's title.
Toast: a two-line toast now keeps clear of the screen edges.
Why
#51498 added the desktop menu and noted the phone's menu as a separate PR. A separate host field keeps older phones from offering a switch that dead-ends. Mounting the sheet with the chat (not in the row) is what keeps a switch from being cut off when the chat is freed.
Linked Issue
#50155 (the phone part; #50216 and #51498 cover the host and desktop).
Visual Proof
Rendered from the branch's real components on a phone-sized page, iPhone 18 Pro size, dark and light. The host is faked; it answers the list, select and options calls the real host serves.
Usage-limited Antigravity chat with Switch Account:
(screenshot removed: contained real product data)
The sheet (dark / light):
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
After picking an account (dark / light):
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
Accounts screen, before and after a switch, and a refused switch:
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
Testing
Drove the real phone components (Accounts screen, usage-limit row, sheet, toast) against a fake host in a browser at phone size. Recorded calls:
accounts.antigravityList {"runtime":"host"}, thenagentSession.options {"sessionId":…}, thenaccounts.antigravitySelect {"target":{"runtime":"host"},"accountId":"a2"}. The failure path shows the host's message.Checked that the host's caller scope now lets a phone (including a delegated one) call
accounts.antigravityList,accounts.antigravitySelectandaccounts.selectData.accounts.antigravityRemovestays refused.pnpm -C mobile typecheck,pnpm check:changedagainst the stack base.I manually tested these changes locally
Automated tests added/updated, or explained why not below: UI and RPC wiring, which the repo's test rules leave to running it.
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because the only new host read (
accounts.antigravityList) runs when the sheet opens. The usage-limit row reads the sameagentSession.optionsanswer it already fetched.Risk
The riskiest part is mixed versions. Each case:
canSwitchAntigravityAccountand keepscanSwitchAccount, which the host leaves false for Antigravity.A plain revert backs this out.
Level: Low
AI Disclosure
Review
One review round (Codex and a Claude reviewer). Fixed:
Agent skill upstream boundary
Notes
A phone's select sends no terminal choice, so the host's agy terminals follow its running-sessions setting from #51652.
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)