Skip to content

feat: include thread ID in MCP turn metadata#21329

Merged
jif-oai merged 2 commits into
mainfrom
jif/mcp-thread-id
May 6, 2026
Merged

feat: include thread ID in MCP turn metadata#21329
jif-oai merged 2 commits into
mainfrom
jif/mcp-thread-id

Conversation

@jif-oai

@jif-oai jif-oai commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Why

MCP tool calls already include session_id in x-codex-turn-metadata, but descendant threads intentionally share that value with the root thread. Consumers that need to correlate work at the concrete thread level also need the current thread_id.

What changed

  • add thread_id to x-codex-turn-metadata while preserving session_id as the shared session identity
  • thread the two identities separately through normal turns and spawned review threads
  • add regression coverage for resumed sessions, reserved metadata fields, and deferred MCP tool calls

Verification

  • added focused coverage in core/src/session/tests.rs, core/src/turn_metadata_tests.rs, and core/tests/suite/search_tool.rs

@jif-oai jif-oai requested a review from a team as a code owner May 6, 2026 09:14
@jif-oai jif-oai changed the title feat: MCP thread ID feat: include thread ID in MCP turn metadata May 6, 2026
@jif-oai jif-oai enabled auto-merge (squash) May 6, 2026 09:25
@jif-oai jif-oai disabled auto-merge May 6, 2026 09:36
@jif-oai jif-oai merged commit fe24a18 into main May 6, 2026
26 checks passed
@jif-oai jif-oai deleted the jif/mcp-thread-id branch May 6, 2026 09:36
@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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants