mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
## Why Mailbox preemption can discard partial response items, and turn item contributors can rewrite completed items. Parsing those items as soon as they arrive does extra work before their final contents are known. ## What changed During mailbox draining or when turn item contributors are registered, track new response items as deferred, suppress their text and reasoning deltas, and wait for `OutputItemDone` before parsing them. Rely on the response client to carry the added item's ID forward when the completion omits it. ## Testing The mailbox preemption tests check that a buffered reasoning item completes exactly once under its original ID when the completion omits it, and that raw reasoning deltas for a discarded item stay hidden. GitOrigin-RevId: 940e062c8c44faa6670945262ee8c8f16abf4e20