Skip to content

[codex] Trace exec-server JSON-RPC requests - #27466

Merged
richardopenai merged 4 commits into
mainfrom
codex/exec-server-rpc-tracing
Jun 24, 2026
Merged

richardopenai merged 4 commits into
mainfrom
codex/exec-server-rpc-tracing

Conversation

@richardopenai

@richardopenai richardopenai commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Why

Exec-server JSON-RPC calls can cross local and remote transports, but trace context stopped at the RPC boundary. That made client and server work difficult to correlate when diagnosing latency or failures.

What changed

  • Propagate the current W3C trace context on outbound JSON-RPC requests.
  • Parent inbound request spans from received trace context.
  • Record the received JSON-RPC method on server spans and keep each span open through response enqueue.
  • Add only the OTEL dependencies required by the exec-server crate.

Stack

Review and land this stack in order:

  1. [codex] Trace exec-server JSON-RPC requests #27466 — trace exec-server JSON-RPC requests (this PR)
  2. [codex] Record exec-server lifecycle metrics #27467 — record bounded connection, request, and process lifecycle metrics
  3. [codex] Observe remote exec-server lifecycle #27470 — observe remote registration and Noise rendezvous lifecycle

Validation

  • just test -p codex-exec-server --lib (153 passed)
  • just bazel-lock-check
  • just fix -p codex-exec-server

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Review source: Codex Cloud Agents (CCA)

Codex Cloud Agents (CCA) couldn't complete this review. The original Codex Review is unaffected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e06c4e5e1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/exec-server/Cargo.toml Resolved
@richardopenai
richardopenai force-pushed the starr/cca-exec-logging branch from bf4be25 to 129a501 Compare June 16, 2026 19:21
@richardopenai
richardopenai force-pushed the codex/exec-server-rpc-tracing branch from e06c4e5 to f3958b2 Compare June 16, 2026 19:21
richardopenai added a commit that referenced this pull request Jun 18, 2026
## Summary

- Initialize stderr tracing and the configured OpenTelemetry provider
for local and remote `codex exec-server` startup.
- Instrument the local and remote server entrypoints with a root runtime
span.
- Keep raw Noise environment, registration, and stream identifiers out
of exported spans while preserving them in local debug events.
- Keep telemetry setup in a focused CLI module instead of growing the
top-level command entrypoint.

## Stack

- Previous: none (`#27058` has merged)
- Next: #27466

## Validation

- `just test -p codex-exec-server --lib` (139 passed)
- `just test -p codex-cli --test exec_server` (3 passed)
- `just bazel-lock-check`
- `just fix -p codex-exec-server -p codex-cli`
- `just fmt`

---------

Co-authored-by: Richard Lee <[email protected]>
Base automatically changed from starr/cca-exec-logging to main June 18, 2026 18:03
@richardopenai
richardopenai force-pushed the codex/exec-server-rpc-tracing branch 2 times, most recently from 1ef0691 to eb4572e Compare June 19, 2026 00:15