Fix upstream Content-Type duplication and provider routing - #14
Merged
Conversation
Build outbound JSON requests with a single application/json header so streaming providers like OpenCode Go stop returning 415, route prefixed and upstream_id model aliases to the intended gateway, and stop falling back to the default provider for unknown models.
jatmn
force-pushed
the
fix/upstream-headers-and-provider-routing
branch
from
August 6, 2026 01:32
3f9b234 to
40827cf
Compare
Only strip provider prefixes when the prefix resolves to the selected gateway so OpenRouter vendor/model slugs stay intact, and return a dedicated 502 message when an explicit model cannot be routed.
Restore single-provider cold-start routing for unlisted slugs while keeping multi-provider unknown-model 502s; list upstream_id aliases in /models; use generic no-provider errors for codex-auto-review and empty model fields.
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
Content-Type: application/jsonheader, fixing OpenCode Go streaming 415 errors caused by reqwest appending a duplicate value.hicap/...,opencode-go/...) and catalogupstream_idaliases so gateway-selected models never fall back to the default provider.hicap/grok-4.3→grok-4.3).Test plan
cargo test(134 tests pass)opencode-go/deepseek-v4-flashstreaming via warp returns 200hicap/grok-4.3andhicap/grok-4.5return 200 via HiCap APIgrok-4.3) return 502 instead of hitting default provider