perf: trace and reduce remote first-turn latency#30632
Closed
apanasenko-oai wants to merge 1 commit into
Closed
Conversation
This was referenced Jun 30, 2026
Collaborator
Author
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
This change makes remote first-turn and command latency attributable end to end, and removes several avoidable waits found while profiling that path.
Why
The previous telemetry exposed large envelopes such as
exec_commandandsession_init, but could not distinguish queue residence, transport transit, child-process work, terminal notification delivery, or persistence. Profiling also showed that skill discovery repeated the same remote ancestor-marker walk that AGENTS discovery had just completed.The one-shot root handoff removes that duplicate startup walk without caching filesystem topology across turns. Later loads rediscover the nearest marker, so creating or removing a closer repository boundary remains observable.
Validation
cargo fmt --all -- --checkcargo check -p codex-corecargo test -p codex-core-skills repo_skill_roots_use_one_shot_hint_then_observe_new_nearest_marker -- --nocapturecargo test -p codex-exec-server process_lifecycle_trace_separates_output_readers_and_exit_watcher -- --nocapturecargo test -p codex-exec-server --test exec_processcargo test -p codex-thread-storejust bazel-lock-checkThe new trace boundaries were also exercised with a real remote command flow. Local process handling remained small; the added spans separated it from the dominant transport legs and exposed the repeated startup metadata RPCs.
This is an internally requested performance and observability enhancement; there is no public issue.