mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
feat: add "off" option to reasoning effort dropdown
- Added "off" as a valid option in ReasoningEffortWithMinimal type - Updated ThinkingBudget component to show "off" option in dropdown - Modified shouldUseReasoningEffort to return false when set to "off" - Updated API transform logic to handle "off" value properly - Added translation for "off" option in English locale Fixes #8624
This commit is contained in:
parent
3a47c55a2e
commit
f429e4acbf
5 changed files with 15 additions and 5 deletions
|
|
@ -14,7 +14,11 @@ export type ReasoningEffort = z.infer<typeof reasoningEffortsSchema>
|
|||
* ReasoningEffortWithMinimal
|
||||
*/
|
||||
|
||||
export const reasoningEffortWithMinimalSchema = z.union([reasoningEffortsSchema, z.literal("minimal")])
|
||||
export const reasoningEffortWithMinimalSchema = z.union([
|
||||
reasoningEffortsSchema,
|
||||
z.literal("minimal"),
|
||||
z.literal("off"),
|
||||
])
|
||||
|
||||
export type ReasoningEffortWithMinimal = z.infer<typeof reasoningEffortWithMinimalSchema>
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export const getOpenRouterReasoning = ({
|
|||
shouldUseReasoningBudget({ model, settings })
|
||||
? { max_tokens: reasoningBudget }
|
||||
: shouldUseReasoningEffort({ model, settings })
|
||||
? reasoningEffort
|
||||
? reasoningEffort && reasoningEffort !== "off"
|
||||
? { effort: reasoningEffort }
|
||||
: undefined
|
||||
: undefined
|
||||
|
|
@ -57,7 +57,7 @@ export const getOpenAiReasoning = ({
|
|||
|
||||
// If model has reasoning effort capability, return object even if effort is undefined
|
||||
// This preserves the reasoning_effort field in the API call
|
||||
if (reasoningEffort === "minimal") {
|
||||
if (reasoningEffort === "minimal" || reasoningEffort === "off") {
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,11 @@ export const shouldUseReasoningEffort = ({
|
|||
return false
|
||||
}
|
||||
|
||||
// If reasoningEffort is explicitly set to "off", reasoning should be disabled
|
||||
if (settings?.reasoningEffort === "off") {
|
||||
return false
|
||||
}
|
||||
|
||||
// Otherwise, use reasoning if:
|
||||
// 1. Model supports reasoning effort AND settings provide reasoning effort, OR
|
||||
// 2. Model itself has a reasoningEffort property
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ export const ThinkingBudget = ({ apiConfiguration, setApiConfigurationField, mod
|
|||
// Build available reasoning efforts list
|
||||
const baseEfforts = [...reasoningEfforts] as ReasoningEffortWithMinimal[]
|
||||
const availableReasoningEfforts: ReadonlyArray<ReasoningEffortWithMinimal> = showMinimalOption
|
||||
? (["minimal", ...baseEfforts] as ReasoningEffortWithMinimal[])
|
||||
: baseEfforts
|
||||
? (["off", "minimal", ...baseEfforts] as ReasoningEffortWithMinimal[])
|
||||
: (["off", ...baseEfforts] as ReasoningEffortWithMinimal[])
|
||||
|
||||
// Default reasoning effort - use model's default if available
|
||||
// GPT-5 models have "medium" as their default in the model configuration
|
||||
|
|
|
|||
|
|
@ -465,6 +465,7 @@
|
|||
},
|
||||
"reasoningEffort": {
|
||||
"label": "Model Reasoning Effort",
|
||||
"off": "Off",
|
||||
"minimal": "Minimal (Fastest)",
|
||||
"low": "Low",
|
||||
"medium": "Medium",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue