Skip to content

feat(acp): the app follows a host's managed runtime install state, shared by every surface - #29048

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/agy-chat-U1a-install-status
Oct 17, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/agy-chat-U1a-install-status

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​60 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​60
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​379 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​378

ELI5

Antigravity's chat needs a separate program, its chat server, which Orca downloads for it. When chats fetched that program on their own, the first chat sat on "Working for Ns" for about 18 seconds with no progress and no way to cancel, and opening several chats started several downloads. This stack changes that: nothing downloads until the person clicks Install, with progress and Cancel in Settings and in the chat.

The host side already exists below this PR: a host can push whether the program is installed, start an install, and cancel it (#29023, #29024). This PR adds the app side that watches that state: a small shared store that subscribes to the host and keeps the answer current while something on screen shows it. Nothing shows it yet (the row comes in #29049), so nothing changes for anyone when this merges alone.

What Changed

This revision (moving to the common pattern):

  • The app polled the host instead of listening to it. While a surface was shown, the store re-asked the host for status in a loop of waits of up to 25 seconds. That needed extra care to keep hide and show from stacking waits on the host, and a wait could outlive the surface by up to 25 seconds. The store now holds one managedRuntime.subscribe stream (feat(acp): hosts install a managed runtime over RPC, and mark agents whose program Orca provides #29024) per host and agent while anything shows it, and ends it as soon as the last surface hides.

  • A restarted host has to replace the old state even though its revision count starts over. Every subscription is a new generation: the first snapshot of a new subscription always replaces what is shown, and a late frame or Install reply from an older subscription is dropped.

  • Cancel's reply is no longer applied: the stream shows the outcome.

  • Before: the app had no way to know whether the program Orca provides for an agent is installed on a host, or that an install is running there.

  • After:

    • One entry per host, host runtime instance and agent. Every surface that shows that agent's install state (Settings, a chat) reads the same entry, so progress started in one place moves in all of them.
    • While at least one shown surface observes an entry, one subscription follows the host, including when nothing is happening, so an install started from another client or another window shows up. A hidden chat tab does not observe, so restored tabs hold no subscription.
    • Within one subscription, frames are ordered by the host's revision, so an older frame never replaces a newer one. Install's reply is shown at once if it belongs to the current subscription and is newer.
    • A lost subscription, or a first subscribe that fails, retries with backoff from 1 second up to 30 seconds, and at once when a paired host answers again after an outage (its existing "contact restored" event). A failed first read is its own state ("could not check"), never "not installed". Once an answer is known, a later transport blip keeps it on screen instead of flickering.
    • Calls go to the agent's own host, local or remote over SSH or pairing, and need no workspace, so folder workspaces work too. Install and Cancel are pinned to the host runtime instance that answered.
    • What a surface gets back is one of three kinds: inactive (Orca provides nothing for this agent on this host, or the host can't install), pending, or active with the host's answer.
    • pending means "still loading", not "not provided": a host that is reachable right now still owes its capabilities or agent list, and the app asks for the list if nobody has. This keeps a restored Antigravity chat from flashing its message box at startup. A host that is offline or never answered this session, or a list that answered without marking the agent, reads as inactive and keeps today's message box (the host still refuses a send it can't run). Claude and Codex chats are never pending, because no host installs their program.
    • A failed agent-list read reads as a failed status read, so Settings can say "Could not check…" instead of hiding Install.
    • Observed only for agents the host marks as Orca-provided (managedRuntime: true in its agent list), on hosts that advertise managed-runtime.install.v1. Older hosts are never asked: existing behavior.
  • Merged alone: nothing renders this state, so nothing changes for anyone.

Why

The install state changes while a host runs, so it can't live in the host's agent list, which the app learns once per runtime. Subscribing to the host's pushed state is the common pattern and uses the same client mechanism native chat already uses for its own streams, and keying one shared entry per host and agent is what makes "the same button and the same state" in Settings and in the chat hold, across windows and clients.

Linked Issue

N/A (maintainer; part of the stack that adds Antigravity to chat).

Visual Proof

N/A: nothing renders this state yet; the install row comes in #29049.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • One store test with a fake host stream: observing subscribes to managedRuntime.subscribe for that agent; frames are ordered by revision (an older one is dropped); after the stream is lost, the store resubscribes, the restarted host's snapshot at revision 0 replaces the old state, and a late frame from the old stream is ignored.

  • Lint and typecheck: PR CI.

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

Differences from the common pattern

  • Intended: status is keyed by host, host runtime instance and agent, and every subscription is a new generation, so a restarted paired host's first snapshot replaces the old state and a late answer from before the restart is dropped. Orca has several hosts per client and no per-provider instances.
  • Intended: Install's reply is applied to the view when it belongs to the current subscription and is newer, where the common pattern shows only the stream; the clicking window then shows the started install as soon as its call returns, and a reply that crossed a resubscribe can never overwrite a restarted host's state.
  • Intended: a lost subscription resubscribes on its own, with backoff and at once when the host is back, and a failed first read reads "could not check", never "not installed". The common pattern also re-follows on reconnect; the difference is that there is no manual "Retry" button, because nothing needs a click to recover.
  • Intended: a host without install support shows nothing rather than "update this host", because no released host lists a managed agent without that support.

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)
  • 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)

@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from fa72326 to 934f85d Compare October 15, 2026 07:45
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from d4542c3 to 109667c Compare October 15, 2026 07:46
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from 934f85d to f6f5b50 Compare October 15, 2026 08:39
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from 109667c to bd6967d Compare October 15, 2026 08:39
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from f6f5b50 to a56729b Compare October 15, 2026 13:33
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from bd6967d to 3d51bab Compare October 15, 2026 13:34
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from a56729b to 7758a23 Compare October 15, 2026 14:24
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from 3d51bab to 2b28947 Compare October 15, 2026 14:24
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from 7758a23 to b5763f5 Compare October 15, 2026 16:03
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch 2 times, most recently from 0666cf7 to c1c04dd Compare October 15, 2026 16:30
@brennanb2025
brennanb2025 marked this pull request as ready for review October 15, 2026 17:09
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from c1c04dd to c2bf921 Compare October 15, 2026 19:57
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from 004ff8c to feb71c6 Compare October 15, 2026 21:19
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from c2bf921 to 42622b6 Compare October 15, 2026 21:20
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from feb71c6 to eec9773 Compare October 16, 2026 01:33
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from 42622b6 to 18a7191 Compare October 16, 2026 01:33
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from eec9773 to cd79c1c Compare October 16, 2026 03:21
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch 2 times, most recently from 8fcba69 to a84d243 Compare October 16, 2026 03:25
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from cd79c1c to 63769c5 Compare October 16, 2026 03:25
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from a84d243 to e91e7a0 Compare October 16, 2026 03:27
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch 2 times, most recently from 83b6260 to 627be7b Compare October 16, 2026 19:43
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from e91e7a0 to 19d9c6b Compare October 16, 2026 19:43
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from 627be7b to 726eea6 Compare October 16, 2026 22:11
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from 19d9c6b to 553ffc3 Compare October 16, 2026 22:11
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from 726eea6 to db2cd29 Compare October 16, 2026 22:23
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from 553ffc3 to 3c4ad4c Compare October 16, 2026 22:23
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from db2cd29 to fa96870 Compare October 17, 2026 00:43
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from 3c4ad4c to 411572d Compare October 17, 2026 00:43
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/agy-chat-I2-runtime-install-rpc to main October 17, 2026 01:47
…e, shared by every surface

One entry per host runtime instance and agent holds the host's answer. While any shown surface
observes it, one managedRuntime.status long-poll follows the host, idle included, so another
client's install shows up. A failed first read is its own state, never "not installed"; a reply
older than the one shown is dropped. Observed only for agents the host marks as Orca-provided, on
hosts that advertise managed-runtime.install.v1.
…he host is back, and wait for the host's agent list

- Hiding and showing a chat no longer leaves a status wait behind on the host for each cycle: the
  wait is never aborted, and a surface shown again reuses the one in flight.
- The host answering again after an outage retries a failed status read at once.
- While the host's capabilities or agent list are still loading, the install state is pending
  rather than "not provided", so a chat doesn't flash its composer; a failed list read reads as
  a failed status read, so Settings says so instead of hiding Install.
…nstall slot; an offline host or a list without the managed mark keeps the composer
…ion instead of a long-poll

Each host and agent shown on screen holds one managedRuntime.subscribe stream, ended when the last surface hides it. A lost stream resubscribes with backoff, or at once when the host is back; every subscription is a new generation, so a restarted host's snapshot replaces the old state even though its revision count restarted, and a late frame or install reply from a superseded subscription is dropped. Cancel's reply is no longer applied: the stream shows its outcome.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-U1a-install-status branch from 411572d to 25d07d6 Compare October 17, 2026 01:47
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fb36d1eb-8efc-47d9-be54-b8152649bc21
📥 Commits

Reviewing files that changed from the base of the PR and between 634ca45 and 25d07d6.

📒 Files selected for processing: 4
  • src/renderer/src/runtime/host-structured-agents.ts
  • src/renderer/src/runtime/managed-runtime-install-status.test.ts
  • src/renderer/src/runtime/managed-runtime-install-status.ts
  • src/renderer/src/runtime/use-managed-runtime-install.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.

📝 Walkthrough

The renderer adds a managed-runtime installation status store with revision handling, host subscriptions, retries, and install and cancel operations. A new hook returns inactive, pending, or active observations based on capability, reachability, and host agent-list status. Host agent-list reads now expose failure state, and a test checks revision ordering across subscription changes.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 25d07

No issue requiring a fix before merge was established; proceed with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: shared host managed-runtime install state across app surfaces. It is concise and relevant.
Description check Passed The description is complete and closely follows the repository template. It explains the user impact, implementation, rationale, issue context, testing, compatibility considerations, and checklist sta…
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: Description check

Explanation

The description is complete and closely follows the repository template. It explains the user impact, implementation, rationale, issue context, testing, compatibility considerations, and checklist status. It correctly states that visual proof is not applicable because no UI renders this state yet.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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

Comment @coderabbitai help to get the list of available commands.

@brennanb2025
brennanb2025 merged commit 0e599dd into main Oct 17, 2026
31 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/agy-chat-U1a-install-status branch October 17, 2026 02:03
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