diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 2930678e8a5..a2e13a75d82 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -185,6 +185,14 @@ function modelSupportsReasoning( if (!model) { return false; } + if (model.completionOptions?.reasoning !== undefined) { + // Reasoning support is forced at the config level. Model might not necessarily support it though! + return model.completionOptions.reasoning; + } + // Seems our current way of disabling reasoning is not working for grok code so results in useless lightbulb + // if (model.model.includes("grok-code")) { + // return true; + // } // do not turn reasoning on by default for claude 3 models if ( model.model.includes("claude") && @@ -196,10 +204,7 @@ function modelSupportsReasoning( if (model.model.includes("deepseek-r")) { return true; } - if (model.completionOptions?.reasoning) { - // Reasoning support is forced at the config level. Model might not necessarily support it though! - return true; - } + return false; } diff --git a/core/llm/defaultSystemMessages.ts b/core/llm/defaultSystemMessages.ts index 43ab7990ec7..430a6777d84 100644 --- a/core/llm/defaultSystemMessages.ts +++ b/core/llm/defaultSystemMessages.ts @@ -63,7 +63,7 @@ export const DEFAULT_AGENT_SYSTEM_MESSAGE = `\ You are in agent mode. - If you need to use multiple tools, you can call multiple read only tools simultaneously. + If you need to use multiple tools, you can call multiple read-only tools simultaneously. ${CODEBLOCK_FORMATTING_INSTRUCTIONS} diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 58775491fa6..5e4f26241a0 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -116,7 +116,9 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = }, xAI: (model) => { const lowerCaseModel = model.toLowerCase(); - return ["grok-3", "grok-4"].some((val) => lowerCaseModel.includes(val)); + return ["grok-3", "grok-4", "grok-code"].some((val) => + lowerCaseModel.includes(val), + ); }, bedrock: (model) => { if ( @@ -389,6 +391,7 @@ export function isRecommendedAgentModel(modelName: string): boolean { [/gpt-5/], [/claude/, /sonnet/, /3\.7|3-7|-4/], [/claude/, /opus/, /-4/], + [/grok-code/], [/claude/, /4-5/], ]; for (const combo of recs) { diff --git a/gui/src/components/ModeSelect/ModeSelect.tsx b/gui/src/components/ModeSelect/ModeSelect.tsx index 4a9c2616aa1..8b69bca2065 100644 --- a/gui/src/components/ModeSelect/ModeSelect.tsx +++ b/gui/src/components/ModeSelect/ModeSelect.tsx @@ -6,7 +6,6 @@ import { } from "@heroicons/react/24/outline"; import { MessageModes } from "core"; import { isRecommendedAgentModel } from "core/llm/toolSupport"; -import { capitalize } from "lodash"; import { useCallback, useEffect, useMemo } from "react"; import { useAuth } from "../../context/Auth"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; @@ -89,14 +88,14 @@ export function ModeSelect() { } }, [mode, isLocalAgent, dispatch]); - const notGreatAtAgent = ( + const notGreatAtAgent = (mode: string) => ( <> @@ -162,7 +161,7 @@ export function ModeSelect() { - {!isGoodAtAgentMode && notGreatAtAgent} + {!isGoodAtAgentMode && notGreatAtAgent("Plan")} @@ -181,7 +180,7 @@ export function ModeSelect() { - {!isGoodAtAgentMode && notGreatAtAgent} + {!isGoodAtAgentMode && notGreatAtAgent("Agent")}