Repository navigation
Conversation
Assign each Windows agent process to a Job Object so cleanup can terminate descendants after a shell wrapper exits. Wait for the job to empty before releasing the session. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Windows Job Object tracking so agent descendants remain manageable after shell-wrapper exit.
Changes:
- Adds native Windows process-tree tracking and cleanup.
- Updates session lifecycle to await tracked descendants.
- Adds Windows regression coverage, CI, and Koffi dependency.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/acp/windows-job.ts |
Implements Windows Job Object bindings. |
src/acp/agent-manager.ts |
Tracks and terminates Windows agent trees. |
src/acp/session.ts |
Delays session release until tree exit. |
tests/windows-job.test.ts |
Adds descendant-cleanup regression test. |
.github/workflows/ci.yml |
Adds Windows CI coverage. |
package.json |
Adds Koffi dependency. |
package-lock.json |
Locks Koffi platform packages. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
979
to
+980
| agentInfo.process.on("exit", () => { | ||
| this.handleAgentExit(userId, agentInfo.process); | ||
| void waitForAgentExit(agentInfo.process).then( |
Comment on lines
+9
to
+15
| import { createWindowsJob } from "../src/acp/windows-job.js"; | ||
|
|
||
| test( | ||
| "Windows job terminates a descendant after its wrapper exits", | ||
| { skip: process.platform !== "win32" }, | ||
| async () => { | ||
| const dir = await fs.mkdtemp(path.join(os.tmpdir(), "wechat-acp-job-")); |
Comment on lines
+97
to
+101
| const { createWindowsJob } = await import("./windows-job.js"); | ||
| if (proc.pid === undefined) { | ||
| throw new Error("Cannot track Windows agent process without a process ID"); | ||
| } | ||
| windowsJobs.set(proc, createWindowsJob(proc.pid)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #71