Files
codex/codex-rs
sayan-oai 62ea6d41e8 Serialize environment updates and cancel removed pending attachments (#47077)
## Why

Concurrent credential refreshes could restore a removed environment by overwriting the selection list with stale state. Unpolled snapshot futures could also keep pending configuration alive after an environment was removed.

## What changed

- Protect environment selections with a mutex and update them in place to serialize selection changes, configuration refreshes, and connection listener setup.
- Capture only selection metadata and resolution futures in snapshots so they do not retain pending configuration senders.

## Testing

Add regression tests for removal during credential refresh and cancellation while an unpolled snapshot is held. Strengthen the pending attachment integration test to check that `wait_for_environment` returns the expected environment ID and `ready` status.

GitOrigin-RevId: c6f933e8d3031b05335ddcfed00ab400aa5bad2a
2026-09-21 17:53:03 +00:00
..
…
…