fix: bound Windows ACP shutdown and retain failed cleanup - #430
slashdevcorpse wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5536eaa9c2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f71ec192f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Closing to replace this cross-fork PR with a native three-PR GitHub stack in slashdevcorpse/Lody. GitHub native stacks require all branches in the same repository. The implementation is preserved on fix/windows-process-tree-cleanup; replacement links will follow. #429 remains open. |
|
Native GitHub stack #5 in slashdevcorpse/Lody, created with gh stack link:
Replaces the closed cross-fork #430 and #435. Each PR has an incremental diff against its predecessor. GitHub native stacks require all branches in the same repository, so this stack is in the contributor fork. It has not merged or landed upstream; #429 remains open. |
Related issue
Refs #429
Problem / pressure
Windows auxiliary ACP shutdown can kill only its wrapper. Fallback sandbox cleanup accepts failed taskkill exits, force-exit waiting is unbounded, and session/terminal shutdown can hide errors or discard ownership before cleanup succeeds. A stalled terminal disposal can also prevent the process-kill phase from running, and the outer CLI deadline could previously expire before session cleanup reached forced termination.
Summary
Add bounded hidden taskkill /PID /T cleanup with optional /F, validated helper result, and timer/listener cleanup; await auxiliary ACP root exit and coalesce its cleanup.
Retain ChildProcess ownership in the sandbox, avoid targeting known-exited roots, attempt every root, and aggregate failures.
Bound graceful/forced session exit waits and terminal disposal (30 seconds); continue process termination after disposal failure while retaining a failed result and sharing still-pending disposal on retry.
Retain failed sessions in manager cleanup, including late root-exit events; remove only the exact successfully terminated instance and preserve replacements.
Terminal release now awaits observed exit, escalates live roots when necessary, reports failures, retains retry state, and coalesces concurrent release. Actual close reporting does not wait for resource-limit inspection.
Add Windows-only OS-handle verification for a real wrapper/child/grandchild tree and deterministic failure/retry tests.
Share one session termination attempt, upgrade concurrent force requests, and reject replacement or new admission during shutdown.
Reserve 15 seconds for graceful shutdown, 15 seconds for forced cleanup, and a separate bounded telemetry flush. Force all retained workspace and preparing-session owners concurrently even when graceful drains stall.
Replacement native stack
Native GitHub stack #6 in slashdevcorpse/Lody, created with gh stack link:
Replaces the closed cross-fork #430 and #435. Each PR has an incremental diff against its predecessor. GitHub native stacks require all branches in the same repository, so this stack is in the contributor fork. It has not merged or landed upstream; #429 remains open.
Before / after
Test plan
Context handoff
Instructions for reviewing agents
Authoring context