Skip to content

Commit ba9a6a1

Browse files
committed
Always enabled reasoning for models that require it
1 parent 29385e0 commit ba9a6a1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/api/transform/reasoning.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,23 @@ 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+
const providedEffort: GetModelReasoningOptions["reasoningEffort"] = reasoningEffort ?? "medium"
61+
const validEfforts: ReasoningEffortExtended[] = ["low", "medium", "high"]
62+
63+
// Honor the provided effort if it's valid, otherwise default to "medium".
64+
const effectiveEffort: ReasoningEffortExtended = validEfforts.includes(
65+
providedEffort as ReasoningEffortExtended,
66+
)
67+
? (providedEffort as ReasoningEffortExtended)
68+
: "medium"
69+
70+
return { enabled: true, effort: effectiveEffort }
71+
}
5672

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

0 commit comments

Comments
 (0)