Repository navigation
feat(server): record the turn ID in the routing log - #971
Merged
Merged
Conversation
This was referenced Oct 12, 2026
Merged
elyasmnvidian
force-pushed
the
emehtabuddin/routing-log-turn-id
branch
from
October 13, 2026 16:15
ae541bd to
fef2a58
Compare
elyasmnvidian
force-pushed
the
emehtabuddin/routing-log-turn-id
branch
from
October 13, 2026 16:33
fef2a58 to
b6bd9ef
Compare
Base automatically changed from
emehtabuddin/runner-credential-errors
to
main
October 15, 2026 16:32
Signed-off-by: Elyas Mehtabuddin <emehtabuddin@nvidia.com>
elyasmnvidian
force-pushed
the
emehtabuddin/routing-log-turn-id
branch
from
October 15, 2026 16:35
b6bd9ef to
c9af42a
Compare
elyasmnvidian
marked this pull request as ready for review
October 15, 2026 16:35
Contributor
nachiketb-nvidia
approved these changes
Oct 15, 2026
linj-glitch
approved these changes
Oct 15, 2026
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.
The routing log records a session ID for each model call but leaves out the turn ID, even though the server already reads one from the request. A turn is one user message plus every model call the agent makes to answer it. Without the turn ID, a reader of
routing.jsonlcannot group the calls of one turn, so the desktop app's usage table (#976) cannot link to the calls for a turn.Each routing log record now has a
turn_idfield betweensession_idandmodel. The server takes it from thex-switchyard-turn-idheader or from theturn_idin Codex'sx-codex-turn-metadataheader. These are the sources it already uses for request metadata. When a request carries neither, the field isnull. Records still contain only IDs, model names, and token counts, not prompts or responses.The server tests send requests through the real server and read the log file it writes:
routing_log_prefers_canonical_and_preserves_legacy_fallback: the record has the turn fromx-switchyard-turn-id, and a request without one getsnull.routing_log_keeps_the_canonical_session_id_until_a_stream_drains: a streamed response keeps its turn ID until the stream ends.lib.rs: a judge call's record has the session and turn IDs from the routed request.Summary by CodeRabbit