Add Responses spans and RMCP trace propagation#15792
Draft
nicholasclark-openai wants to merge 2 commits intomainfrom
Draft
Add Responses spans and RMCP trace propagation#15792nicholasclark-openai wants to merge 2 commits intomainfrom
nicholasclark-openai wants to merge 2 commits intomainfrom
Conversation
905cab6 to
a417486
Compare
d04171e to
2e88da9
Compare
4fe235f to
6f5cefc
Compare
2e88da9 to
e738606
Compare
6f5cefc to
16d57b4
Compare
e738606 to
caf275b
Compare
16d57b4 to
89161d4
Compare
caf275b to
875f48c
Compare
875f48c to
5173865
Compare
nicholasclark-openai
added a commit
that referenced
this pull request
Mar 25, 2026
## Summary - add an explicit `mcp.tools.call` span around MCP tool execution in core - keep MCP span validation local to `mcp_tool_call_tests` instead of broadening the integration test suite - inline the turn/session correlation fields directly in the span initializer ## Included Changes - `codex-rs/core/src/mcp_tool_call.rs`: wrap the existing MCP tool call in `mcp.tools.call` and inline `conversation.id`, `session.id`, and `turn.id` in the span initializer - `codex-rs/core/src/mcp_tool_call_tests.rs`: assert the MCP span records the expected correlation and server fields ## Testing - `cargo test -p codex-core` - `just fmt` ## Notes - `cargo test -p codex-core` still hits existing unrelated failures in guardian-config tests and the sandboxed JS REPL `mktemp` test - metric work moved to stacked PR #15792 - transport-level RMCP spans and trace propagation remain in stacked PR #15792 - full workspace `cargo test` was not run --------- Co-authored-by: Codex <noreply@openai.com>
Layer the Responses-specific request spans and HTTP transport child spans on top of the MCP tracing branch, and add focused tracing assertions for the Responses path. Co-authored-by: Codex <noreply@openai.com>
Add traceparent/tracestate propagation for RMCP streamable HTTP and stdio calls, and cover it with transport-level tests. Co-authored-by: Codex <noreply@openai.com>
5173865 to
e9e5bea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
responses_http.requestspans for Responses HTTP requests under the existing turn tracehttp.clientchild spans so raw transport time is visible under the semantic Responses spanmcp.client.operationchild spans plustraceparent/tracestatepropagation over streamable HTTP headers and stdio request_metaIncluded Changes
codex-rs/core/src/network_trace.rs: shared Responses span builder and turn correlation fieldscodex-rs/core/src/client.rs: wrap Responses HTTP requests inresponses_http.requestcodex-rs/codex-client/src/default_client.rs: addhttp.clientchild spans and inject W3C trace headers from the explicit HTTP spancodex-rs/core/src/tasks/mod.rs: keep the task-owned turn span as the explicit parent for nested request spanscodex-rs/core/tests/suite/otel.rs: assert Responses request spans are nested under the turn spancodex-rs/rmcp-client/src/rmcp_client.rs: addmcp.client.operationspans and propagatetraceparent/tracestateover streamable HTTP headers and stdio metadatacodex-rs/rmcp-client/src/bin/test_stdio_server.rs: expose propagated stdio trace metadata in the test server responsecodex-rs/rmcp-client/src/bin/test_streamable_http_server.rs: requiretraceparenton session POSTs in the streamable HTTP test modecodex-rs/rmcp-client/tests/resources.rs: add direct RMCP stdio propagation coveragecodex-rs/core/tests/suite/rmcp_client.rs: cover streamable HTTP propagation and keep the end-to-end MCP round-trip coverageTesting
cargo test -p codex-clientcargo test -p codex-rmcp-clientjust fix -p codex-clientjust fix -p codex-rmcp-clientjust fmtNotes
cargo testwas not run