fix(opencode): generate reasoning variants for all OpenRouter models. (#30332)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
@@ -703,12 +703,11 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
||||
|
||||
switch (model.api.npm) {
|
||||
case "@openrouter/ai-sdk-provider":
|
||||
if (!id.includes("gpt") && !id.includes("gemini-3") && !id.includes("claude")) return {}
|
||||
return Object.fromEntries(
|
||||
(id.includes("gpt") ? openaiCompatibleReasoningEfforts(id) : OPENAI_EFFORTS).map((effort) => [
|
||||
effort,
|
||||
{ reasoning: { effort } },
|
||||
]),
|
||||
(model.api.id.startsWith("openai/") || id.includes("gpt")
|
||||
? openaiCompatibleReasoningEfforts(model.api.id)
|
||||
: WIDELY_SUPPORTED_EFFORTS
|
||||
).map((effort) => [effort, { reasoning: { effort } }]),
|
||||
)
|
||||
|
||||
case "ai-gateway-provider": {
|
||||
@@ -1202,6 +1201,9 @@ export function smallOptions(model: Provider.Model) {
|
||||
return mergeDeep(base, small)
|
||||
}
|
||||
if (model.providerID === "openrouter" || model.providerID === "llmgateway") {
|
||||
if (model.providerID === "openrouter" && small.reasoning?.effort === "low") {
|
||||
return { reasoning: { effort: "none" } }
|
||||
}
|
||||
if (Object.keys(small).length === 0 && model.api.id.includes("google")) {
|
||||
return { reasoning: { enabled: false } }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user