Skip to content

Keep Antigravity's full model list when agy models comes back short - #47341

Merged
AmethystLiang merged 1 commit into
mainfrom
agentint-46905-agy-model-refresh
Nov 24, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
agentint-46905-agy-model-refresh

Conversation

@orca-remote-automation

@orca-remote-automation orca-remote-automation Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Antigravity's model picker gets its list by running agy models. Sometimes that command answers with an old, short list even though your account has the new models, and Orca showed that short list. Now, while Orca runs, a short answer can't push out models a chat or an earlier listing showed, Orca asks again 5 minutes later, and there is a Refresh button next to the model search.

Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​442 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​442
Prod 33 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​393 $\color{#cf222e}{\Huge{\mathbf{−}}}$​52 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​341

What Changed

  • Before: after a chat listed Gemini 4 Neon/Argon/Hydrogen and Claude Opus/Sonnet 5.5, one degraded agy models run (Gemini 3.8 Flash, Sonnet 4.6, Opus 4.6, GPT-OSS) replaced the whole list, and the bot and new-chat pickers stayed on it. The picker had no way to ask again.
  • After:
    • For Antigravity, each catalog keeps in memory the rows that chats and probes listed in this Orca process, the newest copy of each. A probe at least as long as that set replaces it. A shorter probe adds its rows (new models and new labels show up) and keeps the others, and the next picker read 5 minutes later lists again. A chat's listing adds its rows. Of two writes in the same millisecond, the later one counts as newer, so an equally long probe replaces what a chat showed; that ordering never moves the 5-minute retry, which follows the clock.
    • Nothing new is saved: a restart starts over from what main already saves.
    • A failed run (Error: Eligibility check failed) never replaced the list, and still doesn't.
    • Selecting another agy account on the host in Orca drops the rows of the host agy catalog and marks it due, so the next read lists the new account. A first listing still running under the previous account is dropped when it finishes. Where agy keeps its login in the system keyring (macOS, Linux desktops), and the launch environment does too, the catalog under the HOME chats launch with (login shell or agent settings) is reset as well, once that HOME is known; the switch itself never waits for it. Catalogs of Orca's own homes (Gemini API key, managed server) and of homes with their own credential file keep their rows and freshness. Re-selecting the active account does nothing; a WSL distro's account switch neither reads extra nor touches catalogs.
    • The Antigravity model search row has a Refresh button. It re-reads the picker's own catalog with relist: true, as a read that waits for the listing: the host resolves the catalog that read belongs to, clears any failure hold on it, lists it again (a listing already running stands), and the open picker shows what that listing found. Enter or Space on the focused button refreshes; it never picks the highlighted model. Other catalogs and their listings are untouched. A read that was still running when you clicked can't answer for the Refresh. The icon spins at least 400ms.

Mechanism: keepsRicherAgentModelListing(agent) (Antigravity only) gates agent-model-catalog-seen-rows.ts. seenAgentModelRows updates an entry's in-memory seen rows on each write (the entry factory in agent-model-catalog-entry-lifetime.ts), and withSeenRows appends the seen rows the listings lack. seen.relistAfter makes agentModelCatalogEntryIsStale true 5 minutes after a short probe. Persistence writes only the listings, so seen is never saved. store.forgetSeenRows(antigravityHostCatalogFingerprints()) runs from accounts.antigravitySelect when the host's active account changed; Antigravity catalogs are keyed by account home, so only the host agy catalog is touched. For Refresh, ModelCatalogParams takes relist, sent only to hosts that advertise agent-session.model-catalog.relist.v1; it rides the read to the catalog refresh, which calls store.relistScope(fingerprint) once its scope is resolved.

Why

Holding what this process saw, and letting only an equally long probe replace it, fixes the cause: one bad run used to replace the list. New rows a short run lists are real, so they are accepted. Earlier rounds of this PR also saved carried rows across restarts and followed agy account changes made outside Orca; each round found new edges in that machinery, so this version drops both and keeps the fix in memory. Other options:

  • Never caching probe results: the cold picker would wait on agy every time.
  • Trusting only chat listings: bots and new chats start before any chat exists.
  • Refresh through preflight.refreshAgents: it expires every agent's catalog on the host, aborts other agents' listings, and on Windows can go to the WSL host while the picker reads the native one. The flag on the picker's own read avoids all three, and is capability-gated because older hosts refuse unknown keys.

Reconciled with open #45588 (superseded, touches launch/server files, not the catalog store) and #46309 (sidebar labels from agent hooks). No overlapping files.

Linked Issue

Fixes #46905
Refs #46288: this keeps each account home's catalog separate, so the managed server's listing never merges into the host agy catalog.

Visual Proof

From a seeded component fixture (agent/AgentLaunchPicker:dropdownAntigravityRefresh). No real account is involved. Before: the same card with no Refresh button.

Dark Light
dark light

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

agent-model-catalog-degraded-listing.test.ts feeds fake agy models output through parseAgyModelListing into AgentModelCatalogStore:

  • a short probe adds to what this process's chats listed, and a probe as long replaces it (union);
  • a short probe never replaces a longer one from this process, takes its newer labels, and lists again at exactly 5 minutes;
  • selecting another account drops only the host login's seen rows and marks only that catalog due; other homes stay fresh;
  • an equally long probe in the same millisecond as a chat listing replaces it (displayed ids and labels);
  • a short probe lists again 5 minutes later by the clock, also after the clock stepped back;
  • a first probe still running when the account changes saves nothing of the previous account's;
  • a Refresh lists its own catalog past a failure hold (also one with no saved entry) and leaves a sibling Antigravity listing running and the chat revision unchanged.

antigravity-accounts.test.ts runs the real select handler: a host switch makes the host agy catalog due and leaves Orca's home fresh; a WSL switch reads the distro's login only twice (no extra lookup); a switch lists again a catalog under a launch HOME sharing the login, not one with its own file. agent-launch-picker-acquisition.test.ts: a Refresh of a settled catalog shows what the listing it started found. AgentPickerRefreshModelsButton.test.tsx (happy-dom, real AgentLaunchSetupPanel): Enter on the focused Refresh button refreshes instead of using the highlighted current model.

Each fails with its fix reverted. pnpm check:changed passes (format, lint, typecheck, related tests, ratchets, localization). Tested on macOS. The one DOM test covers a keyboard-capture regression, not a button-does-X check; the fixture screenshot is the visual proof.

Performance

None in steady state, because:

  • Discovery still runs only on demand. The 5-minute re-list happens only on the next picker read past that time, after a short probe. There is no timer or polling.
  • Selecting a host agy account adds no credential read and never waits on the launch environment: it resolves in the background, bounded to 1 second, and only then resets the launch HOME's catalog.
  • Refresh runs only when the user clicks it, and lists only the catalog that picker read resolves to.
  • The seen rows are about 25 per Antigravity catalog, merged when a listing is written, not per render, and held in memory only. Nothing new is written to disk; the schema is unchanged.

Risk

Level: Low

  • Antigravity only (seen rows, Refresh button). The relist param is generic but only the Antigravity picker sends it.
  • An agy account change made outside Orca (agy login in a terminal) is not seen: the picker can show the previous account's extra models until Refresh lists a probe at least as long, or Orca restarts. Picking one of those fails visibly when the chat starts; nothing else is affected.
  • A model the account really lost stays listed while this Orca runs, unless a probe at least as long replaces the set; restart clears it.
  • After a restart, the first short probe shows only what it lists until a chat or a fuller probe runs, as before this PR.
  • If the launch environment takes over 1 second or can't be read, an account switch resets only Orca's own home catalogs; a launch HOME set by a login shell or the agent's settings then keeps the previous account's extra models until Refresh or restart. Picking one fails visibly when the chat starts.
  • Back out with a plain revert; nothing is saved.

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

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Remote hosts: the catalog rules run on whichever host owns the catalog. Refresh goes to the host the picker reads from. Older paired hosts don't advertise the relist capability, so Refresh there only reads again.
  • Windows: Refresh follows the picker's own catalog read, so it never goes to WSL preflight while the picker reads the native catalog.
  • Mobile: no change.

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)

@orca-remote-automation

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@orca-remote-automation
orca-remote-automation Bot force-pushed the agentint-46905-agy-model-refresh branch 9 times, most recently from e29986d to 861b567 Compare November 24, 2026 02:48
@orca-remote-automation
orca-remote-automation Bot force-pushed the agentint-46905-agy-model-refresh branch from 861b567 to cc529f7 Compare November 24, 2026 02:54
@AmethystLiang
AmethystLiang merged commit 4313354 into main Nov 24, 2026
57 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.

[Bug]: Antigravity bot model picker stays stuck on degraded agy models list and does not sync with live agy acp session models

1 participant