Files
codex/codex-rs/exec-server/BUILD.bazel
jif 54c44b9ed4 Propagate tracing subscribers to exec start tasks (#32135)
## Why

The process-start background task can move to a Tokio worker thread, where the
caller's thread-local tracing subscriber is otherwise unavailable. This can
break propagation of the caller's trace context to the exec-server request.

## What changed

- Attach both the current span and current tracing subscriber to spawned
  process-start tasks.
- Run exec-server Bazel unit tests serially because their tracing setup uses
  process-global state.

## Testing

Run the trace-context regression test on a multi-thread Tokio runtime so it
exercises propagation across the background task.

GitOrigin-RevId: a586eefd6983916d670fc5a90f0decd0468d273b
2026-07-10 11:00:12 +00:00

24 lines
759 B
Python

load("//:defs.bzl", "codex_rust_crate")
codex_rust_crate(
name = "exec-server",
crate_name = "codex_exec_server",
deps_extra = [
"@crates//:opentelemetry",
"@crates//:opentelemetry_sdk",
"@crates//:toml",
],
extra_binaries = [
"//codex-rs/bwrap:bwrap",
],
integration_compile_data_extra = [
"src/proto/codex.exec_server.relay.v1.rs",
],
# Keep the crate's tests single-threaded under Bazel because they install
# process-global test-binary dispatch state, and the remote exec-server
# cases already rely on serialization around the full CLI path.
integration_test_args = ["--test-threads=1"],
test_tags = ["no-sandbox"],
unit_test_args = ["--test-threads=1"],
)