Skip to content

Commit c924cfb

Browse files
committed
Omit reasoning params for non-reasoning models
1 parent 586e43b commit c924cfb

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
@@ -8,6 +8,7 @@ import {
88
openRouterDefaultModelInfo,
99
PROMPT_CACHING_MODELS,
1010
OPTIONAL_PROMPT_CACHING_MODELS,
11+
REASONING_MODELS,
1112
} from "../../shared/api"
1213
import { convertToOpenAiMessages } from "../transform/openai-format"
1314
import { ApiStreamChunk } from "../transform/stream"
@@ -138,7 +139,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
138139
}),
139140
// This way, the transforms field will only be included in the parameters when openRouterUseMiddleOutTransform is true.
140141
...((this.options.openRouterUseMiddleOutTransform ?? true) && { transforms: ["middle-out"] }),
141-
...(reasoningEffort && { reasoning: { effort: reasoningEffort } }),
142+
...(REASONING_MODELS.has(modelId) && reasoningEffort && { reasoning: { effort: reasoningEffort } }),
142143
}
143144

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

0 commit comments

Comments
 (0)