[codex-analytics] add session source to client metadata#17374
Merged
marksteinbrick-oai merged 4 commits intomainfrom Apr 14, 2026
Merged
[codex-analytics] add session source to client metadata#17374marksteinbrick-oai merged 4 commits intomainfrom
marksteinbrick-oai merged 4 commits intomainfrom
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
fa0bee6 to
511dc1f
Compare
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
26d9ffc to
5f4c1bd
Compare
pash-openai
reviewed
Apr 13, 2026
da95670 to
4dd6fce
Compare
pash-openai
approved these changes
Apr 13, 2026
81eb1ef to
33b3fd5
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Adds
thread_sourcefield to the existing Codex turn metadata sent to Responses APIthread_source: "user"for user-initiated sessions: CLI, VS Code, and Execthread_source: "subagent"for subagent sessionsthread_sourcefor MCP, custom, and unknown session sourcesx-codex-turn-metadataheaderresponse.createrequests send throughclient_metadata["x-codex-turn-metadata"]Testing
cargo test -p codex-protocol session_source_thread_source_name_classifies_user_and_subagent_sourcescargo test -p codex-core turn_metadata_statecargo test -p codex-core --test responses_headers responses_stream_includes_turn_metadata_header_for_git_workspace_e2e -- --nocapture