feat(run): propagate the run session as an x-session-id header (ENG-3473) - #1013
Merged
Merged
Conversation
aix-ahmet
added a commit
that referenced
this pull request
Jul 31, 2026
Commit 9acccf4 (#1013) added session_id to Model._SDK_ONLY_PARAMS so it never leaks into build_run_payload / build_run_url output, but the merge of branch 'test' into development (dc8c4c2) resolved that hunk in favor of the older frozenset, dropping the entry while keeping the feature's tests and comments. Restore it to fix test_session_id_excluded_from_build_run_payload on main and development.
This was referenced Jul 31, 2026
aix-ahmet
added a commit
that referenced
this pull request
Jul 31, 2026
…1021) Commit 9acccf4 (#1013) added session_id to Model._SDK_ONLY_PARAMS so it never leaks into build_run_payload / build_run_url output, but the merge of branch 'test' into development (dc8c4c2) resolved that hunk in favor of the older frozenset, dropping the entry while keeping the feature's tests and comments. Restore it to fix test_session_id_excluded_from_build_run_payload on main and development.
hadi-aix
pushed a commit
that referenced
this pull request
Jul 31, 2026
…1020) Commit 9acccf4 (#1013) added session_id to Model._SDK_ONLY_PARAMS so it never leaks into build_run_payload / build_run_url output, but the merge of branch 'test' into development (dc8c4c2) resolved that hunk in favor of the older frozenset, dropping the entry while keeping the feature's tests and comments. Restore it to fix test_session_id_excluded_from_build_run_payload on main and development.
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.
Runnable resources can already carry a per-run caller identity as
x-user-id; add the run's session alongside it so downstream services cancorrelate a call with the conversation that triggered it.
identifier->x-user-idandsession_id->x-session-idas independent keys: either alone is valid, and withneither present it still returns None so no headers are attached.
session_idis header-only for every runnable (unlikeidentifier,which Agent keeps as an execution-config body field), so the base
_RUN_CONTROL_KEYS excludes it; Model/Tool repeat it in _SDK_ONLY_PARAMS to
also cover the v1 and URL builder paths.
deliberately dropped the id-only
session_idin favour ofsession=, anda look-alike kwarg that only set a header would be a footgun (the existing
TestAgentRunParamsKeys guard enforces this).
Adds unit coverage for header emission (each key alone and both together),
payload exclusion on the v2 + v1 builders, and the tool merge preserving
both run-metadata kwargs.