Skip to content

feat(acp): hosts install a managed runtime over RPC, and mark agents whose program Orca provides - #29024

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/agy-chat-I2-runtime-install-rpc
Oct 17, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/agy-chat-I2-runtime-install-rpc

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​83 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​83
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​178 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​168

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.

#29023 added the installer on the host. This PR lets clients reach it: the desktop app, a paired desktop, or the web client can follow a host's install status, start an install and cancel it, and every client watching sees the same progress. It also marks, in the host's agent list, which agents' programs Orca provides on that host. No agent declares such a program yet, so nothing changes for anyone when this merges alone.

What Changed

This revision (moving to the common pattern):

  • Status was pulled, not pushed. Each watching client re-asked the host for status in a loop that waited up to 25 seconds per request. That was a second, hand-built way of following host state beside Orca's existing push mechanism, the one chat status already streams over, and it needed its own long-poll and call-queue registrations plus a fix for waits left behind on hide and show. Status is now pushed: managedRuntime.subscribe {agent} sends a full snapshot when a client subscribes, then one snapshot per change, and ends when the client unsubscribes or its connection closes. It replaces managedRuntime.status {agent, shown?}, and the long-poll and long-wait lane registrations are gone. Nothing here has shipped, so the same capability covers the new method.

  • Cancel answered at once, before the work had stopped. managedRuntime.cancel now answers with the outcome once the install has unwound: cancelled, or succeeded if the release was already in place (feat(acp): a managed runtime installs only when asked, with progress and cancel #29023).

  • Before: the installer had no way in, and clients could not tell which agents Orca provides a program for.

  • After:

    • managedRuntime.subscribe {agent}: a streaming method on Orca's existing runtime push mechanism. Its cleanup is tied both to the runtime's subscription registry and to the client's own unsubscribe, so hiding and showing a surface in a local window never leaves a listener behind on the host. Reads coalesce: one status read at a time, and several changes during it become one more read. Byte-progress frames reuse the installed facts read at the last phase change instead of re-reading disk and PATH.
    • managedRuntime.install {agent} answers with the new status, and managedRuntime.cancel {agent, operationId} with the outcome. Both need permission host-admin, since they put executable code on the host; subscribing is read-only (workspace).
    • All three act on the host that receives the call, which is the host that runs that agent's chats, local or remote. None needs a workspace. The host keeps one installer per agent for as long as it runs, created on the first call; that first call is also when old versions are cleaned up (feat(acp): a managed runtime installs only when asked, with progress and cancel #29023).
    • Status says whether a start would run a copy found outside Orca (source: 'external'), using the same lookup a start uses with the host's own launch environment and the agent's Command setting, so a copy counts only when a start would really run it. Install is not refused when such a copy exists; once installed, Orca's copy runs first (feat(acp): chat agents can declare a managed runtime that a start runs but never installs #28460), as in the common pattern.
    • Capability managed-runtime.install.v1: a client offers Install only to a host that advertises it, so older hosts keep working unchanged. Not added to the mobile allowlist (there is no phone install UI).
    • agentSession.agents rows gain managedRuntime: true for an agent whose program Orca provides on that host (absent where no release is published, e.g. Windows). Older clients ignore it; older hosts never send it.
  • Merged alone: no agent declares a managed program yet, so nothing changes for anyone.

Why

These are host administration calls, like managedServer.*, so they live in their own namespace rather than the chat-session (agentSession.*) surface, which stays unchanged. Pushing status over the runtime's existing streaming methods is the common pattern and reuses the mechanism Orca already uses for chat status, instead of keeping a second, polled one. Answering every subscriber from one host-owned state is what makes "same button, same state" in Settings and in the chat hold across clients.

Linked Issue

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

Visual Proof

N/A: no agent declares a managed program yet; the button comes in #29049 and the chat placement in #29051.

Testing

  • I manually tested these changes locally

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

  • One test through the real RPC handlers with a fake agent: a subscriber gets a snapshot at once, then the install another client starts; Cancel answers cancelled once the run has unwound and the stream shows it; after the subscriber's connection closes, a later install sends it nothing.

  • 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: the install methods are keyed by agent on the host that receives the call and route by the agent's declared managed runtime, with no list of agent names in the routing code. Orca has one install per agent per host and no per-provider instances.
  • Intended: the installer for an agent is created on the first install-related call, so a host that never offers the agent never reads or cleans its folder. Nothing else needs it earlier, because chat starts read the release folder directly.
  • Intended: subscribing needs workspace permission and Install/Cancel need host-admin permission, because paired phones and desktops have scoped access and Install puts executable code on the host.
  • Intended: hosts advertise a capability for these methods, because Orca clients and hosts update independently.
  • Intended: agent rows carry an optional "Orca provides this program on this host" mark (only where a release is published), so the picker can offer the agent without a detected CLI; older peers ignore it.
  • Intended: after the first snapshot, installed facts are re-read only when an operation's phase changes, not on a timer, so a change made outside Orca (deleting the folder by hand) shows the next time a surface subscribes rather than live. Nothing stores a second copy of those facts, and each subscribe re-derives them.
  • Intended: Install has no "a custom program is configured" refusal. Antigravity ignores the Command setting for chats, so no custom program can be configured for it; an agent that honours that setting would need the refusal.

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-I1-runtime-install branch from b7bc651 to cf54393 Compare October 15, 2026 06:29
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch 3 times, most recently from fa72326 to 934f85d Compare October 15, 2026 07:45
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I1-runtime-install branch from cf54393 to 0f0c56e Compare October 15, 2026 08:39
@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-I1-runtime-install branch from 0f0c56e to c5eb8b2 Compare October 15, 2026 13:33
@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-I1-runtime-install branch from c5eb8b2 to 244b415 Compare October 15, 2026 14:24
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch 2 times, most recently from 7758a23 to b5763f5 Compare October 15, 2026 16:03
@brennanb2025
brennanb2025 marked this pull request as ready for review October 15, 2026 17:08
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I1-runtime-install branch from 0e53d3b to c40df19 Compare October 15, 2026 19:57
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch 2 times, most recently from 004ff8c to feb71c6 Compare October 15, 2026 21:19
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I1-runtime-install branch from c40df19 to d2292f6 Compare October 15, 2026 21:20
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch 2 times, most recently from eec9773 to cd79c1c Compare October 16, 2026 03:21
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I1-runtime-install branch from 0d08ee8 to 739531b Compare October 16, 2026 03:21
@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-I1-runtime-install branch from ad5e7b4 to 9509cb5 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-I2-runtime-install-rpc branch from 627be7b to 726eea6 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 changed the base branch from brennanb2025/agy-chat-I1-runtime-install to main October 17, 2026 00:38
…whose program Orca provides

managedRuntime.status / managedRuntime.install / managedRuntime.cancel, negotiated by
managed-runtime.install.v1, act on the host that receives them, the one that runs the agent's
chats, with no workspace needed. A status read naming the revision it shows is a long-poll on its
own call-queue lane, so every client sees another's start, progress and outcome.
agentSession.agents marks an agent whose program Orca provides on that host.
…-polled, and Cancel answers with the outcome

managedRuntime.subscribe {agent} sends a full snapshot on subscribe, then one
snapshot per install state change, and closes with the transport. It replaces
the managedRuntime.status long-poll and its slot registrations.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-I2-runtime-install-rpc branch from db2cd29 to fa96870 Compare October 17, 2026 00:43
@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: c03bef20-ebee-414a-b720-952fd0ce7c12
📥 Commits

Reviewing files that changed from the base of the PR and between a293324 and fa96870.

⛔ Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing: 13
  • src/main/acp/acp-structured-agent-definitions.ts
  • src/main/native-chat/agent-session-wire/structured-agent-definition.ts
  • src/main/node-runtime/managed-runtime-installation.ts
  • src/main/runtime/revisioned-state.ts
  • src/main/runtime/rpc/methods/index.ts
  • src/main/runtime/rpc/methods/managed-runtime-install.test.ts
  • src/main/runtime/rpc/methods/managed-runtime-install.ts
  • src/main/runtime/rpc/methods/structured-agent-session-agents.ts
  • src/shared/agent-session-registered-agents.ts
  • src/shared/host-operation-ownership.ts
  • src/shared/managed-runtime-install.ts
  • src/shared/protocol-version.ts
  • src/shared/rpc-contract/managed-runtime-install-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.

📝 Walkthrough

The changes identify agents whose programs are provided by Orca and add shared contracts for managed-runtime installation requests. Installation status now supports state-change subscriptions and refreshed or cached reads. Host RPC methods expose status subscriptions, installation, and cancellation, and the RPC manifest includes these methods.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to fa968

This change adds host RPC for managed-runtime status, install, and cancel. No agent declares a managed program yet, so merging it alone does not change user-facing behavior. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 13 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 and concisely describes the main change: host-managed runtime installation over RPC and marking agents whose programs Orca provides.
Description check Passed The description follows the required template and explains the user impact, implementation, rationale, permissions, capability gating, compatibility, remote behavior, testing, and checklist status. It…
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 follows the required template and explains the user impact, implementation, rationale, permissions, capability gating, compatibility, remote behavior, testing, and checklist status. It appropriately marks visual proof as not applicable. Manual testing and local command results are not reported, but CI coverage is identified, so the description is sufficiently complete.

  • 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 634ca45 into main Oct 17, 2026
50 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/agy-chat-I2-runtime-install-rpc branch October 17, 2026 01:47
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