mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 06:42:12 +03:00
buildStaticProviderEntry() keyed static-catalog combo entries with opts.providerId (the OC-gate-prefixed id, e.g. "opencode-omniroute") instead of opts.omnirouteProviderId (the bare server-facing id, "omniroute") that the dynamic provider.models() hook already uses per #6859. OC dispatches the static models-map key verbatim as the `model` field of the outbound request, so a bare-slug combo key doubled up to "opencode-omniroute/opencode-omniroute/<slug>" and OmniRoute's parseModel() resolved credentials for the nonexistent provider "opencode-omniroute" instead of "omniroute". Regular models were unaffected because their raw ids already contain a slash, skipping the prefixing branch entirely. Swap the buildComboKey() call to use opts.omnirouteProviderId, mirroring the dynamic hook. Adds a permanent regression test to provider-id-routing.test.ts and aligns the pre-existing hardcoded "opencode-omniroute/<combo-slug>" assertions in config-shim.test.ts that had codified the buggy prefix. Co-authored-by: Fábio Silva <13762289+fabioluissilva@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
287802cf86
commit
74dd34fe99
@@ -3939,7 +3939,16 @@ export function buildStaticProviderEntry(
|
||||
// `combo/MASTER` as provider=`combo`. Slug collisions across
|
||||
// combos are disambiguated with a short UUID-prefix suffix; see
|
||||
// `buildComboKey` for the policy.
|
||||
models[buildComboKey(combo, usedComboKeys, opts.providerId)] = entry;
|
||||
// #6859: server-facing key — NOT the OC-gate-prefixed `opts.providerId`.
|
||||
// OC dispatches the static-catalog `models` map key VERBATIM as the
|
||||
// `model` field of the outbound `@ai-sdk/openai-compatible` request
|
||||
// (only the top-level `provider["<id>"]` segment is stripped for
|
||||
// routing) — so a bare-slug combo key prefixed with the OC-gated
|
||||
// `opts.providerId` reaches OmniRoute's server doubled
|
||||
// (`opencode-omniroute/opencode-omniroute/<slug>`), and `parseModel()`
|
||||
// resolves credentials for the nonexistent provider `opencode-omniroute`
|
||||
// instead of `omniroute`. See #7976.
|
||||
models[buildComboKey(combo, usedComboKeys, opts.omnirouteProviderId)] = entry;
|
||||
|
||||
// Make this combo's resolved entry available to parent combos
|
||||
// that reference it via combo-ref. Use the friendly name since
|
||||
|
||||
Reference in New Issue
Block a user