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): list agy accounts without reading its keychain login - #51276
Opening Settings → Accounts → Antigravity used to read agy's saved Google login out of the macOS keychain. When macOS wanted to ask "allow Orca to use this item?" or "unlock the keychain", Orca gave up after 3 seconds, so people who were signed in saw "Couldn't load agy accounts". Now the list only looks at the keychain item's label and date, which never asks, and reads the login itself only when you click something that needs it.
Files
Added
Deleted
Net
Test
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$147
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$147
Prod
25
$\color{#1a7f37}{\Huge{\mathbf{+}}}$677
$\color{#cf222e}{\Huge{\mathbf{−}}}$131
$\color{#1a7f37}{\Huge{\mathbf{+}}}$546
What Changed
Before: every time the Antigravity section loaded (and every orca accounts listing, every chat start, every terminal agy launch with a saved account selected) Orca ran security find-generic-password -s gemini -a antigravity -w with a 3 s timeout. Any keychain dialog (access or unlock) timed out, and Deny, Cancel and no-GUI all became "The Antigravity macOS credential store could not be read."
After (macOS keychain):
List reads only the item's attributes (no -w, no dialog). It names the account from Orca's last read of the login while the item is unchanged: the attributes are hashed into a fingerprint, and mdat changes whenever agy rewrites the login. The name is kept in Orca's encrypted account vault so it survives a restart. If agy rewrote the login since, the row says agy is signed in with a Show account button, and no saved account is marked active.
Explicit actions (Show account, Save, Select, Remove, Add account) read the login and wait up to 60 s for the dialog to be answered. Errors now say what happened: "Orca was denied access to agy's login in the keychain. Allow it when asked to show or switch accounts." (Deny/Cancel) or "The keychain didn't answer. Unlock it and try again." (timeout, locked with no dialog).
Terminal agy launches with a selected account skip the read while the cached login is the selected one. Otherwise they read once (60 s). A refused read isn't asked again until agy's login changes.
Chat starts decide from the cache without queueing. When the cache is stale, they put the selected account back with every keychain read and write limited to 3 s, as reads were before. They skip while another account action may be waiting on a dialog. Once a brief attempt fails, chats stop asking until a read that can wait for the dialog succeeds. A chat start never waits on a dialog.
orca accounts uses the same List, and Select and Remove wait 90 s.
The keychain fingerprint only vouches for a read that began after the item's one-second mdat, so a second write in the same second can't be mistaken for the login Orca read.
Linux keyring, Windows Credential Manager, WSL and the token-file store are unchanged: their reads never raise a dialog, so they keep reading the login directly.
Why
The list's job is to show what agy holds, and it was reading the secret to do it on every open, where a dialog can appear and can't be answered in time. #24691 assumed reading agy's keychain item was silent. That holds only while the item's access list trusts /usr/bin/security and the keychain is unlocked. #39006 already added a prompt-free attribute read for chat sign-in checks, but the account list never used it. #48305 made these rows the main Antigravity block, so far more people now hit the error.
Alternatives considered:
A longer timeout on List alone would still raise a dialog every time Settings opens or re-reads.
Throwaway keychain in /tmp (security create-keychain, test item, deleted after): the attribute read is the same on repeated calls, mdat and the hash change on add-generic-password -U, and a missing item exits 44. The real gemini item was never read.
native-account-store.test.ts: on a keychain-style backend, List never reads the login; the name survives a restart through the encrypted vault while the item is unchanged; a rewrite makes it unread; a launch reads once and List names it again; a chat's failed brief read stops chat reads; a launch's refused read isn't repeated under the same revision. Fails on main, where List reads the login.
native-macos-credentials.test.ts: the revision read never passes -w or -g, parses mdat (UTC, whole seconds), and changes with it. Exit-code mapping (51/128 denied, timeout/36 no answer) was checked with an injected process runner and not committed.
Focused tests for antigravity-accounts.test.ts, antigravity-chat-route.test.ts and the agy-home launch tests pass. pnpm check:changed passes.
macOS only, from code and unit tests. Orca wasn't launched and agy's real login was never read.
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
Performance
Fewer keychain subprocesses on every hot path. List, chat starts and launches whose cached login matches each run one attribute read instead of a secret read. An explicit read adds two attribute reads (before and after). The vault is written only when the cached login changes, never from a chat start. Chat starts no longer wait in the account queue behind a read that may be waiting on a dialog. Nothing polls and nothing grows: one in-memory last read per account service.
Risk
The riskiest part is the cache: if it named the wrong account, a terminal launch could skip putting the selected account back. It only vouches when the keychain item's attributes are unchanged since a read that began after the item's last modification second. Any agy refresh changes them, and then Orca reads again on the next launch.
Older clients talking to a newer host get currentAccount with no email for an unread login. They show "agy didn't report an email · not saved", and Save reads the login, so nothing breaks. The vault field is optional: older builds drop it and Orca reads again when asked. A plain revert is safe.
Level: Medium
AI Disclosure
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
Mobile doesn't call the account list. SSH and paired hosts answer List with the same service, so the shape is additive (currentAccount.unread, accounts.antigravityReadCurrent, which clients call only after a host answered unread).
Antigravity account handling now supports quiet keychain revision reads, verified login identity caching, and launch preparation that can avoid prompting. A new RPC and settings action allow the current login to be read when its identity is unread. The account client and CLI use the configured timeouts for account actions.
Merge Risk: Low · up to 35f1c · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(antigravity): list agy accounts without reading its keychain login" matches the main change. On macOS, the account List now reads only keychain attributes and does not read the secret, …
Description check
The description follows the repository template closely. It has ELI5, What Changed (before and after, plus mechanism), Why (with alternatives considered), Linked Issue, Visual Proof with before and af…
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 "fix(antigravity): list agy accounts without reading its keychain login" matches the main change. On macOS, the account List now reads only keychain attributes and does not read the secret, so it no longer triggers keychain dialogs. The title is specific and accurate, though it does not mention the cached-name or explicit-action behavior, which is expected for a short title.
Full details: Description check
Explanation
The description follows the repository template closely. It has ELI5, What Changed (before and after, plus mechanism), Why (with alternatives considered), Linked Issue, Visual Proof with before and after images, Testing with a checklist, Performance, Risk with level and rollback notes, AI Disclosure, and Checklist. The Linked Issue section says there is no GitHub issue, and the template requires one for outside contributors. The Performance section is filled in. The AI Disclosure section is empty. The Agent skill boundary is checked. The Review and Notes sections are partly filled. The lint, typecheck, test, and build checklist item is unchecked, and the author notes CI or local runs will cover it. The Testing section says manual testing was not done, and the checkbox is unchecked. The description is mostly complete, but the missing linked issue and the empty AI Disclosure need attention.
Resolution
Consider the following before merge. Link an actual GitHub issue under Linked Issue, because outside contributors' PRs may be ignored without one. Fill in the AI Disclosure section if an AI model was used. Confirm that pnpm lint, typecheck, test, and build pass, or note that CI will cover them.
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; 4 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Check the brief-access flag before a queued chat restore reads the keychain.
A chat start that is queued before a brief keychain failure still runs its restore after that failure. The restore checks the cached login through settlesLaunch, which does not check briefAccessFailed. When the login is not settled, the restore calls backend.read() and can call backend.write(). Each call waits up to 3 seconds. The prepareForLaunch docstring says a chat start does not read again once a brief read failed. Queued chats after the first failure therefore delay chat starts by up to about 3 seconds per keychain call, and they make keychain calls the documented contract forbids.
Add a check in the queued path, after the settled-login fast path. Under brief access, the check must reject the restore when briefAccessFailed is set. The rejection must use the same error message as the pre-queue check. Keep the fast path and the non-brief path unchanged, so a settled login and a successful explicit read behave as before.
Settings' account list read agy's secret from the macOS keychain on every
open, with a 3 s timeout no keychain dialog can be answered in, so a
signed-in user saw "Couldn't load agy accounts". The list now checks the
keychain item's attributes, which raise no dialog, and names the account
from Orca's last read while the item is unchanged; otherwise it shows agy
as signed in with a Show account button. Explicit actions read the login
with time to answer the dialog and say when access was denied or the
keychain didn't answer. Chat starts no longer read it, and terminal
launches skip the read while the last one still vouches for the selected
account.
Chat starts and listings check the cached login before taking the account
queue, so a Show account or Select waiting on a keychain dialog never holds
them. A chat start whose cache is stale reads agy's login briefly, as it did
before, and stops asking for the session once that read fails; a launch whose
read was refused doesn't ask again until agy's login changes. The keychain
fingerprint only vouches for a read begun after its one-second mdat, and a
saved account is matched to a cached login by its subject.
A chat start that puts the selected account back now gives up early on every keychain read and write in the restore, not only the first read, and skips the one-second fingerprint wait. A later read that may wait on the dialog lets chats try again.
…r didn't answer
A chat-start restore turned down for another reason, such as a sign-in in progress, no longer stops later chats putting the selected account back.
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: 4c5a31f0-6676-4af3-ab57-187f54358426
Commits
Reviewing files that changed from the base of the PR and between 7a82c2c and 774d8a9.
Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 3
src/main/antigravity/native-account-service.ts
src/main/antigravity/native-account-store.test.ts
src/main/antigravity/native-macos-credentials.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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Requi[REDACTED]e the gene[REDACTED]ic f[REDACTED]ilu[REDACTED]e c[REDACTED]se to [REDACTED]eject.
If the w[REDACTED]ite[REDACTED] inco[REDACTED]ectly [REDACTED]esolves with undefined, .c[REDACTED]tch() p[REDACTED]ese[REDACTED]ves th[REDACTED]t v[REDACTED]lue [REDACTED]nd the neg[REDACTED]tive inst[REDACTED]nceof [REDACTED]sse[REDACTED]tion p[REDACTED]sses. Asse[REDACTED]t [REDACTED]ejection [REDACTED]s well [REDACTED]s the e[REDACTED]o[REDACTED] type so this test c[REDACTED]nnot [REDACTED]ccept [REDACTED] successful f[REDACTED]iled-w[REDACTED]ite ope[REDACTED]tion.
const w[REDACTED]ite = w[REDACTED]iteAntig[REDACTED]vityM[REDACTED]cOSC[REDACTED]edenti[REDACTED]l(login)
[REDACTED]w[REDACTED]it expect(w[REDACTED]ite).[REDACTED]ejects.toTh[REDACTED]ow(
'The Antig[REDACTED]vity m[REDACTED]cOS c[REDACTED]edenti[REDACTED]l sto[REDACTED]e could not be upd[REDACTED]ted.'
)
[REDACTED]w[REDACTED]it expect(w[REDACTED]ite).[REDACTED]ejects.not.toBeInst[REDACTED]nceOf(Antig[REDACTED]vityKeych[REDACTED]inAccessE[REDACTED]o[REDACTED])
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Classify a refused write that falls back to creation as keychain access failure.
When the item already exists, add-generic-password -U first tries to update it. Apple's SecurityTool source attempts creation after any failed update, including a denied one. For an existing item with the same account and service, creation can return errSecDuplicateItem (-25299), whose low byte is 45. On that path, the write can exit with code 45 instead of the access-denial code.
accessFailure does not recognize 45. The writer then throws the generic "could not be updated" error, so the keychain refusal may not be recorded as access failure. The brief-access state may then not stop later prompts during chat starts.
Required behavior: a write refused for keychain access must throw AntigravityKeychainAccessError, including when the final exit is 45 after a denied update. Choose the mechanism that preserves the denial, for example by separating the update and create steps or by reading the item state first. Add a write-failure test for exit code 45 that asserts AntigravityKeychainAccessError.
Apple's published source is the current main branch. Confirm the behavior on each supported macOS version before relying on the exact exit mapping.
Pick up stablyai#51276, which also edits the account store. Keep its VerifiedAntigravityLogin helpers and put the stablyai#50266 sealing check on the merged requireProtection.
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
Opening Settings → Accounts → Antigravity used to read agy's saved Google login out of the macOS keychain. When macOS wanted to ask "allow Orca to use this item?" or "unlock the keychain", Orca gave up after 3 seconds, so people who were signed in saw "Couldn't load agy accounts". Now the list only looks at the keychain item's label and date, which never asks, and reads the login itself only when you click something that needs it.
What Changed
Before: every time the Antigravity section loaded (and every
orca accountslisting, every chat start, every terminal agy launch with a saved account selected) Orca ransecurity find-generic-password -s gemini -a antigravity -wwith a 3 s timeout. Any keychain dialog (access or unlock) timed out, and Deny, Cancel and no-GUI all became "The Antigravity macOS credential store could not be read."After (macOS keychain):
-w, no dialog). It names the account from Orca's last read of the login while the item is unchanged: the attributes are hashed into a fingerprint, andmdatchanges whenever agy rewrites the login. The name is kept in Orca's encrypted account vault so it survives a restart. If agy rewrote the login since, the row says agy is signed in with a Show account button, and no saved account is marked active.orca accountsuses the same List, and Select and Remove wait 90 s.The keychain fingerprint only vouches for a read that began after the item's one-second
mdat, so a second write in the same second can't be mistaken for the login Orca read.Linux keyring, Windows Credential Manager, WSL and the token-file store are unchanged: their reads never raise a dialog, so they keep reading the login directly.
Why
The list's job is to show what agy holds, and it was reading the secret to do it on every open, where a dialog can appear and can't be answered in time. #24691 assumed reading agy's keychain item was silent. That holds only while the item's access list trusts
/usr/bin/securityand the keychain is unlocked. #39006 already added a prompt-free attribute read for chat sign-in checks, but the account list never used it. #48305 made these rows the main Antigravity block, so far more people now hit the error.Alternatives considered:
Linked Issue
No GitHub issue. Reported against v1.4.280 on macOS.
Visual Proof
Before: a signed-in user whose keychain read needs a dialog.
After: agy is signed in and the login changed since Orca last read it (two saved accounts, one selected).
After: Show account, then Deny in the keychain dialog.
After: even the attribute read got no answer.
Component fixtures (
pnpm fixtures:shot settings/accounts/providers/AntigravityAgyAccountRows).Testing
Throwaway keychain in
/tmp(security create-keychain, test item, deleted after): the attribute read is the same on repeated calls,mdatand the hash change onadd-generic-password -U, and a missing item exits 44. The realgeminiitem was never read.native-account-store.test.ts: on a keychain-style backend, List never reads the login; the name survives a restart through the encrypted vault while the item is unchanged; a rewrite makes it unread; a launch reads once and List names it again; a chat's failed brief read stops chat reads; a launch's refused read isn't repeated under the same revision. Fails on main, where List reads the login.native-macos-credentials.test.ts: the revision read never passes-wor-g, parsesmdat(UTC, whole seconds), and changes with it. Exit-code mapping (51/128 denied, timeout/36 no answer) was checked with an injected process runner and not committed.Focused tests for
antigravity-accounts.test.ts,antigravity-chat-route.test.tsand the agy-home launch tests pass.pnpm check:changedpasses.macOS only, from code and unit tests. Orca wasn't launched and agy's real login was never read.
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
Performance
Fewer keychain subprocesses on every hot path. List, chat starts and launches whose cached login matches each run one attribute read instead of a secret read. An explicit read adds two attribute reads (before and after). The vault is written only when the cached login changes, never from a chat start. Chat starts no longer wait in the account queue behind a read that may be waiting on a dialog. Nothing polls and nothing grows: one in-memory last read per account service.
Risk
The riskiest part is the cache: if it named the wrong account, a terminal launch could skip putting the selected account back. It only vouches when the keychain item's attributes are unchanged since a read that began after the item's last modification second. Any agy refresh changes them, and then Orca reads again on the next launch.
Older clients talking to a newer host get
currentAccountwith no email for an unread login. They show "agy didn't report an email · not saved", and Save reads the login, so nothing breaks. The vault field is optional: older builds drop it and Orca reads again when asked. A plain revert is safe.Level: Medium
AI Disclosure
Review
Agent skill upstream boundary
Notes
currentAccount.unread,accounts.antigravityReadCurrent, which clients call only after a host answeredunread).switchNative(the readback read) and with fix(antigravity): show an expired agy login, sign in over it, and follow agy's login as it changes #51255 instate()(moved intonative-account-login-view.ts), the account rows and locales. With this change, fix(antigravity): show an expired agy login, sign in over it, and follow agy's login as it changes #51255's keychain watcher re-lists without a dialog. Its expiry flag would need the cached login to carry the token's expiry on macOS.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)