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
The supervisor's Windows tree kill has no time limit: spawn ignores its timeoutMs #1979
NodeProcessSupervisor.signal (src/ports/process-supervisor.ts:100-103) starts its PowerShell kill with processRunner.spawn(..., { timeoutMs: TREE_KILL_TIMEOUT_MS }). NodeProcessRunner.spawn reads no timeoutMs; only run does (src/ports/node-process-runner.ts:94).
So the 10 s limit at line 193 does nothing. A PowerShell that hangs is never ended, and the endedBy half of the fallback at line 113 never runs, so the wrapper is not ended alone either. src/ports/AGENTS.md says every wait an adapter makes is bounded.
Read in the code on origin/main at dead1fb, not run. Found while triaging #1965.
Seen on: fakes (a fake child on a fake clock, under the real NodeProcessRunner). Not run on Windows.
src/ports/process-supervisor.test.ts on bug/1979-repro: "a (SIGTERM | SIGKILL) whose PowerShell hangs ends that PowerShell at 10 s and then signals the wrapper alone".
$ pnpm exec vitest run --project unit src/ports/process-supervisor.test.ts
AssertionError: expected [] to deeply equal [ 'PowerShell ended', …(1) ] src/ports/process-supervisor.test.ts:209:20
Tests 2 failed | 34 passed | 1 skipped (37)
Root cause
Defect, as filed. src/ports/process-supervisor.ts:100 calls spawn, which takes no limit by contract (src/ports/AGENTS.md); only run arms a timer (src/ports/node-process-runner.ts:94). The existing "never finishes" test missed it: ScriptedProcessRunner answers endedBy: "timeout" for a call nothing times. The compiler missed it because ProcessRunOptions accepts timeoutMs for spawn. The spawn-error and non-timeout-kill halves of the fallback do run.
Simplest fix
In signal, call run(command, args, { stdio: "ignore", timeoutMs: TREE_KILL_TIMEOUT_MS }) with the same fallback, and drop the outer try: run rejects where spawn threw.
fix tried, then restored: pnpm typecheck clean; process-supervisor, process-runner, child-window,
key-set-fetcher and adb-server tests: 124 passed | 1 skipped
an earlier run of all of src/ports failed key-set-fetcher once (#1981)
pnpm test:changed: 7495 passed, 1 timed out (lease-model.test.ts, 20 s); alone, with the fix, it passed. Host load 79.
Activity
V3RON commentedon Nov 30, 2026
Reproduction
Seen on: fakes (a fake child on a fake clock, under the real
NodeProcessRunner). Not run on Windows.src/ports/process-supervisor.test.tsonbug/1979-repro: "a (SIGTERM | SIGKILL) whose PowerShell hangs ends that PowerShell at 10 s and then signals the wrapper alone".Root cause
Defect, as filed.
src/ports/process-supervisor.ts:100callsspawn, which takes no limit by contract (src/ports/AGENTS.md); onlyrunarms a timer (src/ports/node-process-runner.ts:94). The existing "never finishes" test missed it:ScriptedProcessRunneranswersendedBy: "timeout"for a call nothing times. The compiler missed it becauseProcessRunOptionsacceptstimeoutMsforspawn. The spawn-error and non-timeout-kill halves of the fallback do run.Simplest fix
In
signal, callrun(command, args, { stdio: "ignore", timeoutMs: TREE_KILL_TIMEOUT_MS })with the same fallback, and drop the outertry:runrejects wherespawnthrew.Alternatives rejected
NodeProcessRunner.spawnhonourstimeoutMs: contradicts the manual and changes iOSrunCommand, which passes one (iOS runCommand passes timeoutMs to spawn, which ignores it, and its comment relies on that backstop #1980).timeoutMs: the wait stays unbounded.run.Risk
#reap(adb-server.ts:238) gives up after 5 s + 5 s, so it answers before the fallback.#reap's identity check, up to 10 s late.Fast track
Side findings
Written by an agent.
fix(ports): spawn's options take no timeoutMs, so iOS tests prove a c…