fix(opencode-go): route every responses-only model (incl. thinking variants) to /responses
Derive responses-only routing from the model registry's targetFormat instead of hardcoding model checks, and strip thinking suffixes when looking up models in providerModels so variants like gpt-5.6-luna(high) are routed correctly to /responses.
This commit is contained in:
@@ -27,11 +27,14 @@ const DOT_VERSION_PROVIDERS = new Set(["kr", "kiro"]);
|
||||
// ("claude-sonnet-4-5" ~= "claude-sonnet-4.5"). Other providers use exact match only.
|
||||
function findModel(models, modelId, aliasOrId) {
|
||||
if (!models) return undefined;
|
||||
const found = models.find(m => m.id === modelId);
|
||||
const baseModelId = typeof modelId === "string"
|
||||
? modelId.replace(/\([^()]+\)\s*$/, "").trim()
|
||||
: modelId;
|
||||
const found = models.find(m => m.id === modelId || m.id === baseModelId);
|
||||
if (found) return found;
|
||||
if (!DOT_VERSION_PROVIDERS.has(aliasOrId)) return undefined;
|
||||
const normalized = normalizeModelId(modelId);
|
||||
if (normalized === modelId) return undefined;
|
||||
const normalized = normalizeModelId(baseModelId);
|
||||
if (normalized === baseModelId) return undefined;
|
||||
return models.find(m => m.id === normalized);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user