From 5ce38744250f96d61a5ae3ce3f2f07531c0e9803 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Mon, 8 Dec 2025 12:03:35 -0700 Subject: [PATCH] feat: configure tool preferences for xAI models Add includedTools and excludedTools to all xAI model definitions: - Enable search_replace tool for better file editing compatibility - Exclude apply_diff tool which may not work well with these models --- packages/types/src/providers/xai.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/types/src/providers/xai.ts b/packages/types/src/providers/xai.ts index ec845d2c6b9..3c4b1e0e538 100644 --- a/packages/types/src/providers/xai.ts +++ b/packages/types/src/providers/xai.ts @@ -17,6 +17,8 @@ export const xaiModels = { cacheWritesPrice: 0.02, cacheReadsPrice: 0.02, description: "xAI's Grok Code Fast model with 256K context window", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, "grok-4-1-fast-reasoning": { maxTokens: 65_536, @@ -30,6 +32,8 @@ export const xaiModels = { cacheReadsPrice: 0.05, description: "xAI's Grok 4.1 Fast model with 2M context window, optimized for high-performance agentic tool calling with reasoning", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, "grok-4-1-fast-non-reasoning": { maxTokens: 65_536, @@ -43,6 +47,8 @@ export const xaiModels = { cacheReadsPrice: 0.05, description: "xAI's Grok 4.1 Fast model with 2M context window, optimized for high-performance agentic tool calling", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, "grok-4-fast-reasoning": { maxTokens: 65_536, @@ -56,6 +62,8 @@ export const xaiModels = { cacheReadsPrice: 0.05, description: "xAI's Grok 4 Fast model with 2M context window, optimized for high-performance agentic tool calling with reasoning", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, "grok-4-fast-non-reasoning": { maxTokens: 65_536, @@ -69,6 +77,8 @@ export const xaiModels = { cacheReadsPrice: 0.05, description: "xAI's Grok 4 Fast model with 2M context window, optimized for high-performance agentic tool calling", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, "grok-4-0709": { maxTokens: 8192, @@ -81,6 +91,8 @@ export const xaiModels = { cacheWritesPrice: 0.75, cacheReadsPrice: 0.75, description: "xAI's Grok-4 model with 256K context window", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, "grok-3-mini": { maxTokens: 8192, @@ -95,6 +107,8 @@ export const xaiModels = { description: "xAI's Grok-3 mini model with 128K context window", supportsReasoningEffort: ["low", "high"], reasoningEffort: "low", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, "grok-3": { maxTokens: 8192, @@ -107,5 +121,7 @@ export const xaiModels = { cacheWritesPrice: 0.75, cacheReadsPrice: 0.75, description: "xAI's Grok-3 model with 128K context window", + includedTools: ["search_replace"], + excludedTools: ["apply_diff"], }, } as const satisfies Record