Skip to content

Commit 2612c6a

Browse files
authored
Merge pull request #1154 from RooVetGit/cte/claude-3.7-default
Default to Claude 3.7 where appropriate
2 parents 9897442 + b24a335 commit 2612c6a

File tree

15 files changed

+151
-178
lines changed

15 files changed

+151
-178
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ body:
3333
id: model
3434
attributes:
3535
label: Which Model are you using?
36-
description: Please specify the model you're using (e.g. Claude 3.5 Sonnet)
36+
description: Please specify the model you're using (e.g. Claude 3.7 Sonnet)
3737
validations:
3838
required: true
3939
- type: textarea

src/api/providers/__tests__/glama.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { GlamaHandler } from "../glama"
2-
import { ApiHandlerOptions } from "../../../shared/api"
3-
import OpenAI from "openai"
1+
// npx jest src/api/providers/__tests__/glama.test.ts
2+
43
import { Anthropic } from "@anthropic-ai/sdk"
54
import axios from "axios"
65

6+
import { GlamaHandler } from "../glama"
7+
import { ApiHandlerOptions } from "../../../shared/api"
8+
79
// Mock OpenAI client
810
const mockCreate = jest.fn()
911
const mockWithResponse = jest.fn()
@@ -71,8 +73,8 @@ describe("GlamaHandler", () => {
7173

7274
beforeEach(() => {
7375
mockOptions = {
74-
apiModelId: "anthropic/claude-3-5-sonnet",
75-
glamaModelId: "anthropic/claude-3-5-sonnet",
76+
apiModelId: "anthropic/claude-3-7-sonnet",
77+
glamaModelId: "anthropic/claude-3-7-sonnet",
7678
glamaApiKey: "test-api-key",
7779
}
7880
handler = new GlamaHandler(mockOptions)

src/api/providers/__tests__/openrouter.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// npx jest src/api/providers/__tests__/openrouter.test.ts
2+
13
import { OpenRouterHandler } from "../openrouter"
24
import { ApiHandlerOptions, ModelInfo } from "../../../shared/api"
35
import OpenAI from "openai"
@@ -55,7 +57,7 @@ describe("OpenRouterHandler", () => {
5557
const handler = new OpenRouterHandler({})
5658
const result = handler.getModel()
5759

58-
expect(result.id).toBe("anthropic/claude-3.5-sonnet:beta")
60+
expect(result.id).toBe("anthropic/claude-3.7-sonnet")
5961
expect(result.info.supportsPromptCache).toBe(true)
6062
})
6163

src/api/providers/__tests__/vertex.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { VertexHandler } from "../vertex"
1+
// npx jest src/api/providers/__tests__/vertex.test.ts
2+
23
import { Anthropic } from "@anthropic-ai/sdk"
34
import { AnthropicVertex } from "@anthropic-ai/vertex-sdk"
45

6+
import { VertexHandler } from "../vertex"
7+
58
// Mock Vertex SDK
69
jest.mock("@anthropic-ai/vertex-sdk", () => ({
710
AnthropicVertex: jest.fn().mockImplementation(() => ({
@@ -289,7 +292,7 @@ describe("VertexHandler", () => {
289292
vertexRegion: "us-central1",
290293
})
291294
const modelInfo = invalidHandler.getModel()
292-
expect(modelInfo.id).toBe("claude-3-5-sonnet-v2@20241022") // Default model
295+
expect(modelInfo.id).toBe("claude-3-7-sonnet@20250219") // Default model
293296
})
294297
})
295298
})

src/api/providers/openrouter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
107107
// (models usually default to max tokens allowed)
108108
let maxTokens: number | undefined
109109
switch (this.getModel().id) {
110+
case "anthropic/claude-3.7-sonnet":
110111
case "anthropic/claude-3.5-sonnet":
111112
case "anthropic/claude-3.5-sonnet:beta":
112113
case "anthropic/claude-3.5-sonnet-20240620":

src/core/Cline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2792,7 +2792,7 @@ export class Cline {
27922792
"mistake_limit_reached",
27932793
this.api.getModel().id.includes("claude")
27942794
? `This may indicate a failure in his thought process or inability to use a tool properly, which can be mitigated with some user guidance (e.g. "Try breaking down the task into smaller steps").`
2795-
: "Roo Code uses complex prompts and iterative task execution that may be challenging for less capable models. For best results, it's recommended to use Claude 3.5 Sonnet for its advanced agentic coding capabilities.",
2795+
: "Roo Code uses complex prompts and iterative task execution that may be challenging for less capable models. For best results, it's recommended to use Claude 3.7 Sonnet for its advanced agentic coding capabilities.",
27962796
)
27972797
if (response === "messageResponse") {
27982798
userContent.push(

src/core/webview/ClineProvider.ts

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,23 +1900,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
19001900
}
19011901

19021902
const response = await axios.get("https://router.requesty.ai/v1/models", config)
1903-
/*
1904-
{
1905-
"id": "anthropic/claude-3-5-sonnet-20240620",
1906-
"object": "model",
1907-
"created": 1738243330,
1908-
"owned_by": "system",
1909-
"input_price": 0.000003,
1910-
"caching_price": 0.00000375,
1911-
"cached_price": 3E-7,
1912-
"output_price": 0.000015,
1913-
"max_output_tokens": 8192,
1914-
"context_window": 200000,
1915-
"supports_caching": true,
1916-
"description": "Anthropic's most intelligent model. Highest level of intelligence and capability"
1917-
},
1918-
}
1919-
*/
1903+
19201904
if (response.data) {
19211905
const rawModels = response.data.data
19221906
const parsePrice = (price: any) => {
@@ -2116,34 +2100,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
21162100
)
21172101

21182102
const models: Record<string, ModelInfo> = {}
2103+
21192104
try {
21202105
const response = await axios.get("https://openrouter.ai/api/v1/models")
2121-
/*
2122-
{
2123-
"id": "anthropic/claude-3.5-sonnet",
2124-
"name": "Anthropic: Claude 3.5 Sonnet",
2125-
"created": 1718841600,
2126-
"description": "Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at:\n\n- Coding: Autonomously writes, edits, and runs code with reasoning and troubleshooting\n- Data science: Augments human data science expertise; navigates unstructured data while using multiple tools for insights\n- Visual processing: excelling at interpreting charts, graphs, and images, accurately transcribing text to derive insights beyond just the text alone\n- Agentic tasks: exceptional tool use, making it great at agentic tasks (i.e. complex, multi-step problem solving tasks that require engaging with other systems)\n\n#multimodal",
2127-
"context_length": 200000,
2128-
"architecture": {
2129-
"modality": "text+image-\u003Etext",
2130-
"tokenizer": "Claude",
2131-
"instruct_type": null
2132-
},
2133-
"pricing": {
2134-
"prompt": "0.000003",
2135-
"completion": "0.000015",
2136-
"image": "0.0048",
2137-
"request": "0"
2138-
},
2139-
"top_provider": {
2140-
"context_length": 200000,
2141-
"max_completion_tokens": 8192,
2142-
"is_moderated": true
2143-
},
2144-
"per_request_limits": null
2145-
},
2146-
*/
2106+
21472107
if (response.data?.data) {
21482108
const rawModels = response.data.data
21492109
const parsePrice = (price: any) => {
@@ -2152,6 +2112,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
21522112
}
21532113
return undefined
21542114
}
2115+
21552116
for (const rawModel of rawModels) {
21562117
const modelInfo: ModelInfo = {
21572118
maxTokens: rawModel.top_provider?.max_completion_tokens,
@@ -2164,9 +2125,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
21642125
}
21652126

21662127
switch (rawModel.id) {
2128+
case "anthropic/claude-3.7-sonnet":
21672129
case "anthropic/claude-3.5-sonnet":
21682130
case "anthropic/claude-3.5-sonnet:beta":
2169-
// NOTE: this needs to be synced with api.ts/openrouter default model info
2131+
// NOTE: this needs to be synced with api.ts/openrouter default model info.
21702132
modelInfo.supportsComputerUse = true
21712133
modelInfo.supportsPromptCache = true
21722134
modelInfo.cacheWritesPrice = 3.75

src/shared/api.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export interface ModelInfo {
9393
// Anthropic
9494
// https://docs.anthropic.com/en/docs/about-claude/models
9595
export type AnthropicModelId = keyof typeof anthropicModels
96-
export const anthropicDefaultModelId: AnthropicModelId = "claude-3-5-sonnet-20241022"
96+
export const anthropicDefaultModelId: AnthropicModelId = "claude-3-7-sonnet-20250219"
9797
export const anthropicModels = {
9898
"claude-3-7-sonnet-20250219": {
9999
maxTokens: 64_000,
@@ -355,7 +355,7 @@ export const bedrockModels = {
355355

356356
// Glama
357357
// https://glama.ai/models
358-
export const glamaDefaultModelId = "anthropic/claude-3-5-sonnet"
358+
export const glamaDefaultModelId = "anthropic/claude-3-7-sonnet"
359359
export const glamaDefaultModelInfo: ModelInfo = {
360360
maxTokens: 8192,
361361
contextWindow: 200_000,
@@ -367,9 +367,12 @@ export const glamaDefaultModelInfo: ModelInfo = {
367367
cacheWritesPrice: 3.75,
368368
cacheReadsPrice: 0.3,
369369
description:
370-
"The new Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at:\n\n- Coding: New Sonnet scores ~49% on SWE-Bench Verified, higher than the last best score, and without any fancy prompt scaffolding\n- Data science: Augments human data science expertise; navigates unstructured data while using multiple tools for insights\n- Visual processing: excelling at interpreting charts, graphs, and images, accurately transcribing text to derive insights beyond just the text alone\n- Agentic tasks: exceptional tool use, making it great at agentic tasks (i.e. complex, multi-step problem solving tasks that require engaging with other systems)\n\n#multimodal\n\n_This is a faster endpoint, made available in collaboration with Anthropic, that is self-moderated: response moderation happens on the provider's side instead of OpenRouter's. For requests that pass moderation, it's identical to the [Standard](/anthropic/claude-3.5-sonnet) variant._",
370+
"Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities. It introduces a hybrid reasoning approach, allowing users to choose between rapid responses and extended, step-by-step processing for complex tasks. The model demonstrates notable improvements in coding, particularly in front-end development and full-stack updates, and excels in agentic workflows, where it can autonomously navigate multi-step processes. Claude 3.7 Sonnet maintains performance parity with its predecessor in standard mode while offering an extended reasoning mode for enhanced accuracy in math, coding, and instruction-following tasks. Read more at the [blog post here](https://www.anthropic.com/news/claude-3-7-sonnet)",
371371
}
372372

373+
// Requesty
374+
// https://requesty.ai/router-2
375+
export const requestyDefaultModelId = "anthropic/claude-3-7-sonnet-latest"
373376
export const requestyDefaultModelInfo: ModelInfo = {
374377
maxTokens: 8192,
375378
contextWindow: 200_000,
@@ -381,13 +384,12 @@ export const requestyDefaultModelInfo: ModelInfo = {
381384
cacheWritesPrice: 3.75,
382385
cacheReadsPrice: 0.3,
383386
description:
384-
"The new Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at:\n\n- Coding: New Sonnet scores ~49% on SWE-Bench Verified, higher than the last best score, and without any fancy prompt scaffolding\n- Data science: Augments human data science expertise; navigates unstructured data while using multiple tools for insights\n- Visual processing: excelling at interpreting charts, graphs, and images, accurately transcribing text to derive insights beyond just the text alone\n- Agentic tasks: exceptional tool use, making it great at agentic tasks (i.e. complex, multi-step problem solving tasks that require engaging with other systems)\n\n#multimodal\n\n_This is a faster endpoint, made available in collaboration with Anthropic, that is self-moderated: response moderation happens on the provider's side instead of OpenRouter's. For requests that pass moderation, it's identical to the [Standard](/anthropic/claude-3.5-sonnet) variant._",
387+
"Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities. It introduces a hybrid reasoning approach, allowing users to choose between rapid responses and extended, step-by-step processing for complex tasks. The model demonstrates notable improvements in coding, particularly in front-end development and full-stack updates, and excels in agentic workflows, where it can autonomously navigate multi-step processes. Claude 3.7 Sonnet maintains performance parity with its predecessor in standard mode while offering an extended reasoning mode for enhanced accuracy in math, coding, and instruction-following tasks. Read more at the [blog post here](https://www.anthropic.com/news/claude-3-7-sonnet)",
385388
}
386-
export const requestyDefaultModelId = "anthropic/claude-3-5-sonnet"
387389

388390
// OpenRouter
389391
// https://openrouter.ai/models?order=newest&supported_parameters=tools
390-
export const openRouterDefaultModelId = "anthropic/claude-3.5-sonnet:beta" // will always exist in openRouterModels
392+
export const openRouterDefaultModelId = "anthropic/claude-3.7-sonnet"
391393
export const openRouterDefaultModelInfo: ModelInfo = {
392394
maxTokens: 8192,
393395
contextWindow: 200_000,
@@ -399,13 +401,13 @@ export const openRouterDefaultModelInfo: ModelInfo = {
399401
cacheWritesPrice: 3.75,
400402
cacheReadsPrice: 0.3,
401403
description:
402-
"The new Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at:\n\n- Coding: New Sonnet scores ~49% on SWE-Bench Verified, higher than the last best score, and without any fancy prompt scaffolding\n- Data science: Augments human data science expertise; navigates unstructured data while using multiple tools for insights\n- Visual processing: excelling at interpreting charts, graphs, and images, accurately transcribing text to derive insights beyond just the text alone\n- Agentic tasks: exceptional tool use, making it great at agentic tasks (i.e. complex, multi-step problem solving tasks that require engaging with other systems)\n\n#multimodal\n\n_This is a faster endpoint, made available in collaboration with Anthropic, that is self-moderated: response moderation happens on the provider's side instead of OpenRouter's. For requests that pass moderation, it's identical to the [Standard](/anthropic/claude-3.5-sonnet) variant._",
404+
"Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities. It introduces a hybrid reasoning approach, allowing users to choose between rapid responses and extended, step-by-step processing for complex tasks. The model demonstrates notable improvements in coding, particularly in front-end development and full-stack updates, and excels in agentic workflows, where it can autonomously navigate multi-step processes. Claude 3.7 Sonnet maintains performance parity with its predecessor in standard mode while offering an extended reasoning mode for enhanced accuracy in math, coding, and instruction-following tasks. Read more at the [blog post here](https://www.anthropic.com/news/claude-3-7-sonnet)",
403405
}
404406

405407
// Vertex AI
406408
// https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
407409
export type VertexModelId = keyof typeof vertexModels
408-
export const vertexDefaultModelId: VertexModelId = "claude-3-5-sonnet-v2@20241022"
410+
export const vertexDefaultModelId: VertexModelId = "claude-3-7-sonnet@20250219"
409411
export const vertexModels = {
410412
"claude-3-7-sonnet@20250219": {
411413
maxTokens: 8192,

src/test/suite/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,36 @@ declare global {
1313
}
1414

1515
export async function run(): Promise<void> {
16-
// Create the mocha test
1716
const mocha = new Mocha({
1817
ui: "tdd",
19-
timeout: 600000, // 10 minutes to compensate for time communicating with LLM while running in GHA
18+
timeout: 600000, // 10 minutes to compensate for time communicating with LLM while running in GHA.
2019
})
2120

2221
const testsRoot = path.resolve(__dirname, "..")
2322

2423
try {
25-
// Find all test files
24+
// Find all test files.
2625
const files = await glob("**/**.test.js", { cwd: testsRoot })
2726

28-
// Add files to the test suite
27+
// Add files to the test suite.
2928
files.forEach((f: string) => mocha.addFile(path.resolve(testsRoot, f)))
3029

31-
//Set up global extension, api, provider, and panel
30+
// Set up global extension, api, provider, and panel.
3231
globalThis.extension = vscode.extensions.getExtension("RooVeterinaryInc.roo-cline")
32+
3333
if (!globalThis.extension) {
3434
throw new Error("Extension not found")
3535
}
3636

3737
globalThis.api = globalThis.extension.isActive
3838
? globalThis.extension.exports
3939
: await globalThis.extension.activate()
40+
4041
globalThis.provider = globalThis.api.sidebarProvider
42+
4143
await globalThis.provider.updateGlobalState("apiProvider", "openrouter")
4244
await globalThis.provider.updateGlobalState("openRouterModelId", "anthropic/claude-3.5-sonnet")
45+
4346
await globalThis.provider.storeSecret(
4447
"openRouterApiKey",
4548
process.env.OPENROUTER_API_KEY || "sk-or-v1-fake-api-key",
@@ -71,7 +74,7 @@ export async function run(): Promise<void> {
7174
await new Promise((resolve) => setTimeout(resolve, interval))
7275
}
7376

74-
// Run the mocha test
77+
// Run the mocha test.
7578
return new Promise((resolve, reject) => {
7679
try {
7780
mocha.run((failures: number) => {

0 commit comments

Comments
 (0)