Repository navigation
fix(executors): synthesize x-opencode-request for custom-named OpenCode providers (#4465) - #4476
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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.
Closes #4465
Problem
The OpenCode CLI only emits the
x-opencode-*header set when the provider id starts withopencode. For a custom-named provider (e.g.omniroute) it instead sendsx-session-affinity/x-session-id— which #4022 already maps ontox-opencode-session— but it sends no equivalent forx-opencode-request, so that request-correlation id was silently dropped, putting custom-named-provider users at a disadvantage on theopencode.aiupstream.Fix
OpencodeExecutor.buildHeadersnow synthesizes a freshx-opencode-request(viarandomUUID()) only on the session-affinity fallback path (i.e. exactly the custom-named-provider case), and only when the client did not already send one.Intentionally scoped
x-opencode-client/x-opencode-projectare not fabricated. There is no client source to forward for custom-named providers, and their valid values are opencode-internal — inventing them risks upstream rejection (and is unverifiable by a unit test, per Hard Rule fix(ci): add environment for npm token access #18). They remain forward-only (preserved when the client does send them).opencode, which controls its own request id) is untouched.DefaultExecutoris untouched (avoids leaking synthesized metadata to arbitrary third-party upstreams).Tests (TDD, RED→GREEN)
Added 6 cases to
tests/unit/opencode-executor.test.ts(opencode request-id synthesis for custom-named providers (#4465)):x-opencode-requestwhen only session-affinity is present (RED before fix)x-opencode-requestover the synthesized onex-opencode-client/x-opencode-projectx-opencode-sessionpathnode --test opencode-executor.test.ts→ 45/45 pass.typecheck:coreclean. ESLint 0 errors (no new warnings).