Describe the bug
Problem: Exiting the session terminates the MCP launch wrapper but leaves its descendant worker running.
Affected launch chain:
cmd.exe /c run-server.cmd
`- dotnet run --no-build --project ExampleMcpServer.csproj
`- ExampleMcpServer.exe
Affected version
GitHub Copilot CLI 1.0.88.
Steps to reproduce the behavior
- Configure a local stdio MCP server to launch through a
.cmd wrapper running dotnet run.
- Start Copilot and wait for the server to initialize.
- Exit the session.
- Observe that the wrapper terminates but the MCP worker remains alive.
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.
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.