Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/api/transform/reasoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,21 @@ export const getRooReasoning = ({
settings,
}: GetModelReasoningOptions): RooReasoningParams | undefined => {
// Check if model supports reasoning effort
if (!model.supportsReasoningEffort) return undefined
if (!model.supportsReasoningEffort) {
return undefined
}

if (model.requiredReasoningEffort) {
const effort: GetModelReasoningOptions["reasoningEffort"] = reasoningEffort ?? "medium"
const validEfforts: ReasoningEffortExtended[] = ["low", "medium", "high"]

// Honor the provided effort if it's valid, otherwise let the model choose.
if (validEfforts.includes(effort as ReasoningEffortExtended)) {
return { enabled: true, effort: effort as ReasoningEffortExtended }
} else {
return { enabled: true }
}
}

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