Repository navigation
feat(acp): a reclamation primitive removes all but the kept managed runtime release - #28507
Conversation
|
Old releases and abandoned downloads would accumulate in Orca's private copies of agent servers, wasting disk space. This PR removes those entries when Orca's chat service starts, while preserving the pinned release and this process's downloads. Deletion runs in the background; failures are logged and chats continue. No agent uses this private-copy support yet, so this PR changes no visible behavior today. No code fixes were needed. Two intended limits remain under the approved scope: cleanup waits for the chat service to start, and a reused process ID can temporarily preserve an older download with the same ID until a later start uses a different process ID. These are accepted limitations; no additional fixes are pending. Verified: independent correctness and architecture reviews; final readiness with no proven P0/P1/P2 findings, including a separate performance review; the focused tests (2 files / 3 tests); changed-code quality, changed-file lint and whitespace checks. CI passed, including typecheck, all five test shards, relay integration, and both packaging checks (run). Not exercised: the real managed agent, Windows locked-file behavior, live SSH/Linux hosts, or a large old-version backlog. Electron QA and screenshots are N/A because no agent opts in. The branch is unchanged; no merge or main sync was performed. |
036c13a to
d9f69b7
Compare
43ecec5 to
b2c75e1
Compare
d9f69b7 to
0b238ba
Compare
b2c75e1 to
4709a1c
Compare
0b238ba to
1d09719
Compare
4709a1c to
9503d1b
Compare
1d09719 to
e7e1d04
Compare
9503d1b to
e50c315
Compare
e7e1d04 to
d35f207
Compare
e50c315 to
b63c823
Compare
d35f207 to
37e6a6f
Compare
b63c823 to
fe9ee28
Compare
37e6a6f to
6fefe39
Compare
fe9ee28 to
2bf27e3
Compare
…untime release The installer calls it while it owns the runtime's installs and launches; it answers the entries it could not remove so that caller can report them. Nothing calls it from adapter construction.
2bf27e3 to
ad5633d
Compare
6fefe39 to
6b936b2
Compare
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.
Orca keeps its own copy of that program (#28460). When Orca pins a newer version and the person updates, the old copy (100–330 MB) would stay on disk forever. This PR adds the one function that deletes old copies. Nothing calls it yet: the installer in #29023 calls it once, while it alone controls installs, so a cleanup can never delete a copy that is being published or that a chat is using.
What Changed
reclaimRuntimeReleases(root, keep)removes every entry under the agent's release folder except the release namedkeep(everything whenkeepis null), including leftover download folders. It returns the entries it could not remove so the caller can report them. If the folder itself can't be listed (for any reason other than not existing), it rejects, again for the caller to report.Why
Whoever deletes must be the same owner that publishes. Running cleanup from chat setup (the alternative) has no such ownership: it could race an Update that is publishing the new version, and it would delete the person's working older copy whenever Orca's pin moved, so "Update" could never show. The installer in #29023 runs this function itself, before any install, and passes the release a chat would run today as
keep.Linked Issue
N/A (maintainer; part of the stack that adds Antigravity to chat).
Visual Proof
N/A: no caller yet, so nothing changes for anyone in this PR.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
One test: with the kept release, an older release and a leftover download folder, only the kept release remains.
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)