Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/types/src/providers/roo.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { ModelInfo } from "../model.js"

// Roo provider with single model
export type RooModelId = "roo/sonic"
export type RooModelId = "xai/grok-code-fast-1"

export const rooDefaultModelId: RooModelId = "roo/sonic"
export const rooDefaultModelId: RooModelId = "xai/grok-code-fast-1"

export const rooModels = {
"roo/sonic": {
"xai/grok-code-fast-1": {
maxTokens: 16_384,
contextWindow: 262_144,
supportsImages: false,
supportsPromptCache: true,
inputPrice: 0,
outputPrice: 0,
description:
"A stealth reasoning model that is blazing fast and excels at agentic coding, accessible for free through Roo Code Cloud for a limited time. (Note: prompts and completions are logged by the model creator and used to improve the model.)",
"A reasoning model that is blazing fast and excels at agentic coding, accessible for free through Roo Code Cloud for a limited time. (Note: the free prompts and completions are logged by xAI and used to improve the model.)",
},
} as const satisfies Record<string, ModelInfo>
13 changes: 12 additions & 1 deletion packages/types/src/providers/xai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@ import type { ModelInfo } from "../model.js"
// https://docs.x.ai/docs/api-reference
export type XAIModelId = keyof typeof xaiModels

export const xaiDefaultModelId: XAIModelId = "grok-4"
export const xaiDefaultModelId: XAIModelId = "grok-code-fast-1"

export const xaiModels = {
"grok-code-fast-1": {
maxTokens: 16_384,
contextWindow: 262_144,
supportsImages: false,
supportsPromptCache: true,
inputPrice: 0.2,
outputPrice: 1.5,
cacheWritesPrice: 0.02,
cacheReadsPrice: 0.02,
description: "xAI's Grok Code Fast model with 256K context window",
},
"grok-4": {
maxTokens: 8192,
contextWindow: 256000,
Expand Down
20 changes: 1 addition & 19 deletions packages/types/src/single-file-read-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,11 @@
* instead of the more complex multi-file args format
*/

// List of model IDs (or patterns) that should use single file reads only
export const SINGLE_FILE_READ_MODELS = new Set<string>(["roo/sonic"])

/**
* Check if a model should use single file read format
* @param modelId The model ID to check
* @returns true if the model should use single file reads
*/
export function shouldUseSingleFileRead(modelId: string): boolean {
// Direct match
if (SINGLE_FILE_READ_MODELS.has(modelId)) {
return true
}

// Pattern matching for model families
// Check if model ID starts with any configured pattern
// Using Array.from for compatibility with older TypeScript targets
const patterns = Array.from(SINGLE_FILE_READ_MODELS)
for (const pattern of patterns) {
if (pattern.endsWith("*") && modelId.startsWith(pattern.slice(0, -1))) {
return true
}
}

return false
return modelId.includes("grok-code-fast-1")
}
6 changes: 3 additions & 3 deletions src/api/providers/__tests__/roo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("RooHandler", () => {

beforeEach(() => {
mockOptions = {
apiModelId: "roo/sonic",
apiModelId: "xai/grok-code-fast-1",
}
// Set up CloudService mocks for successful authentication
mockHasInstanceFn.mockReturnValue(true)
Expand Down Expand Up @@ -313,8 +313,8 @@ describe("RooHandler", () => {
const modelInfo = handler.getModel()
expect(modelInfo.id).toBe(mockOptions.apiModelId)
expect(modelInfo.info).toBeDefined()
// roo/sonic is a valid model in rooModels
expect(modelInfo.info).toBe(rooModels["roo/sonic"])
// xai/grok-code-fast-1 is a valid model in rooModels
expect(modelInfo.info).toBe(rooModels["xai/grok-code-fast-1"])
})

it("should return default model when no model specified", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class ClineProvider

public isViewLaunched = false
public settingsImportedAt?: number
public readonly latestAnnouncementId = "aug-20-2025-stealth-model" // Update for stealth model announcement
public readonly latestAnnouncementId = "aug-25-2025-grok-code-fast" // Update for Grok Code Fast announcement
public readonly providerSettingsManager: ProviderSettingsManager
public readonly customModesManager: CustomModesManager

Expand Down
62 changes: 49 additions & 13 deletions webview-ui/src/components/chat/Announcement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,65 @@ const Announcement = ({ hideAnnouncement }: AnnouncementProps) => {
<DialogTitle>{t("chat:announcement.title", { version: Package.version })}</DialogTitle>
</DialogHeader>
<div>
<ul className="space-y-2">
<li>
•{" "}
<div className="space-y-2">
<div>
<Trans
i18nKey="chat:announcement.stealthModel.feature"
components={{
bold: <b />,
code: <code className="px-1 py-0.5 bg-gray-100 dark:bg-gray-800 rounded" />,
}}
/>
</li>
</ul>
</div>
</div>

<p className="text-xs text-muted-foreground mt-2">{t("chat:announcement.stealthModel.note")}</p>
<div className="mt-4">
<Trans
i18nKey="chat:announcement.stealthModel.note"
components={{
bold: <b />,
code: <code className="px-1 py-0.5 bg-gray-100 dark:bg-gray-800 rounded" />,
}}
/>
</div>

<div className="mt-4">
{!cloudIsAuthenticated ? (
<Button
onClick={() => {
vscode.postMessage({ type: "rooCloudSignIn" })
}}
className="w-full">
{t("chat:announcement.stealthModel.connectButton")}
</Button>
<div className="space-y-3">
<div className="text-sm w-full">
<Trans
i18nKey="chat:announcement.stealthModel.selectModel"
components={{
code: <code className="px-1 py-0.5 bg-gray-100 dark:bg-gray-800 rounded" />,
settingsLink: (
<VSCodeLink
href="#"
onClick={(e) => {
e.preventDefault()
setOpen(false)
hideAnnouncement()
window.postMessage(
{
type: "action",
action: "settingsButtonClicked",
values: { section: "provider" },
},
"*",
)
}}
/>
),
}}
/>
</div>
<Button
onClick={() => {
vscode.postMessage({ type: "rooCloudSignIn" })
}}
className="w-full">
{t("chat:announcement.stealthModel.connectButton")}
</Button>
</div>
) : (
<div className="text-sm w-full">
<Trans
Expand Down
27 changes: 20 additions & 7 deletions webview-ui/src/components/chat/__tests__/Announcement.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ vi.mock("@src/i18n/TranslationContext", () => ({
return `🎉 Roo Code ${options?.version} Released`
}
if (key === "chat:announcement.stealthModel.feature") {
return "Stealth reasoning model with advanced capabilities"
return "The Sonic stealth model is now Grok Code Fast!"
}
if (key === "chat:announcement.stealthModel.note") {
return "Note: This is an experimental feature"
return "As a thank you for all the helpful feedback about Sonic, you'll also continue to have free access to the grok-code-fast-1 model for another week through the Roo Code Cloud provider."
}
if (key === "chat:announcement.stealthModel.connectButton") {
return "Connect to Roo Code Cloud"
Expand All @@ -43,10 +43,23 @@ vi.mock("@src/i18n/TranslationContext", () => ({
vi.mock("react-i18next", () => ({
Trans: ({ i18nKey, children }: { i18nKey?: string; children: React.ReactNode }) => {
if (i18nKey === "chat:announcement.stealthModel.feature") {
return <>Stealth reasoning model with advanced capabilities</>
return (
<>
The Sonic stealth model is now Grok Code Fast! The fast reasoning model is now available as
grok-code-fast-1 under the &ldquo;xAI (Grok)&rdquo; provider.
</>
)
}
if (i18nKey === "chat:announcement.stealthModel.selectModel") {
return <>Please select the roo/sonic model in settings</>
return <>Visit Settings to get started</>
}
if (i18nKey === "chat:announcement.stealthModel.note") {
return (
<>
As a thank you for all the helpful feedback about Sonic, you&rsquo;ll also continue to have free
access to the grok-code-fast-1 model for another week through the Roo Code Cloud provider.
</>
)
}
return <>{children}</>
},
Expand Down Expand Up @@ -77,11 +90,11 @@ describe("Announcement", () => {
// Check if the mocked version number is present in the title
expect(screen.getByText(`🎉 Roo Code ${expectedVersion} Released`)).toBeInTheDocument()

// Check if the stealth model feature is displayed (using partial match due to bullet point)
expect(screen.getByText(/Stealth reasoning model with advanced capabilities/)).toBeInTheDocument()
// Check if the Grok Code Fast feature is displayed
expect(screen.getByText(/The Sonic stealth model is now Grok Code Fast!/)).toBeInTheDocument()

// Check if the note is displayed
expect(screen.getByText("Note: This is an experimental feature")).toBeInTheDocument()
expect(screen.getByText(/As a thank you for all the helpful feedback about Sonic/)).toBeInTheDocument()

// Check if the connect button is displayed (since cloudIsAuthenticated is false in the mock)
expect(screen.getByText("Connect to Roo Code Cloud")).toBeInTheDocument()
Expand Down
18 changes: 15 additions & 3 deletions webview-ui/src/components/ui/hooks/useSelectedModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,21 @@ function getSelectedModel({
return { id, info }
}
case "roo": {
const id = apiConfiguration.apiModelId ?? rooDefaultModelId
const info = rooModels[id as keyof typeof rooModels]
return { id, info }
const requestedId = apiConfiguration.apiModelId

// Check if the requested model exists in rooModels
if (requestedId && rooModels[requestedId as keyof typeof rooModels]) {
return {
id: requestedId,
info: rooModels[requestedId as keyof typeof rooModels],
}
}

// Fallback to default model if requested model doesn't exist or is not specified
return {
id: rooDefaultModelId,
info: rooModels[rooDefaultModelId as keyof typeof rooModels],
}
}
case "qwen-code": {
const id = apiConfiguration.apiModelId ?? qwenCodeDefaultModelId
Expand Down
8 changes: 4 additions & 4 deletions webview-ui/src/i18n/locales/ca/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions webview-ui/src/i18n/locales/de/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@
"announcement": {
"title": "🎉 Roo Code {{version}} Released",
"stealthModel": {
"feature": "<bold>Limited-time FREE stealth model</bold> - A blazing fast reasoning model that excels at agentic coding with a 262k context window, available through Roo Code Cloud.",
"note": "(Note: prompts and completions are logged by the model creator to improve the model)",
"feature": "The Sonic stealth model is now <bold>Grok Code Fast</bold>! This high-performance reasoning model is available as <code>grok-code-fast-1</code> under the <bold>xAI (Grok)</bold> provider.",
"note": "As a thank you for all the helpful feedback on Sonic, xAI is extending free access to <code>grok-code-fast-1</code> for another week through the <bold>Roo Code Cloud</bold> provider.",
"connectButton": "Connect to Roo Code Cloud",
"selectModel": "Select <code>roo/sonic</code> from the Roo Code Cloud provider in<br/><settingsLink>Settings</settingsLink> to get started"
"selectModel": "Visit <settingsLink>Settings</settingsLink> to update your provider configuration."
}
},
"reasoning": {
Expand Down
8 changes: 4 additions & 4 deletions webview-ui/src/i18n/locales/es/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions webview-ui/src/i18n/locales/fr/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions webview-ui/src/i18n/locales/hi/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading