fix(core): send x-opencode-session header on session runner requests - #47473
Open
pengzh1 wants to merge 1 commit into
Open
fix(core): send x-opencode-session header on session runner requests#47473pengzh1 wants to merge 1 commit into
pengzh1 wants to merge 1 commit into
Conversation
The V2 session runner only sent x-session-affinity and X-Session-Id on provider requests, so requests leaving through the Node fetch transport reached opencode providers without the x-opencode-session header the service expects. Add it alongside the existing correlation headers.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate found:
The current PR (47473) appears to be a focused fix for the session runner's LLM requests missing the |
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.
Issue for this PR
Closes #47438
Type of change
What does this PR do?
Requests made by the V2 session runner only carried
x-session-affinityandX-Session-Id. #44752 fixed the header set on the request path inpackages/opencode/src/session/llm/request.ts, but the runner builds its own headers inpackages/core/src/session/runner/llm.tsand never got thex-opencode-sessionheader, so those requests reach opencode providers with only the transport's default user agent (Node fetch) and no session identifier. That matches the provider report in the issue.This adds
x-opencode-sessionalongside the existing correlation headers in the runner, so both request paths now identify the session the same way.How did you verify your code works?
Added
x-opencode-sessionto the existing "adds session correlation headers to model requests" test inpackages/core/test/session-runner.test.tsand confirmed it fails against the current runner with exactly that key missing from the received headers, then passes after the one-line fix. The fullpackages/coresuite passes: 1091 pass, 7 skip (the oneNpm.addfailure in the full run is an unrelated 5s timeout that passes in isolation).Screenshots / recordings
N/A
Checklist