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:
diegosouzapw
2026-05-31 01:18:08 -03:00
parent bafcf72be7
commit e63fbed64b
4 changed files with 78 additions and 1 deletions

View File

@@ -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;