Skip to content

fix(cli): accept already-exited Windows process trees - #5362

Closed
user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/windows-exited-process-tree
Closed

user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/windows-exited-process-tree

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

When a subprocess exits just before Windows taskkill /T /F reaches it, taskkill reports status 128 (process not found). The process-tree helper currently rejects that result, so cancelled render setup and probes can report taskkill exited with status 128 instead of the original error.

Treat only status 128 as completed teardown. Preserve rejection for other exit statuses, signal termination, and spawn errors. Caller tests verify that an output overflow retains ENOBUFS, a timeout retains ETIMEDOUT, and an abort returns the exact supplied reason when the child has already exited.

Validation: five new regression cases fail on unchanged main; all 92 related process, cancellation, orphan-cleanup, preflight, and preview-lifecycle tests pass with the fix. Workspace and CLI builds, CLI typecheck, repository lint, formatting, comment checks, test reachability, and normal pre-commit hooks pass. The Windows branches are exercised through the injected process seam locally on macOS; native Windows execution is left to the required CI lane.

Related: #5273.

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks for this. Main already handles it: #5625 made runCancellableProcess ignore a failed taskkill and keep the original error, with cancellableProcess.killFailure.test.ts covering the status-128 case. Your three caller tests pass against main without this change, so I'm closing it as superseded.

@jrusso1020 jrusso1020 closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants