Repository navigation
feat(opencode-plugin): headers option for header-based auth proxies (CF Access) - #18397
Open
misumisumi wants to merge 2 commits into
Open
misumisumi wants to merge 2 commits into
misumisumi wants to merge 2 commits into
Conversation
misumisumi
marked this pull request as ready for review
October 28, 2026 03:45
…es (CF Access) Add a 'headers' option to both @omniroute/opencode-plugin and @omniroute/opencode-plugin-v2 so gateway fetches (models, combos, pricing, free-tier, providers) can carry extra HTTP headers such as Cloudflare Access client id/secret. Headers are merged into the request without overriding the bearer token. Co-Authored-By: Claude <noreply@anthropic.com>
misumisumi
force-pushed
the
feat/opencode-plugin-header-support
branch
from
October 28, 2026 03:49
80ddc4f to
9b1c822
Compare
buildProviderPayload built the provider info from baseURL/apiKey but dropped opts.headers, so the catalog fetch carried Cloudflare Access headers while the actual inference request did not and the gateway answered 403. Include headers in the provider payload so chat requests reach header-gated proxies. Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
headersplugin option to both@omniroute/opencode-plugin(v1) and@omniroute/opencode-plugin-v2, so every gateway fetch (models, combos, pricing, free-tier, providers) can carry extra HTTP headers.CF-Access-Client-Id/CF-Access-Client-Secret). Without this,/v1/modelsinference worked but catalog discovery returned 403 and the model list stayed empty.Related Issues
Target Branch
release/v3.8.xbranch (release/v3.8.53), notmainv4-featurelabel and re-targeted to the v4 channel (develop) when it opens — they are not closedDesign
@omniroute/opencode-plugin-v2src/options.ts: newheadersoption (z.record(z.string(), z.string())), threaded throughtoResolvedOptions.src/catalog.ts:ResolvedOptions.headers.src/index.ts: passesresolved.headersto the models, combos, providers, and enrichment fetchers.src/catalog.tsbuildProviderPayload: includesopts.headerson the published provider so the actual inference request carries the same headers as the catalog fetch (otherwise chat requests 403 behind header-gated proxies).src/shared/{models-map,combos-map,usable,enrich}.ts: fetchers accept an optionalheadersargument and merge it into the request.@omniroute/opencode-plugin(v1)src/index.ts: newheadersoption; resolved auth carriesheaders; all five fetchers (models, combos, enrichment, compression-meta, providers) accept and merge it; all call sites pass it.Accept→ user headers →Authorization, so a user-supplied header can never override the bearer token.headersleaves requests unchanged.Validation
npm run lint(clean; only a pre-existing unused-suppressions notice)Focused loop run:
Tests Added Or Updated
headersargument is additive and leaves requests unchanged when absent.Reviewer Notes
Authorization, so the bearer token always wins.403from/v1/modelsbefore this change (empty catalog) and publishes the catalog after it onceheadersis set.