Skip to content

Add spans to turn lifecycle gaps - #27623

Merged
mchen-oai merged 1 commit into
mainfrom
mchen/turn-lifecycle-spans
Jun 11, 2026
Merged

Add spans to turn lifecycle gaps#27623
mchen-oai merged 1 commit into
mainfrom
mchen/turn-lifecycle-spans

Conversation

@mchen-oai

@mchen-oai mchen-oai commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Why

Codex app-server latency traces do not granularly cover turn task startup and inter-request handoffs. These spans help attribute time across task execution, startup prewarm, in-flight tool completion, and rollout persistence.

What changed

  • Add session_task.run spans around task execution and session_task.flush_rollout around flushing pending conversation transcript writes to durable storage
  • Add regular_task.prepare_run_turn around regular-turn startup (Send the TurnStarted event, reset turn-specific reasoning state, and resolve any startup prewarm)
  • Add startup_prewarm.resolve around waiting for background session prewarming to finish, fail, time out, or be cancelled
  • Add a function-level trace span around draining in-flight tool calls (Wait for tool calls to complete, record tool result in conversation history, and other bookkeeping)

Verification

Trigger Codex rollout and observe new spans are included

@mchen-oai mchen-oai changed the title [Core] Add turn lifecycle spans Add turn lifecycle spans Jun 11, 2026
@mchen-oai mchen-oai changed the title Add turn lifecycle spans Add spans to turn lifecycle gaps Jun 11, 2026
@mchen-oai
mchen-oai force-pushed the mchen/turn-lifecycle-spans branch from 43b0a4f to e12c139 Compare June 11, 2026 16:37
@mchen-oai
mchen-oai force-pushed the mchen/turn-lifecycle-spans branch from e12c139 to 585a3fd Compare June 11, 2026 17:06
@mchen-oai
mchen-oai requested a review from owenlin0 June 11, 2026 17:10
@mchen-oai
mchen-oai marked this pull request as ready for review June 11, 2026 17:12
@mchen-oai
mchen-oai requested a review from a team as a code owner June 11, 2026 17:12
@mchen-oai
mchen-oai merged commit 92d9036 into main Jun 11, 2026
31 checks passed
@mchen-oai
mchen-oai deleted the mchen/turn-lifecycle-spans branch June 11, 2026 23:55
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants