mirror of
https://github.com/openai/codex.git
synced 2026-09-04 15:08:45 +00:00
## Why A local stdio MCP server can exit while its descendants remain alive. Cleaning up only the server process can therefore leak processes after client shutdown. ## What changed - Contain locally launched MCP servers in non-breakaway Windows job objects and terminate the job during shutdown so descendants exit with the server. - Preserve compatibility when job creation or assignment is unavailable by retrying without containment and terminating an owned process handle instead. - Use the process-group member fallback when terminating piped processes on macOS. ## Testing - Cover descendant cleanup and breakaway prevention for both local MCP protocol modes on Windows. - Cover the Windows nested-job assignment fallback and verify the suspended process resumes before handle-based termination. GitOrigin-RevId: 33d3cc122de8f7ce0ae69a649b12ea0ff64b7c6f