Skip to content

Let Antigravity Chat Change account start a fresh sign-in - #37998

Merged
brennanb2025 merged 20 commits into
mainfrom
brennanb2025/chat-account-follow-1103
Nov 18, 2026
Merged

brennanb2025 merged 20 commits into
mainfrom
brennanb2025/chat-account-follow-1103

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Antigravity Chat’s Change account button can reuse the saved login immediately, so users never get a chance to choose an account. Change account now starts fresh Google authentication in a separate home, verifies the saved replacement in a second process, and replaces the working credential only after both processes have exited. Cancelling or failing keeps the old login and conversation history.

Settings > Accounts now shows the two Antigravity sign-ins as two cards, each with its own title outside the card, following the existing settings card pattern. "Antigravity Chat" holds the browser sign-in for Chat: Sign in with, Account (with Change account) and Runtime. "agy in the terminal" holds the saved agy logins, a hint for adding another account, and Refresh accounts, which only refreshes that list. Card descriptions replace the old info tooltips.

Ordinary Sign in retains its saved-login behavior. Personal and Gemini Enterprise credentials remain separate. Retry follows the operation accepted by the host, including after Settings reopens or a connection rejoins. A capability check preserves the request shape accepted by older hosts.

The current main branch has been merged once. Its saved-credential verification and launched-runtime identity remain intact. The review repair requires observed process exit, rather than treating kill delivery as exit, and reports credential-validation or credential-saving failures with actionable wording.

Tracked in STA-13466 and STA-11235. Supersedes the account-replacement work in #37439; thanks to @darkspock for the original investigation and implementation. The commits retain Co-authored-by: darkspock <extjmv@gmail.com>.

Validation: the code went through four review passes by independent Claude and Codex reviewers. The last pass reviewed the settings regrouping and found no correctness or performance issue; its localization and search findings are fixed in 2da564d. Current main is merged. Its new main-process blocking-helper ratchet flagged the old synchronous credential rename, so promotion is now an async rename. While the token moves, no other phase change (cancel, expiry or a failed callback forward) can relabel the flow, and success publishes the moment the rename lands; a fifth, focused Codex review caught and confirmed that race. remote-check passes 39 of 39 on the final commit. A new renderer test checks that Change account on a signed-in host requests an account replacement. The host tests already cover the rest: promotion happens only after the replacement is verified, for both auth methods, and the working login is kept on cancel, on an unusable credential and on a missing credential. Real native Antigravity QA on the earlier head passed:

  • saved sign-in and a fresh, isolated replacement waiting flow
  • cancellation with the token unchanged
  • Settings reopen and renderer reload
  • retry and cancel
  • separate Enterprise forms
  • the old chat continuing after a graceful restart

The common provider-settings pattern reruns authentication in the same home for Change account, so a cached credential can satisfy it. That is the bug this PR fixes, which is why the isolated replacement home stays. Accepted gap: no real end-to-end replacement with a second Google account (no second account available); the tests above cover that path instead.

Screenshot of the new layout (component fixture with stubbed host state): two cards, Antigravity Chat above agy in the terminal.

Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​231 $\color{#cf222e}{\Huge{\mathbf{−}}}$​24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​207
Prod 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​445 $\color{#cf222e}{\Huge{\mathbf{−}}}$​174 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​271

Co-authored-by: darkspock <extjmv@gmail.com>
@brennanb2025
brennanb2025 marked this pull request as ready for review November 4, 2026 01:23
@coderabbitai

coderabbitai Bot commented Nov 4, 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 sign-in flow now carries a signIn or changeAccount intent through RPC requests and published state. Account replacement uses a staged home and validates and commits the replacement token before publishing signed-in status. The renderer tracks start receipts and runtime IDs when reconciling host state. The settings UI separates Chat and terminal account groups, with updated labels and terminal account guidance.

Merge Risk: Low · previous review a2ebe

The account-replacement flow keeps the old credential until the new one is verified, and error messages for a missing credential are now specific. One narrow renderer race remains: if the host is unknown when sign-in starts and the runtime changes, a late response can briefly show a stale sign-in status and retry action. The risk is low and can be fixed in follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main behavior change: Change account for Antigravity Chat now starts a fresh sign-in instead of reusing the saved login. The changeset implements this through the changeAccount int…
Description check Passed The description follows the template's main sections. It explains the change, the before and after behavior, the mechanism (isolated home, second-process verification, promotion after both processes e…
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.
Full details: Title check

Explanation

The title names the main behavior change: Change account for Antigravity Chat now starts a fresh sign-in instead of reusing the saved login. The changeset implements this through the changeAccount intent, a separate isolated home, and deferred credential promotion, so the title matches the main change.

Full details: Description check

Explanation

The description follows the template's main sections. It explains the change, the before and after behavior, the mechanism (isolated home, second-process verification, promotion after both processes exit), and the testing done, including native QA on an earlier head. It also states the accepted gap (no real second-account replacement). Several template sections are missing or incomplete: the ELI5 section, the 'Fixes #' issue link (it cites STA-13466 and STA-11235 instead of a linked issue), the Visual Proof section (only a fixture description, with no BEFORE/AFTER media), the Risk level, and the checklist items. The Review, Agent skill boundary, and AI Disclosure sections are also not filled in. Most of the required content is present, so the check passes, but these gaps should be closed before merge.

Resolution

Add an ELI5 summary. Replace the tracker references with a linked issue in the 'Fixes #' line if the project requires one. Attach BEFORE and AFTER visuals for the Settings regrouping and the Change account flow, or explain why they are not possible. Set the Risk level (the change touches credential promotion, so Medium or High is likely) and state how to back it out. Complete the Review and Agent skill boundary checkboxes, and tick the checklist items that apply.

  • 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: 5769419d-612e-477f-8ac7-2042ee6477db
Commits

Reviewing files that changed from the base of the PR and between 2da564d and a2ebe73.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 7

  • src/main/antigravity/antigravity-chat-sign-in.ts
  • src/main/antigravity/antigravity-sign-in-home.ts
  • src/renderer/src/components/provider-accounts/AntigravityChatSignInAction.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/remote-runtime/protocol/account-runtime-capabilities.ts
Files with no reviewable changes: 3

  • src/renderer/src/components/provider-accounts/AntigravityChatSignInAction.tsx
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.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; 4 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: 1

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: 325bc903-0431-49c8-998f-42142ba85732
Commits

Reviewing files that changed from the base of the PR and between 9c7fe97 and e8b4837.

Files selected for processing: 3
  • src/main/antigravity/antigravity-chat-sign-in.test.ts
  • src/main/antigravity/antigravity-chat-sign-in.ts
  • src/main/antigravity/antigravity-sign-in-failure.ts

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

brennanb2025 and others added 3 commits November 16, 2026 03:36
Preserve saved-login verification and both authentication methods while promoting only a verified replacement credential. Tracked in STA-13466 and STA-11235.

Co-authored-by: darkspock <extjmv@gmail.com>

@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: 1

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: 01221681-3600-4aeb-984e-fe1918a79341
Commits

Reviewing files that changed from the base of the PR and between 61036d6 and 1c60ee3.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 16

  • config/main-sync-fs-baseline.txt
  • src/main/antigravity/antigravity-chat-account.ts
  • src/main/antigravity/antigravity-chat-sign-in.test.ts
  • src/main/antigravity/antigravity-chat-sign-in.ts
  • src/main/antigravity/antigravity-sign-in-home.ts
  • src/main/runtime/rpc/methods/accounts/antigravity-accounts.ts
  • src/renderer/src/components/provider-accounts/AntigravityChatAuthForm.test.tsx
  • src/renderer/src/components/provider-accounts/use-antigravity-chat-sign-in.ts
  • src/renderer/src/runtime/provider-accounts/sign-in/antigravity-chat-sign-in-status.ts
  • src/renderer/src/runtime/provider-accounts/sign-in/runtime-antigravity-accounts-client.ts
  • src/renderer/src/runtime/rpc/calls/runtime-rpc-call.ts
  • src/renderer/src/runtime/rpc/subscriptions/runtime-rpc-subscribe.ts
  • src/renderer/src/runtime/runtime-antigravity-accounts-client.test.ts
  • src/shared/agent-accounts/antigravity/antigravity-account-types.ts
  • src/shared/remote-runtime/protocol/account-runtime-capabilities.ts
  • src/shared/rpc-contract/accounts/antigravity-accounts-params.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.

@brennanb2025
brennanb2025 marked this pull request as draft November 18, 2026 04:36
@brennanb2025
brennanb2025 marked this pull request as ready for review November 18, 2026 05:38
# Conflicts:
#	src/main/antigravity/antigravity-chat-sign-in.ts
@brennanb2025
brennanb2025 marked this pull request as draft November 18, 2026 09:09
@brennanb2025
brennanb2025 marked this pull request as ready for review November 18, 2026 21:05
@brennanb2025
brennanb2025 merged commit 2bc54f7 into main Nov 18, 2026
60 of 61 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/chat-account-follow-1103 branch November 18, 2026 21:36
nwparker added a commit that referenced this pull request Nov 20, 2026
Main now requires a sign-in intent (#37998); the chooser and a switch to
Google sign-in start a plain sign-in.
nwparker added a commit that referenced this pull request Nov 20, 2026
Main now requires a sign-in intent (#37998); the chooser and a switch to
Google sign-in start a plain sign-in.
nwparker added a commit that referenced this pull request Nov 20, 2026
…r them in Chat (#44965)

* feat(antigravity): detect a host's API key and gcloud login, and offer them in Chat

Antigravity chats now find a Gemini API key, gcloud ADC and a saved Google
sign-in on the chat's host, rank them in the signed-out strip as one-click
switches, offer them when sign-in or a turn fails for want of a subscription
or with 401/403/quota, and show the method in use as a footer chip.

A saved Google token now reads as signed in after a restart (STA-15489).

* fix(antigravity): address review of Chat sign-in detection

Re-read detection before a switch so the restart confirm sees chats that
started since mount, refresh it on every sign-in revision, report each Google
method's saved sign-in, keep a saved project and location across switches,
start only Google sign-in when the method is unknown, and match only Google's
auth words for the refused offer.

* fix(antigravity): confirm before sign-in stops chats, and keep detection cheap

Google sign-in from the chooser goes through the same live-chat confirm as a
switch, and a failed detection read keeps the last answer and asks instead of
applying. Detection re-reads once per sign-in revision and reads the cached
shell environment, never a new login shell. The saved-sign-in seed waits for a
running flow.

* fix(antigravity): confirm when the re-read fails, and name the project gcloud keeps

A failed forced re-read can't rule out chats started since mount, so the
switch asks. A one-click gcloud switch keeps a saved project (never
Enterprise's), and detection names that same project. Detection reads the
same shell capture chats launch from, so a profile-exported key is seen
right after start.

* fix(antigravity): start Chat's Google sign-in with the sign-in intent

Main now requires a sign-in intent (#37998); the chooser and a switch to
Google sign-in start a plain sign-in.

* chore(antigravity): keep the transcript notice row under the line limit

The usage-limit row renders Antigravity's sign-in offer itself, and the
notice row passes only its block.

* fix(antigravity): show Chat's sign-in choices once a model listing finds it signed out

The listing session is often the first to reach a signed-out managed server,
but only a chat's own connection answered the host's sign-in state, so the
chooser waited for a failed send. The listing now answers it too.

* fix(native-chat): show one Sign in while Antigravity's sign-in strip is up

The strip already offers Google sign-in, so the failed message's row reads
plain instead of adding a second Sign in button.

* fix(antigravity): don't offer a Gemini key again after it was rejected

Once a chat moved off the API key that Google rejected, that failure row kept
offering to switch back to the same key. A rejected-key failure is now history
on any other method, as Google-only failures already were.
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