Skip to content

Add turn start timestamp to turn metadata#19473

Merged
mchen-oai merged 1 commit intomainfrom
mchen/turn_start_timestamp_metadata
Apr 28, 2026
Merged

Add turn start timestamp to turn metadata#19473
mchen-oai merged 1 commit intomainfrom
mchen/turn_start_timestamp_metadata

Conversation

@mchen-oai
Copy link
Copy Markdown
Contributor

@mchen-oai mchen-oai commented Apr 25, 2026

Why

  • Without change: MCP tool calls receive _meta["x-codex-turn-metadata"] with session_id and turn_id.
  • Issue: MCP servers may want the turn start timestamp to measure internal latency relative to turn start.

What Changed

  • With change: turn metadata now includes turn_started_at_unix_ms, which is propagated to MCP tool calls in _meta["x-codex-turn-metadata"].

Verification

  • codex-rs/core/src/mcp_tool_call_tests.rs
  • codex-rs/core/src/turn_metadata_tests.rs
  • codex-rs/core/src/turn_timing_tests.rs
  • codex-rs/core/tests/responses_headers.rs
  • codex-rs/core/tests/suite/search_tool.rs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 25, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mchen-oai mchen-oai force-pushed the mchen/turn_start_timestamp_metadata branch from 562f93e to a7cd879 Compare April 25, 2026 00:47
@mchen-oai
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@mchen-oai mchen-oai force-pushed the mchen/turn_start_timestamp_metadata branch from 196dd95 to 5eafeb8 Compare April 28, 2026 16:13
@mchen-oai mchen-oai enabled auto-merge (squash) April 28, 2026 16:20
@mchen-oai mchen-oai merged commit ccec84b into main Apr 28, 2026
25 checks passed
@mchen-oai mchen-oai deleted the mchen/turn_start_timestamp_metadata branch April 28, 2026 16:37
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants