mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-21 02:06:00 +00:00
fix(provider): preserve OpenRouter small model effort (#35478)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
co-authored by
Aiden Cline
parent
e9f5d34096
commit
68f225a11d
@@ -1240,9 +1240,6 @@ 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 } }
|
||||
}
|
||||
|
||||
@@ -4638,12 +4638,12 @@ describe("ProviderTransform.smallOptions - gpt-5 chat/search", () => {
|
||||
}
|
||||
})
|
||||
|
||||
test("ProviderTransform.smallOptions disables OpenRouter reasoning when the weakest effort is low", () => {
|
||||
test("ProviderTransform.smallOptions preserves the weakest OpenRouter reasoning effort", () => {
|
||||
expect(
|
||||
ProviderTransform.smallOptions({
|
||||
providerID: "openrouter",
|
||||
api: {
|
||||
id: "anthropic/claude-sonnet-4.6",
|
||||
id: "google/gemini-3.5-flash",
|
||||
npm: "@openrouter/ai-sdk-provider",
|
||||
},
|
||||
variants: {
|
||||
@@ -4652,7 +4652,7 @@ test("ProviderTransform.smallOptions disables OpenRouter reasoning when the weak
|
||||
high: { reasoning: { effort: "high" } },
|
||||
},
|
||||
} as any),
|
||||
).toEqual({ reasoning: { effort: "none" } })
|
||||
).toEqual({ reasoning: { effort: "low" } })
|
||||
})
|
||||
|
||||
describe("ProviderTransform.smallOptions - google thinking controls", () => {
|
||||
|
||||
Reference in New Issue
Block a user