mirror of
https://github.com/openai/codex.git
synced 2026-05-23 20:44:50 +00:00
Sub-agent McpConnectionManager startup events leaked into the leader TUI's status header because McpServerStatusUpdated notifications carried no thread identity and were routed Global, which fell through to the leader's chat_widget and overwrote its mcp_startup_status map. Once a sub-agent re-emitted Starting for a server the leader already had as Ready, the leader's spinner reopened and the settle check could never pass. Add an optional thread_id to McpServerStatusUpdatedNotification, set it from the emitting session in apply_bespoke_event_handling, and route notifications carrying a thread_id through ServerNotificationThreadTarget so non-leader threads enqueue to their own buffered store rather than mutating the leader's map. A missing thread_id keeps the existing Global behaviour for backward compatibility with older app servers. Adds: - routing unit tests covering both presence and absence of thread_id - an app-level test asserting a sub-agent McpServerStatusUpdated does not flip the leader's task-running state - thread_id assertion in the existing app-server integration test Closes #18068 Refs #16821, #19542 Co-authored-by: Codex <noreply@openai.com>