mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 13:22:11 +03:00
fix(combo): no-auth OpenCode combos use oc/ prefix, not opencode/ (#2901)
The no-auth OpenCode provider has id "opencode" and alias "oc". The combo
builder built qualifiedModel from the provider id ("opencode/big-pickle"), but
parseModel("opencode/...") resolves to the opencode-zen api-key tier via a
manual ALIAS_TO_PROVIDER_ID override — not the no-auth "opencode" provider.
"oc/<model>" resolves correctly.
Rewrite qualifiedModel to the provider alias for no-auth providers (only when
the alias differs from the id), keeping providerId for getModelIsHidden. Aligned
the route test that previously asserted the buggy "opencode/" prefix.
Closes #2901
This commit is contained in:
@@ -618,6 +618,17 @@ export async function getComboBuilderOptions(): Promise<ComboBuilderOptionsPaylo
|
||||
}
|
||||
}
|
||||
|
||||
// #2901: no-auth providers must route under their alias (e.g. "oc"), not
|
||||
// their id — "opencode/<model>" misroutes to the opencode-zen api-key tier
|
||||
// (manual ALIAS_TO_PROVIDER_ID override), while "oc/<model>" resolves to the
|
||||
// no-auth "opencode" provider. Rewrite qualifiedModel to the alias prefix.
|
||||
const routingPrefix = noAuthProvider.alias || providerId;
|
||||
if (routingPrefix !== providerId) {
|
||||
for (const opt of modelMap.values()) {
|
||||
opt.qualifiedModel = `${routingPrefix}/${opt.id}`;
|
||||
}
|
||||
}
|
||||
|
||||
const displayName = (providerEntryName(providerId) ||
|
||||
getProviderDisplayName(providerId, null) ||
|
||||
providerId) as string;
|
||||
|
||||
Reference in New Issue
Block a user