Skip to content

Commit ffff38b

Browse files
authored
Always enabled reasoning for models that require it (#9836)
1 parent 29385e0 commit ffff38b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/api/transform/reasoning.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,18 @@ export const getRooReasoning = ({
5252
settings,
5353
}: GetModelReasoningOptions): RooReasoningParams | undefined => {
5454
// Check if model supports reasoning effort
55-
if (!model.supportsReasoningEffort) return undefined
55+
if (!model.supportsReasoningEffort) {
56+
return undefined
57+
}
58+
59+
if (model.requiredReasoningEffort) {
60+
// Honor the provided effort if it's valid, otherwise let the model choose.
61+
if (reasoningEffort && reasoningEffort !== "disable" && reasoningEffort !== "minimal") {
62+
return { enabled: true, effort: reasoningEffort }
63+
} else {
64+
return { enabled: true }
65+
}
66+
}
5667

5768
// Explicit off switch from settings: always send disabled for back-compat and to
5869
// prevent automatic reasoning when the toggle is turned off.

0 commit comments

Comments
 (0)