Repository navigation
feat(acp): the app follows a host's managed runtime install state, shared by every surface - #29048
Conversation
fa72326 to
934f85d
Compare
d4542c3 to
109667c
Compare
934f85d to
f6f5b50
Compare
109667c to
bd6967d
Compare
f6f5b50 to
a56729b
Compare
bd6967d to
3d51bab
Compare
a56729b to
7758a23
Compare
3d51bab to
2b28947
Compare
7758a23 to
b5763f5
Compare
0666cf7 to
c1c04dd
Compare
c1c04dd to
c2bf921
Compare
004ff8c to
feb71c6
Compare
c2bf921 to
42622b6
Compare
feb71c6 to
eec9773
Compare
42622b6 to
18a7191
Compare
eec9773 to
cd79c1c
Compare
8fcba69 to
a84d243
Compare
cd79c1c to
63769c5
Compare
a84d243 to
e91e7a0
Compare
83b6260 to
627be7b
Compare
e91e7a0 to
19d9c6b
Compare
627be7b to
726eea6
Compare
19d9c6b to
553ffc3
Compare
726eea6 to
db2cd29
Compare
553ffc3 to
3c4ad4c
Compare
db2cd29 to
fa96870
Compare
3c4ad4c to
411572d
Compare
…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.
411572d to
25d07d6
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
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.subscribestream (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:
inactive(Orca provides nothing for this agent on this host, or the host can't install),pending, oractivewith the host's answer.pendingmeans "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 asinactiveand keeps today's message box (the host still refuses a send it can't run). Claude and Codex chats are neverpending, because no host installs their program.managedRuntime: truein its agent list), on hosts that advertisemanaged-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.subscribefor 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
Notes
Differences from the common pattern
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)