Skip to content

Commit 6aad840

Browse files
authored
feat: upgrade grok code fast 1 (#8475)
* fix: grok code fast tweaks * fix: revert thinking addition for grok code
1 parent 4a38ee5 commit 6aad840

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

core/llm/autodetect.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ function modelSupportsReasoning(
185185
if (!model) {
186186
return false;
187187
}
188+
if (model.completionOptions?.reasoning !== undefined) {
189+
// Reasoning support is forced at the config level. Model might not necessarily support it though!
190+
return model.completionOptions.reasoning;
191+
}
192+
// Seems our current way of disabling reasoning is not working for grok code so results in useless lightbulb
193+
// if (model.model.includes("grok-code")) {
194+
// return true;
195+
// }
188196
// do not turn reasoning on by default for claude 3 models
189197
if (
190198
model.model.includes("claude") &&
@@ -196,10 +204,7 @@ function modelSupportsReasoning(
196204
if (model.model.includes("deepseek-r")) {
197205
return true;
198206
}
199-
if (model.completionOptions?.reasoning) {
200-
// Reasoning support is forced at the config level. Model might not necessarily support it though!
201-
return true;
202-
}
207+
203208
return false;
204209
}
205210

core/llm/defaultSystemMessages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const DEFAULT_AGENT_SYSTEM_MESSAGE = `\
6363
<important_rules>
6464
You are in agent mode.
6565
66-
If you need to use multiple tools, you can call multiple read only tools simultaneously.
66+
If you need to use multiple tools, you can call multiple read-only tools simultaneously.
6767
6868
${CODEBLOCK_FORMATTING_INSTRUCTIONS}
6969

core/llm/toolSupport.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
116116
},
117117
xAI: (model) => {
118118
const lowerCaseModel = model.toLowerCase();
119-
return ["grok-3", "grok-4"].some((val) => lowerCaseModel.includes(val));
119+
return ["grok-3", "grok-4", "grok-code"].some((val) =>
120+
lowerCaseModel.includes(val),
121+
);
120122
},
121123
bedrock: (model) => {
122124
if (
@@ -389,6 +391,7 @@ export function isRecommendedAgentModel(modelName: string): boolean {
389391
[/gpt-5/],
390392
[/claude/, /sonnet/, /3\.7|3-7|-4/],
391393
[/claude/, /opus/, /-4/],
394+
[/grok-code/],
392395
[/claude/, /4-5/],
393396
];
394397
for (const combo of recs) {

gui/src/components/ModeSelect/ModeSelect.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from "@heroicons/react/24/outline";
77
import { MessageModes } from "core";
88
import { isRecommendedAgentModel } from "core/llm/toolSupport";
9-
import { capitalize } from "lodash";
109
import { useCallback, useEffect, useMemo } from "react";
1110
import { useAuth } from "../../context/Auth";
1211
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
@@ -89,14 +88,14 @@ export function ModeSelect() {
8988
}
9089
}, [mode, isLocalAgent, dispatch]);
9190

92-
const notGreatAtAgent = (
91+
const notGreatAtAgent = (mode: string) => (
9392
<>
9493
<ToolTip
9594
style={{
9695
zIndex: 200001, // in front of listbox
9796
}}
9897
className="flex items-center gap-1"
99-
content={`${capitalize(mode)} might not work well with this model.`}
98+
content={`${mode} might not work well with this model.`}
10099
>
101100
<ExclamationTriangleIcon className="text-warning h-2.5 w-2.5" />
102101
</ToolTip>
@@ -162,7 +161,7 @@ export function ModeSelect() {
162161
<InformationCircleIcon className="h-2.5 w-2.5 flex-shrink-0" />
163162
</ToolTip>
164163
</div>
165-
{!isGoodAtAgentMode && notGreatAtAgent}
164+
{!isGoodAtAgentMode && notGreatAtAgent("Plan")}
166165
<CheckIcon
167166
className={`ml-auto h-3 w-3 ${mode === "plan" ? "" : "opacity-0"}`}
168167
/>
@@ -181,7 +180,7 @@ export function ModeSelect() {
181180
<InformationCircleIcon className="h-2.5 w-2.5 flex-shrink-0" />
182181
</ToolTip>
183182
</div>
184-
{!isGoodAtAgentMode && notGreatAtAgent}
183+
{!isGoodAtAgentMode && notGreatAtAgent("Agent")}
185184
<CheckIcon
186185
className={`ml-auto h-3 w-3 ${mode === "agent" ? "" : "opacity-0"}`}
187186
/>

0 commit comments

Comments
 (0)