Repository navigation
feat(acp): chat agents can declare a managed runtime that a start runs but never installs - #28460
Conversation
|
Some chat agents need a program the user has not installed, so their first start currently fails. This PR adds an optional verified copy installed during the existing chat loading state. No agent opts in yet, so current chat behavior is unchanged. Review stopped at round 3 pending Brennan’s decision. I pushed Deferred temporary P2 gap: if a published runtime folder loses its launcher but retains other files, retrying start cannot repair it. A separate approved follow-up will publish repairs beside the damaged version without deleting files a running agent may use. Catalog access to managed copies and duplicate concurrent first downloads remain deferred until a provider needs them. Verified locally on macOS: 929 affected tests before the fix, all 613 chat-agent tests afterward, Node typecheck, changed code quality, and a scratch comparison confirming the Command regression. The diff adds 161 production lines and 93 test lines, within the budgets. Local CI is not green: Node shard 3 failed because the unchanged Electron QA is N/A because no provider uses the option yet. No live Windows, Linux, SSH or real provider start was exercised. No merge, restack, parent-branch edit or lockfile commit occurred. |
|
Some chat agents need a program the user has not installed, so their first start currently fails. This PR adds an optional verified copy installed during the existing chat loading state, before the agent starts. No agent enables the option yet, so current chat behavior is unchanged. Review complete at Fixed: user-installed programs, including the usual fallback folders, now take priority over a managed copy. The regression test failed before this lookup fix and passed afterward. Deferred P2: retrying start cannot repair a nonempty runtime folder that has lost its launcher. The approved follow-up will publish repairs beside the damaged version without deleting files a running agent may use. Catalog access to managed copies and avoiding duplicate concurrent first downloads also remain deferred until a provider needs them. Verified: final source readiness and a dedicated performance pass; prior local results of 929 affected tests before the fix, all 613 chat-agent tests afterward, Node typecheck, and changed-code quality. CI now passes static analysis/typecheck, all five Node test shards, relay integration, both package checks, repository guards, line count and aggregate verification. The earlier transcript-watch-liveness timeout passed on rerun. Local Electron QA and screenshots are N/A because no provider uses the option yet. No live Windows, Linux, SSH, mobile or real provider start was exercised. No code change, push, restack, parent/child branch edit, lockfile commit or merge occurred during this resume. The PR remains unmerged. |
326badf to
cb90367
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/main/node-runtime/pinned-runtime-materializer.ts: 1
141-148: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOnly chmod members in the staging folder, not in the published folder.
verifyMembersrunschmod(path, 0o755)on every member. The rename fallback at Line 156 also callsverifyMembers(folder), so it changes the permissions of a folder that another start already published. That folder may be in use. On POSIX, the extracted members already have mode bits, and the first publisher sets them before rename. Move thechmodstep out ofverifyMembersand run it only onextractedDir.♻️ Proposed fix
const verifyMembers = async (root: string): Promise<void> => { for (const member of runtime.members) { const path = join(root, ...member.path.split('/')) await verifyFileSha256(path, member.sha256, `${runtime.label} ${member.path}`) - if (process.platform !== 'win32') { - await chmod(path, 0o755) - } } } try { const extractedDir = await downloadAndExtract(runtime, paths, temporaryDir, options) await verifyMembers(extractedDir) + if (process.platform !== 'win32') { + for (const member of runtime.members) { + await chmod(join(extractedDir, ...member.path.split('/')), 0o755) + } + }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
346c448f-bbda-4987-b8d4-25babfc19e51
📒 Files selected for processing: 10
src/main/acp/acp-launch-specs.tssrc/main/acp/acp-structured-acquire.tssrc/main/acp/acp-structured-launch-preparation.tssrc/main/acp/acp-structured-launch-resolution.tssrc/main/acp/acp-structured-managed-runtime.test.tssrc/main/acp/acp-structured-session-adapter-deps.tssrc/main/node-runtime/pinned-runtime-materializer-folder.test.tssrc/main/node-runtime/pinned-runtime-materializer.tssrc/main/node-runtime/runtime-archive-download.tssrc/main/runtime/structured-agent-runtime-registrations.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
QA: first Antigravity chat start on a fresh profile (managed server download)Built from First chat (server not installed yet)
On screen: Second chat (same profile, already installed): no download (no staging folder appeared). The server spawned at send, showed The ~17 s first start splits roughly in half: ~8.6 s to download, unzip and verify, then ~8.9 s from server spawn to its sign-in answer (vs 3.9 s on the second start, so part of that is a first-run cost of the freshly installed server). Notes:
|
cb90367 to
2c93757
Compare
afbbbaf to
101a7d2
Compare
… but never installs A start resolves PATH and the agent's install folders first, then the newest whole release under Orca's data folder (its completion receipt and member sizes checked); with none it refuses with runtimeNotInstalled instead of downloading.
…nd point a not-installed chat at the chat itself A transient read error (EIO, EMFILE) no longer counts a working release as incomplete; only definite absence or a mismatch does. The not-installed refusal no longer sends a remote chat's user to this computer's Settings.
d147816 to
f88b5de
Compare
…, and a copy elsewhere only beside every file it needs





ELI5
Antigravity's chat needs a separate program, its chat server, which Orca downloads for it (100–330 MB). 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, which shows progress and a Cancel button in Settings and in the chat itself, and the chat can't be used until the program is installed.
This PR is the first piece. An agent can now declare a program that Orca keeps for it. Starting a chat runs an installed copy if there is one, but never downloads. With no copy, the start is refused with a clear message.
What Changed
managedRuntime(label,root(dataDirectory),pin()): where Orca keeps the agent's releases on this host, and which release this host should have (version, download URL, archive SHA-256, and each file's SHA-256 and size). The type has no download method, so no launch path can install..install-complete.json, written before the folder is moved into place) naming the release, its platform and architecture, and each file's size. Each file must exist, be a regular file of that size, and be executable (the executable check is skipped on Windows). Full hashes are only taken by the installer (feat(acp): a managed runtime installs only when asked, with progress and cancel #29023).runtimeNotInstalled: "{agent} isn't installed on the computer running this chat. Install it from the chat in a current version of Orca." It uses the existing refusal fields, so older apps show the same text. All 6 languages.Why
Downloading inside the launch path is the one fact behind the silent download, the duplicate downloads, the missing progress and cancel, and a damaged folder that nothing could repair. Removing the download from the launch API itself (not just from one caller) means no chat start, sign-in, settings read or model probe can trigger it.
The receipt check replaces "the folder exists" because a folder can lose a file after it was published. Hashing hundreds of megabytes on every launch would be too slow, so the size, type and executable check is the cheap middle ground.
The refusal text points at the chat, not at this computer's Settings, because a chat on a paired host needs the program installed on that host, and an older app that shows only this text still needs to know where to go.
Linked Issue
N/A (maintainer; part of the stack that adds Antigravity to chat).
Visual Proof
N/A: no agent declares a managed runtime yet, so nothing visible changes in this PR.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
One test drives a real adapter start through the real launch resolver: nothing installed → refused with
runtimeNotInstalled; a lone server file in the agent's install folder → still refused; a complete release → spawns it, even with a complete copy in the install folder; that release damaged → the complete install-folder copy runs.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)