Files
codex/codex-rs/core/tests/suite
alishobeiri-oai 8531184b49 Make agent-message wakes respect interrupts and Plan mode (#56330)
## Why

A pending agent-message wake can outlive an interrupt or a switch to Plan mode while model discovery is waiting. It must recheck whether it can start before consuming queued messages.

## What changed

- Revalidate reserved wakes after discovery and build the turn with the configuration selected during admission.
- Mark interrupted wake reservations as stopped so later agent messages cannot restart automatic work, while preserving queued messages for explicit turns.
- Keep finishing turns marked as running until completion is persisted, protecting their rollout writer from capacity eviction.

## Testing

Add regression tests for interrupts and Plan-mode changes during discovery, queued-message preservation, explicit follow-ups with `wake_on_agent_messages` disabled, and completion status and persistence with the feature enabled and disabled.

GitOrigin-RevId: afe1d57063a5ec491e8b16d6c62135caa69c0a3c
2026-10-23 02:21:49 +00:00
..