mirror of
https://github.com/stablyai/orca.git
synced 2026-10-24 08:03:58 +00:00
`config/scripts/rebuild-native-deps.test.mjs` fails on `package (windows)` with
EPERM from the `finally` of "rebuilds a loadable ConPTY native that lacks Orca
job ownership". Every assertion in that test had already passed; the throw is
the cleanup. The test's whole job is to build and load a ConPTY native, and on
Windows a freshly dlopen'd DLL keeps a handle on the directory it came from for
a moment after the child exits — so `rmSync(projectDir, { recursive: true,
force: true })`, which is `maxRetries: 0`, loses the race.
The repo already knows this: `WINDOWS_RM_MAX_RETRIES = 8` in
`src/main/host-tree-removal.ts` and again in `codex-accounts/service.ts`. Only
product code was using it.
Adds `src/shared/windows-transient-lock-removal.ts` as one home for the policy
and moves all 21 raw recursive removals in the Windows CI lane onto it, plus a
boundary test that reads the lane's spec list out of `.github/workflows/pr.yml`
so a new spec cannot hand-roll the removal and reintroduce this.
Census, since the pattern is not confined to that lane: 1,633 recursive
removals across 1,028 files pass no `maxRetries` — 1,368 in tests and fixtures,
265 in product code. Only the Windows lane's 21 are changed here.