Files
codex/codex-rs
Yuzhu Shen 1ab8c6ef28 Fix thread unloading after disconnect during MCP startup (#50380)
## Why

If required MCP startup outlasts the requesting connection's cleanup, the newly created thread can remain loaded without subscribers because its listener is never started.

## What changed

Start the thread listener even when the requesting connection has already closed, allowing normal idle unloading to clean up the thread while preserving the `ConnectionClosed` result.

## Testing

Add a regression test that disconnects during blocked required MCP startup, then releases startup and verifies a `thread/closed` notification, an empty `thread/loaded/list`, and MCP process exit on Unix.

GitOrigin-RevId: 4ad912a82177266316042d806f5faa1713a48fa4
2026-10-02 17:40:09 +00:00
..
…
…
…