Skip to content

fix(antigravity): stop background agy work for panes and listings that don't need it - #49165

Merged
AmoabaKelvin merged 3 commits into
mainfrom
fix/agy-listing-background-work
Nov 25, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
fix/agy-listing-background-work

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Three pieces of Antigravity code were doing work for people who weren't using Antigravity right then. Startup could launch agy in the background just to refresh its model list. Claude and Codex chat panes were listening for Antigravity sign-in updates. Model lists for other agents waited up to five extra seconds on a check only agy needs. Now each runs only where it's needed.

Files Added Deleted Net
Test 0 0 0 0
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34

What Changed

  • Waiting for a model listing's process to exit: after closing a listing process, the shared model-list runner used to check every 100 ms, for up to 5 s, whether it had exited. Every listing paid this: initialize-only ACP probes, Pi, agy's host check, and listings with nothing to clean up. The wait now lives in discardAcpListingSessions, and only a listing that started a session it has to delete does it. It waits on the process's exit event with one 5 s timer instead of up to 50 polls. agy (and Hermes) still delete a listing's throwaway session only after the process has exited. agy's host compatibility check, the one other caller that needs the exit seen, waits for it the same way (a shared waitForProviderExitUntil). A check that agy answered therefore still passes when the exit arrives just after close.
  • agy model lists at startup: agy's session listing is marked listsOnDemand again. Startup warm-up and Settings warm-up no longer run agy --version, agy acp and a throwaway session. An Antigravity model picker still lists when it asks, and a saved model list still shows straight away.
  • Sign-in listeners in other panes: useAntigravityChatAuthDetection, useAntigravityChatSignIn and the chat auth provider used to subscribe to the global agy sign-in and detection stores even with no host. That covered every Claude and Codex pane. With no host they now subscribe to nothing, so non-Antigravity panes no longer react to agy sign-in updates.

Why

  • Exit wait: feat(antigravity): run every chat on agy, with one sign-in choice and an in-app agy sign-in #48305 added the wait to the shared runner because agy can rewrite its listing session while it exits. Only the code that deletes that session needs the wait, so that's where it now lives. It runs once per listing that has a session, and only when that listing's close came back without a confirmed exit.
  • Warm-up: feat(antigravity): run every chat on agy, with one sign-in choice and an in-app agy sign-in #48305 dropped listsOnDemand because agy now starts quickly. But a listing still opens a session, and a session makes agy read its login: on Linux with a locked keyring that raises an unlock prompt. With the flag dropped, startup could do that for anyone with saved Antigravity state who hadn't opened an Antigravity chat. Hermes uses the same flag for the same reason.
  • Subscriptions: a pane with no host has nothing to receive. Skipping the subscription costs nothing and follows how other renderer stores handle a disabled reader (subscribeToNothing).

Linked Issue

STA-18110, STA-18113, STA-18114. These are follow-ups to #48305.

Visual Proof

N/A: nothing on screen changes. An Antigravity picker still lists models when opened, and other panes look the same.

Testing

  • Counted at N and 10N with throwaway harnesses on the real modules (not committed):

    • Shared runner, listings whose close returns before the exit is confirmed: timers 500 → 0 at N=10 and 5,000 → 0 at N=100. Extra wait 5 s → 0.
    • agy host check whose exit arrives 1 ms after close: answered 10/10 and 100/100 on main and with this change. Without the host-check wait it failed every time (0/10, 0/100).
    • Discard: no timers with no session to delete. One timer per listing with a session, cleared on exit, and every session still deleted (10/10, 100/100).
    • Real Antigravity launch spec through discovery, registration and prewarm: agy listings started by warm-up 10 → 0 and 100 → 0.
    • Mounted Claude/Codex panes subscribed to agy stores: hooks 20 → 0 and 200 → 0; auth provider 10 → 0 and 100 → 0.
  • pnpm check:changed (format, lint, typecheck, dependent tests, ratchets), pnpm tc:node and pnpm tc:web pass. Checked on macOS by reading the code paths; the change has no platform-specific branches.

  • 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

No tests are committed. These are work-count changes, which the counts above prove, and the repo keeps perf contracts out of unit tests.

Performance

Less work in all three places, with nothing added in their place:

  • Runner: no post-close polling for listings with nothing to delete, which were up to 50 timer wakeups each.
  • Startup: no agy process at startup or during Settings warm-up.
  • Renderer: no agy store listener per non-Antigravity pane.

Risk

Level: Low

  • Riskiest part: moving the exit wait. A listing whose process exits slowly still waits up to 5 s before its throwaway session is deleted, so agy can't write it back. Other listings no longer wait. Before feat(antigravity): run every chat on agy, with one sign-in choice and an in-app agy sign-in #48305, agy's host check worked without the extra wait.
  • After the warm-up change: a fresh agy model list arrives when an Antigravity picker asks, not at startup. A saved list still shows straight away.
  • Rollback: a plain revert backs this out.

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

  • Security: no change.
  • Cross-platform: no platform branches. This removes the Linux locked-keyring prompt that warm-up could raise.
  • SSH and paired servers: the catalog and sign-in stores are per host, so the same gates apply to every host.
  • Mobile and older clients: no wire or mobile 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)

…ted work

Only a listing with a session to remove waits for its process to exit, by
exit event instead of 100 ms polls. agy lists models only when an
Antigravity picker asks, so startup and settings warm-up no longer start it.
Panes that follow no Antigravity host no longer subscribe to its sign-in
and detection stores.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Provider discovery now supports bounded waits for provider exit before ACP session cleanup, and the Antigravity runtime probe uses the same exit-wait helper. Antigravity session model discovery is marked on-demand. The catalog probe runner removes exit polling and relies on connection.close(). Renderer sign-in subscriptions now use no-op subscriptions when the relevant host or owner is unavailable.

Merge Risk: Low · up to be46f

Antigravity warm-up and pane subscriptions now do less background work. One narrow gap remains. For listings that do not delete their own sessions, temporary session folders may occasionally be left behind when cleanup runs before the provider finishes exiting.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: it stops background agy (Antigravity) work for panes and listings that do not need it. The raw summary covers this: the exit wait moves out of the shared runner, agy's…
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.
Description check Passed The description is thorough and covers every template section that matters: ELI5, What Changed, Why, Linked Issue (STA-18110, STA-18113, STA-18114, noted as follow-ups to #48305), Visual Proof (N/A wi…
Full details: Title check

Explanation

The title names the main change: it stops background agy (Antigravity) work for panes and listings that do not need it. The raw summary covers this: the exit wait moves out of the shared runner, agy's listing is marked listsOnDemand again, and non-Antigravity panes stop subscribing to agy stores. The title uses the conventional fix(scope) prefix and is one clear sentence, though it is somewhat long at 84 characters.

Full details: Description check

Explanation

The description is thorough and covers every template section that matters: ELI5, What Changed, Why, Linked Issue (STA-18110, STA-18113, STA-18114, noted as follow-ups to #48305), Visual Proof (N/A with reason), Testing with count-based harness results, Performance, Risk with level and rollback, and the checklist. The Linked Issue section uses follow-up issue IDs rather than a 'Fixes #' line, and the AI Disclosure section is empty, but the PR author is a maintainer-style contributor, so these are minor gaps. The test checkboxes are inconsistent: the manual-testing box is unchecked while the automated-tests box is checked with no tests committed, though the author explains why. The PR is mostly complete.

  • 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: 9fff3971-86c2-4391-a42d-2a425ae413a0
Commits

Reviewing files that changed from the base of the PR and between 4e8b78a and be46fc5.

Files selected for processing: 9

  • src/main/acp/discovery/acp-listing-session-discard.ts
  • src/main/acp/discovery/acp-model-catalog-probe.ts
  • src/main/antigravity/antigravity-acp-launch-spec.ts
  • src/main/antigravity/antigravity-acp-runtime-probe.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-probe-runner.ts
  • src/main/provider-process/provider-process-exit-deadline.ts
  • src/renderer/src/components/native-chat/antigravity-auth/native-chat-antigravity-auth.tsx
  • src/renderer/src/components/provider-accounts/use-antigravity-chat-sign-in.ts
  • src/renderer/src/runtime/provider-accounts/sign-in/antigravity-chat-auth-detection.ts
Files with no reviewable changes: 1

  • src/main/native-chat/agent-model-catalog/agent-model-catalog-probe-runner.ts

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

@AmoabaKelvin
AmoabaKelvin merged commit 7056540 into main Nov 25, 2026
54 of 55 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