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 (
@@ -44,52 +80,62 @@ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {

🎉{" "}New in v{minorVersion}

- - - -
    -
  • - 1M Context for Claude Sonnet 4: Cline/OpenRouter users get instant access, Anthropic users need - Tier 4, and Bedrock users must be on a supported region. -
  • -
  • - Optimized for Claude 4: Cline is now optimized to work with the Claude 4 family of models, - resulting in improved performance, reliability, and new capabilities. -
  • -
  • - Workflows: Create and manage workflow files that can be injected into conversations via slash - commands, making it easy to automate repetitive tasks. -
  • -
-
-
+ + Free 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 ? ( + + Try grok-code-fast-1 + + ) : null + ) : ( + + Sign Up with Cline + + )} +
+ + +
    +
  • + Focus Chain: Keeps cline focused on long-horizon tasks with automatic todo list management, + breaking down complex tasks into manageable steps with real-time progress tracking and passive + reminders. +
  • +
  • + Auto Compact: Auto summarizes your task and next steps when your conversation approaches + the model's context window limit. This significantly helps Cline stay on track for long task + sessions! +
  • +
  • + Deep Planning: New /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. +
  • +
  • + 1M Context for Claude Sonnet 4: Cline/OpenRouter users get instant access, Anthropic users + need Tier 4, and Bedrock users must be on a supported region. +
  • +
+
+
+

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( }, ref, ) => { - const { mode, apiConfiguration, openRouterModels, platform, localWorkflowToggles, globalWorkflowToggles } = - useExtensionState() + const { + mode, + apiConfiguration, + openRouterModels, + platform, + localWorkflowToggles, + globalWorkflowToggles, + showChatModelSelector: showModelSelector, + setShowChatModelSelector: setShowModelSelector, + } = useExtensionState() const [isTextAreaFocused, setIsTextAreaFocused] = useState(false) const [isDraggingOver, setIsDraggingOver] = useState(false) const [gitCommits, setGitCommits] = useState([]) @@ -304,7 +312,7 @@ const ChatTextArea = forwardRef( const [justDeletedSpaceAfterSlashCommand, setJustDeletedSpaceAfterSlashCommand] = useState(false) const [intendedCursorPosition, setIntendedCursorPosition] = useState(null) const contextMenuContainerRef = useRef(null) - const [showModelSelector, setShowModelSelector] = useState(false) + const modelSelectorRef = useRef(null) const { width: viewportWidth, height: viewportHeight } = useWindowSize() const buttonRef = useRef(null) diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 18e548a4..2f32060a 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -52,9 +52,11 @@ interface ExtensionStateContextType extends ExtensionState { showHistory: boolean showAccount: boolean showAnnouncement: boolean + showChatModelSelector: boolean // Setters setShowAnnouncement: (value: boolean) => void + setShowChatModelSelector: (value: boolean) => void setShouldShowAnnouncement: (value: boolean) => void setMcpServers: (value: McpServer[]) => void setRequestyModels: (value: Record) => void @@ -91,6 +93,7 @@ interface ExtensionStateContextType extends ExtensionState { hideHistory: () => void hideAccount: () => void hideAnnouncement: () => void + hideChatModelSelector: () => void closeMcpView: () => void // Event callbacks @@ -112,6 +115,7 @@ export const ExtensionStateContextProvider: React.FC<{ const [showHistory, setShowHistory] = useState(false) const [showAccount, setShowAccount] = useState(false) const [showAnnouncement, setShowAnnouncement] = useState(false) + const [showChatModelSelector, setShowChatModelSelector] = useState(false) // Helper for MCP view const closeMcpView = useCallback(() => { @@ -124,6 +128,7 @@ export const ExtensionStateContextProvider: React.FC<{ const hideHistory = useCallback(() => setShowHistory(false), [setShowHistory]) const hideAccount = useCallback(() => setShowAccount(false), [setShowAccount]) const hideAnnouncement = useCallback(() => setShowAnnouncement(false), [setShowAnnouncement]) + const hideChatModelSelector = useCallback(() => setShowChatModelSelector(false), [setShowChatModelSelector]) // Navigation functions const navigateToMcp = useCallback( @@ -632,6 +637,7 @@ export const ExtensionStateContextProvider: React.FC<{ showHistory, showAccount, showAnnouncement, + showChatModelSelector, globalClineRulesToggles: state.globalClineRulesToggles || {}, localClineRulesToggles: state.localClineRulesToggles || {}, localCursorRulesToggles: state.localCursorRulesToggles || {}, @@ -654,6 +660,8 @@ export const ExtensionStateContextProvider: React.FC<{ hideAccount, hideAnnouncement, setShowAnnouncement, + hideChatModelSelector, + setShowChatModelSelector, setShouldShowAnnouncement: (value) => setState((prevState) => ({ ...prevState,