[codex] add latency tracing spans (#27710)

## Why

We have some large gaps in our thread start, resume, and pre-sampling
traces that make it hard to tell where latency is coming from.

## What Changed

- Added coarse spans around thread start/resume, turn context
construction, rollout reconstruction, skill/plugin loading, and tool
preparation.
- Added a breakdown of discoverable-tool preparation across connector
loading, plugin discovery, and local plugin details.

## Testing

- `cargo check -p codex-app-server -p codex-core -p codex-core-skills -p
codex-core-plugins`
- Built the app-server locally and exercised thread start, first turn,
follow-up turn, server restart, thread resume, and a resumed turn.
This commit is contained in:
rphilizaire-openai authored and GitHub committed 2026-06-12 17:11:32 -07:00
1 parent 1460b509f4
commit bacfc5e4c0
11 files changed
+38

No files matched your search

@@ -2809,6 +2809,7 @@ impl ThreadRequestProcessor {
Some(persisted_metadata)
}
#[tracing::instrument(level = "trace", skip_all)]
async fn resume_running_thread(
&self,
request_id: &ConnectionRequestId,
@@ -2995,6 +2996,7 @@ impl ThreadRequestProcessor {
Ok(RunningThreadResumeResult::NotRunning(None))
}
#[tracing::instrument(level = "trace", skip_all)]
async fn resume_thread_from_history(
&self,
history: &[ResponseItem],
@@ -3011,6 +3013,7 @@ impl ThreadRequestProcessor {
))
}
#[tracing::instrument(level = "trace", skip_all)]
async fn resume_thread_from_rollout(
&self,
thread_id: &str,
@@ -3065,6 +3068,7 @@ impl ThreadRequestProcessor {
Ok(stored_thread)
}
#[tracing::instrument(level = "trace", skip_all)]
async fn stored_thread_to_initial_history(
&self,
stored_thread: &StoredThread,