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
Windows: background job cancellation fails without a process identity #110
On native Windows, a running background task records pidIdentity: null. The cancel command then refuses to stop the task and marks it as cancel_failed.
Reproduction
I ran a real background task through the companion CLI on Windows, with a prompt that starts node -e "setTimeout(() => {}, 120000)" and does not edit files:
{
"status": "cancel_failed",
"note": "Refusing to cancel a stored process without a PID identity."
}
The process tree was still alive afterward and had to be terminated manually.
Root cause
getProcessIdentity() handles macOS separately and otherwise reads /proc/<pid>/stat. On Windows that resolves to a path such as D:\proc\<pid>\stat and fails with ENOENT. Callers treat identity collection as best-effort, so the job continues with a null identity, but cancellation deliberately requires one.
The Windows CI job currently runs the curated test:cross-platform list, which does not include tests/process.test.mjs. That test file also uses echo and cat as standalone executables, so it is not portable to native Windows yet.
Expected behavior
Windows jobs should store a stable process-birth identity and pass the same PID-reuse check used on the other platforms. tests/process.test.mjs should run in the Windows CI job.
I hit a second Windows-specific path while verifying the fix: once the PID identity was available, cancellation still used the Unix negative-PID signal path and treated the failure as "Process not found". #111 fixes both parts by storing the Windows process start time and routing cancellation through the existing taskkill /T /F helper.
I also verified it against a live background job: the claude.exe process and its Bash/Node children were gone after cancellation.
Activity
pj991207 commentedon Sep 14, 2026
I hit a second Windows-specific path while verifying the fix: once the PID identity was available, cancellation still used the Unix negative-PID signal path and treated the failure as "Process not found". #111 fixes both parts by storing the Windows process start time and routing cancellation through the existing
taskkill /T /Fhelper.I also verified it against a live background job: the
claude.exeprocess and its Bash/Node children were gone after cancellation.