Repository navigation
Windows: MCP worker survives exit when launched through a wrapper #4972
Copy link
Copy link
Open
Labels
area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows TerminalWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal
Description
Activity
The Windows Job Object suggestion looks right, but I would make the cross-platform ownership contract explicit:
every locally spawned MCP process tree belongs to one supervisor scope and must be gone after that scope closes.
Windows: Job Object with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.
Unix: process group/session ownership with graceful signal followed by bounded kill.Regression cases worth covering:
- direct child;
.cmd/shell wrapper with grandchild;- supervisor crash;
- exit during MCP startup;
- exit during active request;
- child that ignores graceful shutdown.
The test should assert on the descendant worker PID, not only the wrapper PID.
- child that ignores graceful shutdown.
This might be considered as feature: on 1st run start background worker that serves multiple parallel and/or consecutive sessions.
But of course, in scope of this issue, it can be deferred or completely ignored until somebody asks for such feature.- بخدا من دزد نیستم میخوام خودم دستم جیب خودمم باش لطفا کمک کنید تا سفید بال خودم مادرم خواهرم رو وصل کنم در تاریخ دوشنبه ۲۸ سپتامبر ۲۰۲۶، ۰۹:۱۴ Sven Suursoho < ***@***.***> نوشت:…*svens* left a comment (github/copilot-cli#4972) <#4972 (comment)> - child that ignores graceful shutdown. This might be considered as feature: on 1st run start background worker that serves multiple parallel and/or consecutive sessions. But of course, in scope of this issue, it can be deferred or completely ignored if nobody asks for such feature. — Reply to this email directly, view it on GitHub <#4972?email_source=notifications&email_token=BMBZYCUSQ4O7ZYYPZEDUFSL5RH3CDA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOBWGQYTQNJRG4Z2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-5864185173>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BMBZYCTHYRRJSQKVBXFRCWD5RH3CDAVCNFSNUABFKJSXA33TNF2G64TZHM2TQNJYGYYDMNRUHNEXG43VMU5TKNJZGIZTGNBWGM42C5QC> . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
- addedarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows TerminalWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminaland removed
on Oct 4, 2026
Metadata
Metadata
Assignees
Labels
area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows TerminalWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal
Describe the bug
Problem: Exiting the session terminates the MCP launch wrapper but leaves its descendant worker running.
Affected launch chain:
Affected version
GitHub Copilot CLI 1.0.88.
Steps to reproduce the behavior
.cmdwrapper runningdotnet run.Expected behavior
Terminate the complete session-owned MCP process tree, allowing a bounded graceful shutdown.
Additional context
Suggested fix (copilot generated): Own the process tree using a Windows Job Object with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. Assign the initial process before it spawns descendants. Cover normal exit, supervisor crashes, and shutdown during startup or an active request.