Repository navigation
feat(acp): chat agents can run with their own temp folder, cleared when they exit - #28462
Conversation
ac1c23b to
036c13a
Compare
|
A bundled chat server can leave a large extracted copy in system temp when it is force-killed. This rebuilt PR gives an opted-in agent a fresh private folder for each process, sets its temp environment variables, removes that folder best-effort on exit or a cancelled/failed start, and clears earlier leftovers before that agent's first start in each host process. Reviewed commit Validation: 341 ACP tests passed across 41 files under Node. Local static checks passed 22/23; normal typecheck passed, while Electron QA is N/A because the flag has no production consumer. Real bundled-agent runs and native Windows/Linux/SSH execution were not tested here; large-tree first-start latency and Windows delayed-handle cleanup remain unmeasured and should be exercised when an agent enables this path. No merge or rebase was performed. |
326badf to
cb90367
Compare
036c13a to
d9f69b7
Compare
cb90367 to
2c93757
Compare
d9f69b7 to
0b238ba
Compare
2c93757 to
afbbbaf
Compare
0b238ba to
1d09719
Compare
afbbbaf to
101a7d2
Compare
e7e1d04 to
d35f207
Compare
d147816 to
f88b5de
Compare
d35f207 to
37e6a6f
Compare
37e6a6f to
6fefe39
Compare
6fefe39 to
6b936b2
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.
This PR handles a second cost of running that server. Every time it starts, it unpacks itself, about 1 GB, into the computer's temp folder. If the server is killed instead of exiting normally, that copy stays there for good. With this PR an agent can ask Orca for a temp folder of its own for each run, inside Orca's data folder, so Orca can clean up whatever a run leaves behind.
What Changed
privateTempDirectory: true. Then:<Orca data folder>/acp-temp/<agent>/run-XXXXXX(created exclusively, never reused), and the agent's TMPDIR, TEMP and TMP point at it.acp-temp/<agent>folder first, which clears anything a killed process left behind.Why
Clearing the whole folder at host start is safe because Orca talks to these agents over their standard input and output: a process left over from an earlier Orca run can never be reconnected, so nothing can still be using its files. Only one Orca host runs per data folder, and the system temp folder is never touched. One folder per process keeps one run's cleanup from deleting files another run still reads.
The alternative, keeping folders until a reboot could be proven, needs boot-identity records and keeps growing edge cases; this design needs none.
Linked Issue
N/A (maintainer; part of the stack that adds Antigravity to chat).
Visual Proof
N/A: no agent sets the flag 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 through the existing ACP adapter rig: a leftover run folder is cleared at the first start, the child gets an existing
run-*folder as TMPDIR/TEMP/TMP, and that folder is gone after the child exits.pnpm tc:nodeand all 341 ACP tests pass. The real Antigravity server is exercised in the PR that adds it (feat(acp): Antigravity in the Chat UI over its ACP server #28595).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)