Skip to content

Add model and reasoning effort to MCP turn metadata#21219

Merged
mchen-oai merged 1 commit intomainfrom
mchen/mcp_model_metadata
May 6, 2026
Merged

Add model and reasoning effort to MCP turn metadata#21219
mchen-oai merged 1 commit intomainfrom
mchen/mcp_model_metadata

Conversation

@mchen-oai
Copy link
Copy Markdown
Contributor

@mchen-oai mchen-oai commented May 5, 2026

Why

  • Similar change as Add turn start timestamp to turn metadata #19473.
  • Without change: MCP tool calls receive _meta["x-codex-turn-metadata"] with session_id, turn_id, and turn_started_at_unix_ms.
  • Issue: MCP servers may want the model and reasoning effort to better understand tool-call behavior and latency relative to turn start.

What Changed

  • With change: MCP turn metadata now includes model and reasoning_effort, propagated in _meta["x-codex-turn-metadata"].
  • Normal /responses turn metadata headers are unchanged.

Verification

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

@mchen-oai mchen-oai force-pushed the mchen/mcp_model_metadata branch from 0a9a2ab to a46f9a3 Compare May 5, 2026 17:38
@mchen-oai mchen-oai changed the title Add model to turn metadata Add model and reasoning effort to turn metadata May 5, 2026
@mchen-oai mchen-oai force-pushed the mchen/mcp_model_metadata branch 5 times, most recently from 6f4bd78 to 495de0f Compare May 5, 2026 19:02
@mchen-oai mchen-oai changed the title Add model and reasoning effort to turn metadata Add model and reasoning effort to MCP turn metadata May 5, 2026
@mchen-oai mchen-oai marked this pull request as ready for review May 5, 2026 19:20
@mchen-oai mchen-oai requested a review from a team as a code owner May 5, 2026 19:20
@mchen-oai mchen-oai force-pushed the mchen/mcp_model_metadata branch from 495de0f to 362d14c Compare May 5, 2026 19:20
@mchen-oai mchen-oai requested review from mzeng-openai and owenlin0 May 5, 2026 19:20
@mchen-oai
Copy link
Copy Markdown
Contributor Author

mchen-oai commented May 5, 2026

@owenlin0 @mzeng-openai - Added you as reviewers since this is similar to previous PR you reviewed. Thank you!

@mchen-oai mchen-oai force-pushed the mchen/mcp_model_metadata branch from 362d14c to e5c00ca Compare May 5, 2026 19:24
@mchen-oai mchen-oai force-pushed the mchen/mcp_model_metadata branch from e5c00ca to 32cc84f Compare May 5, 2026 19:37
@mchen-oai mchen-oai merged commit 794c240 into main May 6, 2026
26 checks passed
@mchen-oai mchen-oai deleted the mchen/mcp_model_metadata branch May 6, 2026 00:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 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