From 89161d4b9ba6956f1f58e2b78cb17082f1b406e3 Mon Sep 17 00:00:00 2001 From: nicholasclark-openai Date: Wed, 25 Mar 2026 13:55:40 -0700 Subject: [PATCH] Inline MCP span correlation fields Co-authored-by: Codex --- codex-rs/core/src/mcp_tool_call.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/codex-rs/core/src/mcp_tool_call.rs b/codex-rs/core/src/mcp_tool_call.rs index fc4f2f61a5..b9a5dab8bc 100644 --- a/codex-rs/core/src/mcp_tool_call.rs +++ b/codex-rs/core/src/mcp_tool_call.rs @@ -340,16 +340,12 @@ fn mcp_tool_call_span( mcp.connector.name = fields.connector_name.unwrap_or(""), tool.name = fields.tool_name, tool.call_id = fields.call_id, - conversation.id = Empty, - session.id = Empty, - turn.id = Empty, + conversation.id = %session.conversation_id, + session.id = %session.conversation_id, + turn.id = turn_context.sub_id.as_str(), server.address = Empty, server.port = Empty, ); - let conversation_id = session.conversation_id.to_string(); - span.record("conversation.id", conversation_id.as_str()); - span.record("session.id", conversation_id.as_str()); - span.record("turn.id", turn_context.sub_id.as_str()); record_server_fields(&span, fields.server_origin); span }