mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## Why Steering and recovery requests can have different traces from the turn they join. Sampling can also finish while tools remain in flight. Tracing needs to preserve that correlation and distinguish sampling time from time spent waiting for tools. ## What changed - Add `codex.turn_input` spans with `conversation.id` and the accepted `turn.id` for started, steered, and recovered turns. - Add sampling, tool-blocking, and automatic and manual compaction spans with `codex.turn.phase` and conversation and turn IDs. End the sampling span before draining outstanding tools. - Emit a `codex.mailbox_preemption` event when pending mailbox input preempts sampling. ## Testing Add integration coverage for cross-trace steering and recovery, sampling and tool-blocking boundaries through a blocked dynamic tool, and completion or interruption. Extend mailbox preemption tests to check event emission with preemption enabled or deferred. GitOrigin-RevId: 59893c2d463c02cbd05f5c332e5afc2351cc8b62