Skip to content

Commit ae0a3b7

Browse files
authored
Merge branch 'RooCodeInc:main' into feat/finer-grained-control-gemini
2 parents 7e9d252 + 5557d77 commit ae0a3b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1033
-143
lines changed

.github/workflows/changeset-release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
ref: ${{ env.GIT_REF }}
3232
- name: Setup Node.js and pnpm
3333
uses: ./.github/actions/setup-node-pnpm
34-
with:
35-
skip-checkout: 'true'
3634

3735
# Check if there are any new changesets to process
3836
- name: Check for changesets

.github/workflows/marketplace-publish.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ jobs:
2525
ref: ${{ env.GIT_REF }}
2626
- name: Setup Node.js and pnpm
2727
uses: ./.github/actions/setup-node-pnpm
28-
with:
29-
skip-checkout: 'true'
3028
- name: Configure Git
3129
run: |
3230
git config user.name "github-actions[bot]"

.github/workflows/nightly-publish.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
- name: Setup Node.js and pnpm
2121
uses: ./.github/actions/setup-node-pnpm
2222
with:
23-
skip-checkout: 'true'
2423
install-args: '--frozen-lockfile'
2524
- name: Forge numeric Nightly version
2625
id: version

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Roo Code Changelog
22

3+
## [3.23.12] - 2025-07-15
4+
5+
- Update the max-token calculation in model-params to better support Kimi K2 and others
6+
7+
## [3.23.11] - 2025-07-14
8+
9+
- Add Kimi K2 model to Groq along with fixes to context condensing math
10+
- Add Cmd+Shift+. keyboard shortcut for previous mode switching
11+
12+
## [3.23.10] - 2025-07-14
13+
14+
- Prioritize built-in model dimensions over custom dimensions (thanks @daniel-lxs!)
15+
- Add padding to the index model options
16+
317
## [3.23.9] - 2025-07-14
418

519
- Enable Claude Code provider to run natively on Windows (thanks @SannidhyaSah!)

apps/web-roo-code/src/app/evals/evals.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function Evals({
6161
<div className="flex flex-col gap-4">
6262
<div>
6363
Roo Code tests each frontier model against{" "}
64-
<a href="https://github.com/cte/evals/" className="underline">
64+
<a href="https://github.com/RooCodeInc/Roo-Code-Evals" className="underline">
6565
a suite of hundreds of exercises
6666
</a>{" "}
6767
across 5 programming languages with varying difficulty. These results can help you find the right
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { describe, test, expect } from "vitest"
2+
import { convertModelNameForVertex, getClaudeCodeModelId } from "../claude-code.js"
3+
4+
describe("convertModelNameForVertex", () => {
5+
test("should convert hyphen-date format to @date format", () => {
6+
expect(convertModelNameForVertex("claude-sonnet-4-20250514")).toBe("claude-sonnet-4@20250514")
7+
expect(convertModelNameForVertex("claude-opus-4-20250514")).toBe("claude-opus-4@20250514")
8+
expect(convertModelNameForVertex("claude-3-7-sonnet-20250219")).toBe("claude-3-7-sonnet@20250219")
9+
expect(convertModelNameForVertex("claude-3-5-sonnet-20241022")).toBe("claude-3-5-sonnet@20241022")
10+
expect(convertModelNameForVertex("claude-3-5-haiku-20241022")).toBe("claude-3-5-haiku@20241022")
11+
})
12+
13+
test("should not modify models without date pattern", () => {
14+
expect(convertModelNameForVertex("some-other-model")).toBe("some-other-model")
15+
expect(convertModelNameForVertex("claude-model")).toBe("claude-model")
16+
expect(convertModelNameForVertex("model-with-short-date-123")).toBe("model-with-short-date-123")
17+
})
18+
19+
test("should only convert 8-digit date patterns at the end", () => {
20+
expect(convertModelNameForVertex("claude-20250514-sonnet")).toBe("claude-20250514-sonnet")
21+
expect(convertModelNameForVertex("model-20250514-with-more")).toBe("model-20250514-with-more")
22+
})
23+
})
24+
25+
describe("getClaudeCodeModelId", () => {
26+
test("should return original model when useVertex is false", () => {
27+
expect(getClaudeCodeModelId("claude-sonnet-4-20250514", false)).toBe("claude-sonnet-4-20250514")
28+
expect(getClaudeCodeModelId("claude-opus-4-20250514", false)).toBe("claude-opus-4-20250514")
29+
expect(getClaudeCodeModelId("claude-3-7-sonnet-20250219", false)).toBe("claude-3-7-sonnet-20250219")
30+
})
31+
32+
test("should return converted model when useVertex is true", () => {
33+
expect(getClaudeCodeModelId("claude-sonnet-4-20250514", true)).toBe("claude-sonnet-4@20250514")
34+
expect(getClaudeCodeModelId("claude-opus-4-20250514", true)).toBe("claude-opus-4@20250514")
35+
expect(getClaudeCodeModelId("claude-3-7-sonnet-20250219", true)).toBe("claude-3-7-sonnet@20250219")
36+
})
37+
38+
test("should default to useVertex false when parameter not provided", () => {
39+
expect(getClaudeCodeModelId("claude-sonnet-4-20250514")).toBe("claude-sonnet-4-20250514")
40+
})
41+
})

packages/types/src/providers/claude-code.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
11
import type { ModelInfo } from "../model.js"
22
import { anthropicModels } from "./anthropic.js"
33

4+
// Regex pattern to match 8-digit date at the end of model names
5+
const VERTEX_DATE_PATTERN = /-(\d{8})$/
6+
7+
/**
8+
* Converts Claude model names from hyphen-date format to Vertex AI's @-date format.
9+
*
10+
* @param modelName - The original model name (e.g., "claude-sonnet-4-20250514")
11+
* @returns The converted model name for Vertex AI (e.g., "claude-sonnet-4@20250514")
12+
*
13+
* @example
14+
* convertModelNameForVertex("claude-sonnet-4-20250514") // returns "claude-sonnet-4@20250514"
15+
* convertModelNameForVertex("claude-model") // returns "claude-model" (no change)
16+
*/
17+
export function convertModelNameForVertex(modelName: string): string {
18+
// Convert hyphen-date format to @date format for Vertex AI
19+
return modelName.replace(VERTEX_DATE_PATTERN, "@$1")
20+
}
21+
422
// Claude Code
523
export type ClaudeCodeModelId = keyof typeof claudeCodeModels
624
export const claudeCodeDefaultModelId: ClaudeCodeModelId = "claude-sonnet-4-20250514"
725
export const CLAUDE_CODE_DEFAULT_MAX_OUTPUT_TOKENS = 8000
26+
27+
/**
28+
* Gets the appropriate model ID based on whether Vertex AI is being used.
29+
*
30+
* @param baseModelId - The base Claude Code model ID
31+
* @param useVertex - Whether to format the model ID for Vertex AI (default: false)
32+
* @returns The model ID, potentially formatted for Vertex AI
33+
*
34+
* @example
35+
* getClaudeCodeModelId("claude-sonnet-4-20250514", true) // returns "claude-sonnet-4@20250514"
36+
* getClaudeCodeModelId("claude-sonnet-4-20250514", false) // returns "claude-sonnet-4-20250514"
37+
*/
38+
export function getClaudeCodeModelId(baseModelId: ClaudeCodeModelId, useVertex = false): string {
39+
return useVertex ? convertModelNameForVertex(baseModelId) : baseModelId
40+
}
41+
842
export const claudeCodeModels = {
943
"claude-sonnet-4-20250514": {
1044
...anthropicModels["claude-sonnet-4-20250514"],

packages/types/src/providers/groq.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ export type GroqModelId =
1010
| "qwen-qwq-32b"
1111
| "qwen/qwen3-32b"
1212
| "deepseek-r1-distill-llama-70b"
13+
| "moonshotai/kimi-k2-instruct"
1314

1415
export const groqDefaultModelId: GroqModelId = "llama-3.3-70b-versatile" // Defaulting to Llama3 70B Versatile
1516

1617
export const groqModels = {
1718
// Models based on API response: https://api.groq.com/openai/v1/models
1819
"llama-3.1-8b-instant": {
19-
maxTokens: 131072,
20+
maxTokens: 8192,
2021
contextWindow: 131072,
2122
supportsImages: false,
2223
supportsPromptCache: false,
@@ -25,7 +26,7 @@ export const groqModels = {
2526
description: "Meta Llama 3.1 8B Instant model, 128K context.",
2627
},
2728
"llama-3.3-70b-versatile": {
28-
maxTokens: 32768,
29+
maxTokens: 8192,
2930
contextWindow: 131072,
3031
supportsImages: false,
3132
supportsPromptCache: false,
@@ -52,7 +53,7 @@ export const groqModels = {
5253
description: "Meta Llama 4 Maverick 17B Instruct model, 128K context.",
5354
},
5455
"mistral-saba-24b": {
55-
maxTokens: 32768,
56+
maxTokens: 8192,
5657
contextWindow: 32768,
5758
supportsImages: false,
5859
supportsPromptCache: false,
@@ -61,7 +62,7 @@ export const groqModels = {
6162
description: "Mistral Saba 24B model, 32K context.",
6263
},
6364
"qwen-qwq-32b": {
64-
maxTokens: 131072,
65+
maxTokens: 8192,
6566
contextWindow: 131072,
6667
supportsImages: false,
6768
supportsPromptCache: false,
@@ -70,7 +71,7 @@ export const groqModels = {
7071
description: "Alibaba Qwen QwQ 32B model, 128K context.",
7172
},
7273
"qwen/qwen3-32b": {
73-
maxTokens: 40960,
74+
maxTokens: 8192,
7475
contextWindow: 131072,
7576
supportsImages: false,
7677
supportsPromptCache: false,
@@ -79,12 +80,21 @@ export const groqModels = {
7980
description: "Alibaba Qwen 3 32B model, 128K context.",
8081
},
8182
"deepseek-r1-distill-llama-70b": {
82-
maxTokens: 131072,
83+
maxTokens: 8192,
8384
contextWindow: 131072,
8485
supportsImages: false,
8586
supportsPromptCache: false,
8687
inputPrice: 0.75,
8788
outputPrice: 0.99,
8889
description: "DeepSeek R1 Distill Llama 70B model, 128K context.",
8990
},
91+
"moonshotai/kimi-k2-instruct": {
92+
maxTokens: 16384,
93+
contextWindow: 131072,
94+
supportsImages: false,
95+
supportsPromptCache: false,
96+
inputPrice: 1.0,
97+
outputPrice: 3.0,
98+
description: "Moonshot AI Kimi K2 Instruct 1T model, 128K context.",
99+
},
90100
} as const satisfies Record<string, ModelInfo>

packages/types/src/telemetry.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ export const taskPropertiesSchema = z.object({
8989
modelId: z.string().optional(),
9090
diffStrategy: z.string().optional(),
9191
isSubtask: z.boolean().optional(),
92+
todos: z
93+
.object({
94+
total: z.number(),
95+
completed: z.number(),
96+
inProgress: z.number(),
97+
pending: z.number(),
98+
})
99+
.optional(),
92100
})
93101

94102
export const gitPropertiesSchema = z.object({

src/api/providers/claude-code.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import type { Anthropic } from "@anthropic-ai/sdk"
2-
import { claudeCodeDefaultModelId, type ClaudeCodeModelId, claudeCodeModels, type ModelInfo } from "@roo-code/types"
2+
import {
3+
claudeCodeDefaultModelId,
4+
type ClaudeCodeModelId,
5+
claudeCodeModels,
6+
type ModelInfo,
7+
getClaudeCodeModelId,
8+
} from "@roo-code/types"
39
import { type ApiHandler } from ".."
410
import { ApiStreamUsageChunk, type ApiStream } from "../transform/stream"
511
import { runClaudeCode } from "../../integrations/claude-code/run"
@@ -20,11 +26,17 @@ export class ClaudeCodeHandler extends BaseProvider implements ApiHandler {
2026
// Filter out image blocks since Claude Code doesn't support them
2127
const filteredMessages = filterMessagesForClaudeCode(messages)
2228

29+
const useVertex = process.env.CLAUDE_CODE_USE_VERTEX === "1"
30+
const model = this.getModel()
31+
32+
// Validate that the model ID is a valid ClaudeCodeModelId
33+
const modelId = model.id in claudeCodeModels ? (model.id as ClaudeCodeModelId) : claudeCodeDefaultModelId
34+
2335
const claudeProcess = runClaudeCode({
2436
systemPrompt,
2537
messages: filteredMessages,
2638
path: this.options.claudeCodePath,
27-
modelId: this.getModel().id,
39+
modelId: getClaudeCodeModelId(modelId, useVertex),
2840
maxOutputTokens: this.options.claudeCodeMaxOutputTokens,
2941
})
3042

0 commit comments

Comments
 (0)