Skip to content

feat(acp): a reclamation primitive removes all but the kept managed runtime release - #28507

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/agy-chat-4-runtime-reclaim
Oct 16, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/agy-chat-4-runtime-reclaim

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15

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

  • Before: nothing ever removed an old release of a program Orca provides.
  • After: reclaimRuntimeReleases(root, keep) removes every entry under the agent's release folder except the release named keep (everything when keep is 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.
  • Merged alone: no caller, so nothing changes for anyone.

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

  • 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: older downloaded releases and leftover download folders are removed (once per host process, when the install service is first used and before any install, keeping exactly the release a chat start would run), instead of being kept until the person removes the whole runtime; each release is several hundred MB to over 1 GB, and nothing else ever cleans them up.

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

Copy link
Copy Markdown
Contributor Author

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.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from 036c13a to d9f69b7 Compare October 14, 2026 17:32
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from 43ecec5 to b2c75e1 Compare October 14, 2026 17:32
@brennanb2025
brennanb2025 marked this pull request as ready for review October 14, 2026 17:54
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from d9f69b7 to 0b238ba Compare October 15, 2026 06:11
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from b2c75e1 to 4709a1c Compare October 15, 2026 06:11
@brennanb2025
brennanb2025 marked this pull request as draft October 15, 2026 06:11
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from 0b238ba to 1d09719 Compare October 15, 2026 06:13
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from 4709a1c to 9503d1b Compare October 15, 2026 06:13
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from 1d09719 to e7e1d04 Compare October 15, 2026 06:18
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from 9503d1b to e50c315 Compare October 15, 2026 06:18
@brennanb2025 brennanb2025 changed the title feat(acp): old managed runtime versions are removed at host start feat(acp): a reclamation primitive removes all but the kept managed runtime release Oct 15, 2026
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from e7e1d04 to d35f207 Compare October 15, 2026 13:33
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from e50c315 to b63c823 Compare October 15, 2026 13:33
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from d35f207 to 37e6a6f Compare October 15, 2026 14:24
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from b63c823 to fe9ee28 Compare October 15, 2026 14:24
@brennanb2025
brennanb2025 marked this pull request as ready for review October 15, 2026 17:08
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from 37e6a6f to 6fefe39 Compare October 15, 2026 19:57
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from fe9ee28 to 2bf27e3 Compare October 15, 2026 19:57
…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.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-4-runtime-reclaim branch from 2bf27e3 to ad5633d Compare October 15, 2026 21:19
@brennanb2025
brennanb2025 force-pushed the brennanb2025/agy-chat-3-private-temp branch from 6fefe39 to 6b936b2 Compare October 15, 2026 21:20
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/agy-chat-3-private-temp to main October 16, 2026 01:13
@brennanb2025
brennanb2025 merged commit 48d080e into main Oct 16, 2026
113 of 152 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/agy-chat-4-runtime-reclaim branch October 16, 2026 01:14
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