From 717be3f02647e184d8ab09caa950bd1fcd170f4c Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Mon, 1 Sep 2025 05:41:18 -0700 Subject: [PATCH] Fix `grok-code-fast-1` model information and add promo in Announcement banner (#5926) * Fix grok-code-fast-1 info * Add call to action for trying free `grok-code-fast-1` in Announcement banner --- CHANGELOG.md | 5 + package-lock.json | 4 +- package.json | 2 +- .../models/refreshOpenRouterModels.ts | 4 + .../src/components/chat/Announcement.tsx | 140 ++++++++++++------ .../src/components/chat/ChatTextArea.tsx | 14 +- .../src/context/ExtensionStateContext.tsx | 8 + 7 files changed, 124 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03e5cb74..68a0de30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [3.27.0] + +- Fix `grok-code-fast-1` model information +- Add call to action for trying free `grok-code-fast-1` in Announcement banner + ## [3.26.7] - Add 200k context window variant for Claude Sonnet 4 to OpenRouter and Cline providers diff --git a/package-lock.json b/package-lock.json index e79ef6c2..9d2372e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "claude-dev", - "version": "3.26.7", + "version": "3.27.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "claude-dev", - "version": "3.26.7", + "version": "3.27.0", "license": "Apache-2.0", "dependencies": { "@anthropic-ai/sdk": "^0.37.0", diff --git a/package.json b/package.json index a986f039..da2007e7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Cline", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.", - "version": "3.26.7", + "version": "3.27.0", "icon": "assets/icons/icon.png", "engines": { "vscode": "^1.84.0" diff --git a/src/core/controller/models/refreshOpenRouterModels.ts b/src/core/controller/models/refreshOpenRouterModels.ts index d6e12ecd..3d4d1de0 100644 --- a/src/core/controller/models/refreshOpenRouterModels.ts +++ b/src/core/controller/models/refreshOpenRouterModels.ts @@ -189,6 +189,10 @@ export async function refreshOpenRouterModels( modelInfo.maxTokens = 8_192 // 128000 breaks context window truncation modelInfo.contextWindow = 272_000 // openrouter reports 400k but the input limit is actually 400k-128k break + case "x-ai/grok-code-fast-1": + modelInfo.supportsPromptCache = true + modelInfo.cacheReadsPrice = 0.02 + break default: if (rawModel.id.startsWith("openai/")) { modelInfo.cacheReadsPrice = parsePrice(rawModel.pricing?.input_cache_read) diff --git a/webview-ui/src/components/chat/Announcement.tsx b/webview-ui/src/components/chat/Announcement.tsx index b4d8571a..a020d3b7 100644 --- a/webview-ui/src/components/chat/Announcement.tsx +++ b/webview-ui/src/components/chat/Announcement.tsx @@ -1,7 +1,12 @@ import { Accordion, AccordionItem } from "@heroui/react" +import { EmptyRequest } from "@shared/proto/cline/common" import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react" -import { CSSProperties, memo } from "react" +import { CSSProperties, memo, useState } from "react" +import { useClineAuth } from "@/context/ClineAuthContext" +import { useExtensionState } from "@/context/ExtensionStateContext" +import { AccountServiceClient } from "@/services/grpc-client" import { getAsVar, VSC_DESCRIPTION_FOREGROUND, VSC_INACTIVE_SELECTION_BACKGROUND } from "@/utils/vscStyles" +import { useApiConfigurationHandlers } from "../settings/utils/useApiConfigurationHandlers" interface AnnouncementProps { version: string @@ -36,6 +41,37 @@ Patch releases (3.19.1 → 3.19.2) will not trigger new announcements. */ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => { const minorVersion = version.split(".").slice(0, 2).join(".") // 2.0.0 -> 2.0 + const { clineUser } = useClineAuth() + const { apiConfiguration, openRouterModels, setShowChatModelSelector } = useExtensionState() + const user = apiConfiguration?.clineAccountId ? clineUser : undefined + const { handleFieldsChange } = useApiConfigurationHandlers() + + const [didClickGrokCodeButton, setDidClickGrokCodeButton] = useState(false) + + const setGrokCodeFast1 = () => { + const modelId = "x-ai/grok-code-fast-1" + // set both plan and act modes to use grok-code-fast-1 + handleFieldsChange({ + planModeOpenRouterModelId: modelId, + actModeOpenRouterModelId: modelId, + planModeOpenRouterModelInfo: openRouterModels[modelId], + actModeOpenRouterModelInfo: openRouterModels[modelId], + planModeApiProvider: "cline", + actModeApiProvider: "cline", + }) + + setTimeout(() => { + setDidClickGrokCodeButton(true) + setShowChatModelSelector(true) + }, 10) + } + + const handleShowAccount = () => { + AccountServiceClient.accountLoginClicked(EmptyRequest.create()).catch((err) => + console.error("Failed to get login URL:", err), + ) + } + return (
/deep-planning slash command transforms Cline into an architect who
- investigates your codebase, asks clarifying questions, and creates a comprehensive plan before writing any
- code.
- grok-code-fast-1 Until Sept 10th
+
+
+ We partnered with xAI to help build this model from the ground up for agentic coding, and so far–community feedback
+ has been incredible. xAI is continuously improving the model's intelligence with more usage, so give it a try today
+ and let us know what you think! Read more about it here:{" "}
+ https://x.ai/news/grok-code-fast-1
+
+ {user ? (
+ !didClickGrokCodeButton ? (
+ /deep-planning slash command transforms Cline into an
+ architect who investigates your codebase, asks clarifying questions, and creates a comprehensive
+ plan before writing any code.
+
Join us on{" "}
diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx
index 8ffa3c12..a7799f70 100644
--- a/webview-ui/src/components/chat/ChatTextArea.tsx
+++ b/webview-ui/src/components/chat/ChatTextArea.tsx
@@ -279,8 +279,16 @@ const ChatTextArea = forwardRef