Files
codex/codex-rs
Benjamin Carlsson 573bc54846 Keep TUI event receivers with their threads (#63441)
## Why

Clearing the active thread could drop its receiver and discard unread
events. A queued close from an old stream could also trigger close
handling while the same thread was being reattached.

## What changed

Keep each receiver in its thread's event channel and look it up by the
active thread ID. When a live attachment replaces the active thread's
stream, drain pending events and skip the old stream's `ThreadClosed`
notification unless the TUI is waiting for it to finish shutting down.

## Testing

Cover switching focus away and back without losing or misrouting unread
events. Exercise same-thread reattachment with a queued close, both
with and without a pending shutdown.

GitOrigin-RevId: b58767b2666ddbb64b09e6542ec8f550538531b6
2026-11-23 21:24:20 +00:00
..
…
…
…