mirror of
https://github.com/openai/codex.git
synced 2026-09-11 20:36:49 +00:00
## Why A descendant outside an MCP server's process group can keep stderr open after the server exits, leaving the reader task and its file descriptor alive. ## What changed Signal the local stderr reader during explicit shutdown and when the process handle is dropped. Allow up to 250 ms to drain queued diagnostics before closing the reader, even if stderr never reaches EOF. ## Testing Add a Unix regression test covering explicit shutdown and client drop with a descendant that keeps stderr open. Verify that file descriptor counts return to baseline while the descendant remains alive and that queued diagnostics are logged. GitOrigin-RevId: 1b544e8dba2b5616db6739d075e7232564c92884