Skip to content

Commit c8b5cdf

Browse files
authored
Omit reasoning params for non-reasoning models (#2932)
1 parent cb29e9d commit c8b5cdf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/khaki-months-float.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Omit reasoning params for non-reasoning models

src/api/providers/openrouter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
openRouterDefaultModelInfo,
1010
PROMPT_CACHING_MODELS,
1111
OPTIONAL_PROMPT_CACHING_MODELS,
12+
REASONING_MODELS,
1213
} from "../../shared/api"
1314
import { convertToOpenAiMessages } from "../transform/openai-format"
1415
import { ApiStreamChunk } from "../transform/stream"
@@ -147,7 +148,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
147148
}),
148149
// This way, the transforms field will only be included in the parameters when openRouterUseMiddleOutTransform is true.
149150
...((this.options.openRouterUseMiddleOutTransform ?? true) && { transforms: ["middle-out"] }),
150-
...(reasoningEffort && { reasoning: { effort: reasoningEffort } }),
151+
...(REASONING_MODELS.has(modelId) && reasoningEffort && { reasoning: { effort: reasoningEffort } }),
151152
}
152153

153154
const stream = await this.client.chat.completions.create(completionParams)

0 commit comments

Comments
 (0)