You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
On Windows most daemon test rigs wait on a real PowerShell ACL read at every daemon start #1932
`startDaemon` builds `PowerShellDirectoryAccessReader` when `options.directoryAccess` is not passed (`src/daemon/main.ts:233-234`). On win32, `prepareDataDirectory` (`src/daemon/connection-host.ts:70`) awaits its `read`, a `powershell.exe` run with a 10 s limit (`src/ports/directory-access.ts:22`), before the daemon serves. `src/daemon/test-main.ts:48-49` passes a `FakeDirectoryAccessReader` for this reason ("on Windows the real reader would start PowerShell for every test daemon"); `src/daemon/gateway-fleet.e2e.test.ts` and `src/daemon/main-agent-device.test.ts` do too.
These rigs and files call `startDaemon` without it (`grep -L directoryAccess` over the files that call `startDaemon(`), among them:
`src/daemon/main-update.test.ts`, `src/daemon/optional-modules-start.test.ts`, `src/daemon/main-stop.test.ts`, `src/daemon/main.test.ts`, `src/daemon/gateway-modules.test.ts`, `src/agent-device/local-profile.test.ts`, and the `*.e2e.test.ts` files under `src/daemon/`
Each of their daemon starts on the Windows unit job waits on PowerShell. Two of them have open 20 s timeout issues on that job: #1913 (`main-update.test.ts`) and #1914 (`optional-modules-start.test.ts`). The agent-device worker rig (`src/agent-device/test-support.ts`) is #1912 and is not part of this issue.
Confirmed, and wider than listed: 67 starts in 24 files, including startGateway in src/daemon/test-main.ts:199 (its start passes a fake), main-leasing.test.ts, main-state-db.test.ts and main-host-load.test.ts. On bug/1932-repro, the host-load guard from #1887 now checks a list of options. The file is renamed to src/daemon/test-daemons-host-readers.test.ts. Its new case, "daemons started by tests under src/ > pass directoryAccess, so none builds the production adapter that reads this host", fails. The hostLoadProbe case still passes.
pnpm exec vitest run --project unit src/daemon/test-daemons-host-readers.test.ts
AssertionError: expected [ …(67) ] to deeply equal []
❯ src/daemon/test-daemons-host-readers.test.ts:116:21
+ "src/agent-device/local-profile.test.ts:100",
+ "src/agent-device/test-gateway.ts:201",
+ "src/daemon/test-main.ts:199",
+ ... (64 more)
Root cause
Defect in the test rigs, not in production. src/daemon/main.ts:234 falls back to new PowerShellDirectoryAccessReader(baseProcessRunner) when a start does not pass directoryAccess. On win32, prepareDataDirectory (src/daemon/connection-host.ts:70) waits for that powershell.exe run (10 s limit, src/ports/directory-access.ts:22) before the daemon serves. Only test-main.ts's start, gateway-fleet.e2e.test.ts:169 and main-agent-device.test.ts:134 pass a fake. Every other test start pays for the PowerShell run.
Simplest fix
Do what #1887 did for hostLoadProbe. Add directoryAccess: new FakeDirectoryAccessReader({ user: "S-1-5-21-1-2-3-1001", entries: [] }) to each start the guard lists, next to its hostLoadProbe. Tried, then discarded:
Done: PR #1935 passes directoryAccess: fakeDirectoryAccess() at every test daemon start under src/, so no test daemon runs powershell.exe on Windows. A guard test (src/daemon/test-daemons-host-readers.test.ts) fails on any start without it. Review round 1 and a CI fix-check found nothing blocking. The PR is ready.
Not done: merge.
Findings: one nonblocking note (the guard scanner misses an aliased or dynamically imported startDaemon), posted on the PR.
Blocked on: fast-track: #1932 held: PR #1935 changes 26 files, over 8. The maintainer merges the PR, or removes fast-track.
Activity
V3RON commentedon Nov 28, 2026
Reproduction
Confirmed, and wider than listed: 67 starts in 24 files, including
startGatewayinsrc/daemon/test-main.ts:199(itsstartpasses a fake),main-leasing.test.ts,main-state-db.test.tsandmain-host-load.test.ts. Onbug/1932-repro, the host-load guard from #1887 now checks a list of options. The file is renamed tosrc/daemon/test-daemons-host-readers.test.ts. Its new case, "daemons started by tests under src/ > pass directoryAccess, so none builds the production adapter that reads this host", fails. ThehostLoadProbecase still passes.Root cause
Defect in the test rigs, not in production.
src/daemon/main.ts:234falls back tonew PowerShellDirectoryAccessReader(baseProcessRunner)when a start does not passdirectoryAccess. On win32,prepareDataDirectory(src/daemon/connection-host.ts:70) waits for thatpowershell.exerun (10 s limit,src/ports/directory-access.ts:22) before the daemon serves. Onlytest-main.ts'sstart,gateway-fleet.e2e.test.ts:169andmain-agent-device.test.ts:134pass a fake. Every other test start pays for the PowerShell run.Simplest fix
Do what #1887 did for
hostLoadProbe. AdddirectoryAccess: new FakeDirectoryAccessReader({ user: "S-1-5-21-1-2-3-1001", entries: [] })to each start the guard lists, next to itshostLoadProbe. Tried, then discarded:Alternatives rejected
vi.mockthe reader in the unit setup file: it breakssrc/ports/directory-access.test.ts, and it hides which reader each start uses.startDaemonunder tests: production code would then know about tests.Risk
src/agent-device/test-support.ts:164is flaky: edge-request-rules-devices.test.ts boot test times out at 20 s on the Windows unit job #1912's fix. Whichever of the two lands second has to drop that start.Fast track
Written by an agent.
fix(agent-device): the worker test rig starts its daemons without the…
fix(test): the merge left the agent-device rig with two directoryAcce…
V3RON commentedon Nov 28, 2026
Handoff
Done: PR #1935 passes
directoryAccess: fakeDirectoryAccess()at every test daemon start undersrc/, so no test daemon runspowershell.exeon Windows. A guard test (src/daemon/test-daemons-host-readers.test.ts) fails on any start without it. Review round 1 and a CI fix-check found nothing blocking. The PR is ready.Not done: merge.
Findings: one nonblocking note (the guard scanner misses an aliased or dynamically imported
startDaemon), posted on the PR.Blocked on: fast-track: #1932 held: PR #1935 changes 26 files, over 8. The maintainer merges the PR, or removes
fast-track.Written by an agent.
V3RON commentedon Nov 28, 2026
Delivery run
Merged: none
Parked: #1932 — PR #1935 held by the fast track (26 files, over 8)
Waiting: none
Decided: none
Written by an agent.
fix(test): every daemon a test starts passes a fake directory-access …