mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
## Why Injected agent messages need to reach active sampling before stale tool calls execute, while messages queued around a final answer must wait for the next task without requesting another response. ## What changed - Include injected `agent_message` items in mailbox preemption checks when the matching turn still accepts mail and `DeferMailboxPreemption` is disabled. - Treat injected agent messages as queue-only mail so they do not reopen delivery after a final answer or force a follow-up response. ## Testing Add a streaming scenario and context snapshot covering idle injection, active sampling preemption, deferred delivery around a final answer, and preservation of message payloads and ordering before the next task. GitOrigin-RevId: 70f49cbe5074725c11e1fcb33eea05e0e92e17f7