Files
codex/codex-rs
Eric Traut bf7c87a7b7 Ignore stale thread-close notifications after resuming a thread (#47155)
## Why

A queued close notification from an old runtime can arrive after the same thread has been resumed. Because thread IDs survive reloads, handling that notification can incorrectly exit the TUI or switch away from the displayed thread.

## What changed

Confirm the displayed thread's status with `thread/read` before handling its close notification. Ignore the notification if the thread is still loaded. Bound verification to five seconds and retry an internal server error once.

If verification fails, reconnect remote sessions. Preserve close handling for embedded sessions, unreadable unpersisted threads, and servers that do not support the request.

## Testing

Add regression tests for stale and genuine close notifications, plus disconnects, timeouts, transient and persistent server errors, embedded-session fallback, and unsupported requests.

GitOrigin-RevId: 783433b11ed268aed521f3b2cc4d0aa3a36a3836
2026-09-22 02:15:01 +00:00
..
…
…