Browse Source

Merge pull request #1154 from RooVetGit/cte/claude-3.7-default

Default to Claude 3.7 where appropriate
Chris Estreich 1 year ago
parent
commit
2612c6a4c1

+ 1 - 1
.github/ISSUE_TEMPLATE/bug_report.yml

@@ -33,7 +33,7 @@ body:
       id: model
       attributes:
           label: Which Model are you using?
-          description: Please specify the model you're using (e.g. Claude 3.5 Sonnet)
+          description: Please specify the model you're using (e.g. Claude 3.7 Sonnet)
       validations:
           required: true
     - type: textarea

+ 7 - 5
src/api/providers/__tests__/glama.test.ts

@@ -1,9 +1,11 @@
-import { GlamaHandler } from "../glama"
-import { ApiHandlerOptions } from "../../../shared/api"
-import OpenAI from "openai"
+// npx jest src/api/providers/__tests__/glama.test.ts
+
 import { Anthropic } from "@anthropic-ai/sdk"
 import axios from "axios"
 
+import { GlamaHandler } from "../glama"
+import { ApiHandlerOptions } from "../../../shared/api"
+
 // Mock OpenAI client
 const mockCreate = jest.fn()
 const mockWithResponse = jest.fn()
@@ -71,8 +73,8 @@ describe("GlamaHandler", () => {
 
 	beforeEach(() => {
 		mockOptions = {
-			apiModelId: "anthropic/claude-3-5-sonnet",
-			glamaModelId: "anthropic/claude-3-5-sonnet",
+			apiModelId: "anthropic/claude-3-7-sonnet",
+			glamaModelId: "anthropic/claude-3-7-sonnet",
 			glamaApiKey: "test-api-key",
 		}
 		handler = new GlamaHandler(mockOptions)

+ 3 - 1
src/api/providers/__tests__/openrouter.test.ts

@@ -1,3 +1,5 @@
+// npx jest src/api/providers/__tests__/openrouter.test.ts
+
 import { OpenRouterHandler } from "../openrouter"
 import { ApiHandlerOptions, ModelInfo } from "../../../shared/api"
 import OpenAI from "openai"
@@ -55,7 +57,7 @@ describe("OpenRouterHandler", () => {
 		const handler = new OpenRouterHandler({})
 		const result = handler.getModel()
 
-		expect(result.id).toBe("anthropic/claude-3.5-sonnet:beta")
+		expect(result.id).toBe("anthropic/claude-3.7-sonnet")
 		expect(result.info.supportsPromptCache).toBe(true)
 	})
 

+ 5 - 2
src/api/providers/__tests__/vertex.test.ts

@@ -1,7 +1,10 @@
-import { VertexHandler } from "../vertex"
+// npx jest src/api/providers/__tests__/vertex.test.ts
+
 import { Anthropic } from "@anthropic-ai/sdk"
 import { AnthropicVertex } from "@anthropic-ai/vertex-sdk"
 
+import { VertexHandler } from "../vertex"
+
 // Mock Vertex SDK
 jest.mock("@anthropic-ai/vertex-sdk", () => ({
 	AnthropicVertex: jest.fn().mockImplementation(() => ({
@@ -289,7 +292,7 @@ describe("VertexHandler", () => {
 				vertexRegion: "us-central1",
 			})
 			const modelInfo = invalidHandler.getModel()
-			expect(modelInfo.id).toBe("claude-3-5-sonnet-v2@20241022") // Default model
+			expect(modelInfo.id).toBe("claude-3-7-sonnet@20250219") // Default model
 		})
 	})
 })

+ 1 - 0
src/api/providers/openrouter.ts

@@ -107,6 +107,7 @@ export class OpenRouterHandler implements ApiHandler, SingleCompletionHandler {
 		// (models usually default to max tokens allowed)
 		let maxTokens: number | undefined
 		switch (this.getModel().id) {
+			case "anthropic/claude-3.7-sonnet":
 			case "anthropic/claude-3.5-sonnet":
 			case "anthropic/claude-3.5-sonnet:beta":
 			case "anthropic/claude-3.5-sonnet-20240620":

+ 1 - 1
src/core/Cline.ts

@@ -2792,7 +2792,7 @@ export class Cline {
 				"mistake_limit_reached",
 				this.api.getModel().id.includes("claude")
 					? `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").`
-					: "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.",
+					: "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.",
 			)
 			if (response === "messageResponse") {
 				userContent.push(

+ 6 - 44
src/core/webview/ClineProvider.ts

@@ -1900,23 +1900,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 			}
 
 			const response = await axios.get("https://router.requesty.ai/v1/models", config)
-			/*
-				{
-					"id": "anthropic/claude-3-5-sonnet-20240620",
-					"object": "model",
-					"created": 1738243330,
-					"owned_by": "system",
-					"input_price": 0.000003,
-					"caching_price": 0.00000375,
-					"cached_price": 3E-7,
-					"output_price": 0.000015,
-					"max_output_tokens": 8192,
-					"context_window": 200000,
-					"supports_caching": true,
-					"description": "Anthropic's most intelligent model. Highest level of intelligence and capability"
-					},
-				}
-			*/
+
 			if (response.data) {
 				const rawModels = response.data.data
 				const parsePrice = (price: any) => {
@@ -2116,34 +2100,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 		)
 
 		const models: Record<string, ModelInfo> = {}
+
 		try {
 			const response = await axios.get("https://openrouter.ai/api/v1/models")
-			/*
-			{
-				"id": "anthropic/claude-3.5-sonnet",
-				"name": "Anthropic: Claude 3.5 Sonnet",
-				"created": 1718841600,
-				"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",
-				"context_length": 200000,
-				"architecture": {
-					"modality": "text+image-\u003Etext",
-					"tokenizer": "Claude",
-					"instruct_type": null
-				},
-				"pricing": {
-					"prompt": "0.000003",
-					"completion": "0.000015",
-					"image": "0.0048",
-					"request": "0"
-				},
-				"top_provider": {
-					"context_length": 200000,
-					"max_completion_tokens": 8192,
-					"is_moderated": true
-				},
-				"per_request_limits": null
-			},
-			*/
+
 			if (response.data?.data) {
 				const rawModels = response.data.data
 				const parsePrice = (price: any) => {
@@ -2152,6 +2112,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 					}
 					return undefined
 				}
+
 				for (const rawModel of rawModels) {
 					const modelInfo: ModelInfo = {
 						maxTokens: rawModel.top_provider?.max_completion_tokens,
@@ -2164,9 +2125,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 					}
 
 					switch (rawModel.id) {
+						case "anthropic/claude-3.7-sonnet":
 						case "anthropic/claude-3.5-sonnet":
 						case "anthropic/claude-3.5-sonnet:beta":
-							// NOTE: this needs to be synced with api.ts/openrouter default model info
+							// NOTE: this needs to be synced with api.ts/openrouter default model info.
 							modelInfo.supportsComputerUse = true
 							modelInfo.supportsPromptCache = true
 							modelInfo.cacheWritesPrice = 3.75

+ 10 - 8
src/shared/api.ts

@@ -93,7 +93,7 @@ export interface ModelInfo {
 // Anthropic
 // https://docs.anthropic.com/en/docs/about-claude/models
 export type AnthropicModelId = keyof typeof anthropicModels
-export const anthropicDefaultModelId: AnthropicModelId = "claude-3-5-sonnet-20241022"
+export const anthropicDefaultModelId: AnthropicModelId = "claude-3-7-sonnet-20250219"
 export const anthropicModels = {
 	"claude-3-7-sonnet-20250219": {
 		maxTokens: 64_000,
@@ -355,7 +355,7 @@ export const bedrockModels = {
 
 // Glama
 // https://glama.ai/models
-export const glamaDefaultModelId = "anthropic/claude-3-5-sonnet"
+export const glamaDefaultModelId = "anthropic/claude-3-7-sonnet"
 export const glamaDefaultModelInfo: ModelInfo = {
 	maxTokens: 8192,
 	contextWindow: 200_000,
@@ -367,9 +367,12 @@ export const glamaDefaultModelInfo: ModelInfo = {
 	cacheWritesPrice: 3.75,
 	cacheReadsPrice: 0.3,
 	description:
-		"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._",
+		"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)",
 }
 
+// Requesty
+// https://requesty.ai/router-2
+export const requestyDefaultModelId = "anthropic/claude-3-7-sonnet-latest"
 export const requestyDefaultModelInfo: ModelInfo = {
 	maxTokens: 8192,
 	contextWindow: 200_000,
@@ -381,13 +384,12 @@ export const requestyDefaultModelInfo: ModelInfo = {
 	cacheWritesPrice: 3.75,
 	cacheReadsPrice: 0.3,
 	description:
-		"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._",
+		"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)",
 }
-export const requestyDefaultModelId = "anthropic/claude-3-5-sonnet"
 
 // OpenRouter
 // https://openrouter.ai/models?order=newest&supported_parameters=tools
-export const openRouterDefaultModelId = "anthropic/claude-3.5-sonnet:beta" // will always exist in openRouterModels
+export const openRouterDefaultModelId = "anthropic/claude-3.7-sonnet"
 export const openRouterDefaultModelInfo: ModelInfo = {
 	maxTokens: 8192,
 	contextWindow: 200_000,
@@ -399,13 +401,13 @@ export const openRouterDefaultModelInfo: ModelInfo = {
 	cacheWritesPrice: 3.75,
 	cacheReadsPrice: 0.3,
 	description:
-		"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._",
+		"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)",
 }
 
 // Vertex AI
 // https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
 export type VertexModelId = keyof typeof vertexModels
-export const vertexDefaultModelId: VertexModelId = "claude-3-5-sonnet-v2@20241022"
+export const vertexDefaultModelId: VertexModelId = "claude-3-7-sonnet@20250219"
 export const vertexModels = {
 	"claude-3-7-sonnet@20250219": {
 		maxTokens: 8192,

+ 9 - 6
src/test/suite/index.ts

@@ -13,23 +13,23 @@ declare global {
 }
 
 export async function run(): Promise<void> {
-	// Create the mocha test
 	const mocha = new Mocha({
 		ui: "tdd",
-		timeout: 600000, // 10 minutes to compensate for time communicating with LLM while running in GHA
+		timeout: 600000, // 10 minutes to compensate for time communicating with LLM while running in GHA.
 	})
 
 	const testsRoot = path.resolve(__dirname, "..")
 
 	try {
-		// Find all test files
+		// Find all test files.
 		const files = await glob("**/**.test.js", { cwd: testsRoot })
 
-		// Add files to the test suite
+		// Add files to the test suite.
 		files.forEach((f: string) => mocha.addFile(path.resolve(testsRoot, f)))
 
-		//Set up global extension, api, provider, and panel
+		// Set up global extension, api, provider, and panel.
 		globalThis.extension = vscode.extensions.getExtension("RooVeterinaryInc.roo-cline")
+
 		if (!globalThis.extension) {
 			throw new Error("Extension not found")
 		}
@@ -37,9 +37,12 @@ export async function run(): Promise<void> {
 		globalThis.api = globalThis.extension.isActive
 			? globalThis.extension.exports
 			: await globalThis.extension.activate()
+
 		globalThis.provider = globalThis.api.sidebarProvider
+
 		await globalThis.provider.updateGlobalState("apiProvider", "openrouter")
 		await globalThis.provider.updateGlobalState("openRouterModelId", "anthropic/claude-3.5-sonnet")
+
 		await globalThis.provider.storeSecret(
 			"openRouterApiKey",
 			process.env.OPENROUTER_API_KEY || "sk-or-v1-fake-api-key",
@@ -71,7 +74,7 @@ export async function run(): Promise<void> {
 			await new Promise((resolve) => setTimeout(resolve, interval))
 		}
 
-		// Run the mocha test
+		// Run the mocha test.
 		return new Promise((resolve, reject) => {
 			try {
 				mocha.run((failures: number) => {

+ 78 - 74
src/test/suite/modes.test.ts

@@ -1,101 +1,105 @@
 import * as assert from "assert"
-import * as vscode from "vscode"
 
 suite("Roo Code Modes", () => {
 	test("Should handle switching modes correctly", async function () {
 		const timeout = 30000
 		const interval = 1000
+
 		const testPrompt =
 			"For each mode (Code, Architect, Ask) respond with the mode name and what it specializes in after switching to that mode, do not start with the current mode, be sure to say 'I AM DONE' after the task is complete"
+
 		if (!globalThis.extension) {
 			assert.fail("Extension not found")
 		}
 
-		try {
-			let startTime = Date.now()
-
-			// Ensure the webview is launched.
-			while (Date.now() - startTime < timeout) {
-				if (globalThis.provider.viewLaunched) {
-					break
-				}
+		let startTime = Date.now()
 
-				await new Promise((resolve) => setTimeout(resolve, interval))
+		// Ensure the webview is launched.
+		while (Date.now() - startTime < timeout) {
+			if (globalThis.provider.viewLaunched) {
+				break
 			}
 
-			await globalThis.provider.updateGlobalState("mode", "Ask")
-			await globalThis.provider.updateGlobalState("alwaysAllowModeSwitch", true)
-			await globalThis.provider.updateGlobalState("autoApprovalEnabled", true)
+			await new Promise((resolve) => setTimeout(resolve, interval))
+		}
 
-			// Start a new task.
-			await globalThis.api.startNewTask(testPrompt)
+		await globalThis.provider.updateGlobalState("mode", "Ask")
+		await globalThis.provider.updateGlobalState("alwaysAllowModeSwitch", true)
+		await globalThis.provider.updateGlobalState("autoApprovalEnabled", true)
 
-			// Wait for task to appear in history with tokens.
-			startTime = Date.now()
+		// Start a new task.
+		await globalThis.api.startNewTask(testPrompt)
 
-			while (Date.now() - startTime < timeout) {
-				const messages = globalThis.provider.messages
+		// Wait for task to appear in history with tokens.
+		startTime = Date.now()
 
-				if (
-					messages.some(
-						({ type, text }) =>
-							type === "say" && text?.includes("I AM DONE") && !text?.includes("be sure to say"),
-					)
-				) {
-					break
-				}
+		while (Date.now() - startTime < timeout) {
+			const messages = globalThis.provider.messages
 
-				await new Promise((resolve) => setTimeout(resolve, interval))
-			}
-			if (globalThis.provider.messages.length === 0) {
-				assert.fail("No messages received")
+			if (
+				messages.some(
+					({ type, text }) =>
+						type === "say" && text?.includes("I AM DONE") && !text?.includes("be sure to say"),
+				)
+			) {
+				break
 			}
 
-			//Log the messages to the console
-			globalThis.provider.messages.forEach(({ type, text }) => {
-				if (type === "say") {
-					console.log(text)
-				}
-			})
-
-			//Start Grading Portion of test to grade the response from 1 to 10
-			await globalThis.provider.updateGlobalState("mode", "Ask")
-			let output = globalThis.provider.messages.map(({ type, text }) => (type === "say" ? text : "")).join("\n")
-			await globalThis.api.startNewTask(
-				`Given this prompt: ${testPrompt} grade the response from 1 to 10 in the format of "Grade: (1-10)": ${output} \n Be sure to say 'I AM DONE GRADING' after the task is complete`,
-			)
-
-			startTime = Date.now()
-
-			while (Date.now() - startTime < timeout) {
-				const messages = globalThis.provider.messages
-
-				if (
-					messages.some(
-						({ type, text }) =>
-							type === "say" && text?.includes("I AM DONE GRADING") && !text?.includes("be sure to say"),
-					)
-				) {
-					break
-				}
-
-				await new Promise((resolve) => setTimeout(resolve, interval))
+			await new Promise((resolve) => setTimeout(resolve, interval))
+		}
+
+		if (globalThis.provider.messages.length === 0) {
+			assert.fail("No messages received")
+		}
+
+		// Log the messages to the console.
+		globalThis.provider.messages.forEach(({ type, text }) => {
+			if (type === "say") {
+				console.log(text)
 			}
-			if (globalThis.provider.messages.length === 0) {
-				assert.fail("No messages received")
+		})
+
+		// Start Grading Portion of test to grade the response from 1 to 10.
+		await globalThis.provider.updateGlobalState("mode", "Ask")
+		let output = globalThis.provider.messages.map(({ type, text }) => (type === "say" ? text : "")).join("\n")
+
+		await globalThis.api.startNewTask(
+			`Given this prompt: ${testPrompt} grade the response from 1 to 10 in the format of "Grade: (1-10)": ${output} \n Be sure to say 'I AM DONE GRADING' after the task is complete`,
+		)
+
+		startTime = Date.now()
+
+		while (Date.now() - startTime < timeout) {
+			const messages = globalThis.provider.messages
+
+			if (
+				messages.some(
+					({ type, text }) =>
+						type === "say" && text?.includes("I AM DONE GRADING") && !text?.includes("be sure to say"),
+				)
+			) {
+				break
 			}
-			globalThis.provider.messages.forEach(({ type, text }) => {
-				if (type === "say" && text?.includes("Grade:")) {
-					console.log(text)
-				}
-			})
-			const gradeMessage = globalThis.provider.messages.find(
-				({ type, text }) => type === "say" && !text?.includes("Grade: (1-10)") && text?.includes("Grade:"),
-			)?.text
-			const gradeMatch = gradeMessage?.match(/Grade: (\d+)/)
-			const gradeNum = gradeMatch ? parseInt(gradeMatch[1]) : undefined
-			assert.ok(gradeNum !== undefined && gradeNum >= 7 && gradeNum <= 10, "Grade must be between 7 and 10")
-		} finally {
+
+			await new Promise((resolve) => setTimeout(resolve, interval))
+		}
+
+		if (globalThis.provider.messages.length === 0) {
+			assert.fail("No messages received")
 		}
+
+		globalThis.provider.messages.forEach(({ type, text }) => {
+			if (type === "say" && text?.includes("Grade:")) {
+				console.log(text)
+			}
+		})
+
+		const gradeMessage = globalThis.provider.messages.find(
+			({ type, text }) => type === "say" && !text?.includes("Grade: (1-10)") && text?.includes("Grade:"),
+		)?.text
+
+		const gradeMatch = gradeMessage?.match(/Grade: (\d+)/)
+		const gradeNum = gradeMatch ? parseInt(gradeMatch[1]) : undefined
+		assert.ok(gradeNum !== undefined && gradeNum >= 7 && gradeNum <= 10, "Grade must be between 7 and 10")
 	})
 })

+ 26 - 32
src/test/suite/task.test.ts

@@ -1,5 +1,4 @@
 import * as assert from "assert"
-import * as vscode from "vscode"
 
 suite("Roo Code Task", () => {
 	test("Should handle prompt and response correctly", async function () {
@@ -10,48 +9,43 @@ suite("Roo Code Task", () => {
 			assert.fail("Extension not found")
 		}
 
-		try {
-			// Ensure the webview is launched.
-			let startTime = Date.now()
+		// Ensure the webview is launched.
+		let startTime = Date.now()
 
-			while (Date.now() - startTime < timeout) {
-				if (globalThis.provider.viewLaunched) {
-					break
-				}
-
-				await new Promise((resolve) => setTimeout(resolve, interval))
+		while (Date.now() - startTime < timeout) {
+			if (globalThis.provider.viewLaunched) {
+				break
 			}
 
-			await globalThis.provider.updateGlobalState("mode", "Code")
-			await globalThis.provider.updateGlobalState("alwaysAllowModeSwitch", true)
-			await globalThis.provider.updateGlobalState("autoApprovalEnabled", true)
+			await new Promise((resolve) => setTimeout(resolve, interval))
+		}
 
-			await globalThis.api.startNewTask("Hello world, what is your name? Respond with 'My name is ...'")
+		await globalThis.provider.updateGlobalState("mode", "Code")
+		await globalThis.provider.updateGlobalState("alwaysAllowModeSwitch", true)
+		await globalThis.provider.updateGlobalState("autoApprovalEnabled", true)
 
-			// Wait for task to appear in history with tokens.
-			startTime = Date.now()
+		await globalThis.api.startNewTask("Hello world, what is your name? Respond with 'My name is ...'")
 
-			while (Date.now() - startTime < timeout) {
-				const messages = globalThis.provider.messages
+		// Wait for task to appear in history with tokens.
+		startTime = Date.now()
 
-				if (messages.some(({ type, text }) => type === "say" && text?.includes("My name is Roo"))) {
-					break
-				}
+		while (Date.now() - startTime < timeout) {
+			const messages = globalThis.provider.messages
 
-				await new Promise((resolve) => setTimeout(resolve, interval))
+			if (messages.some(({ type, text }) => type === "say" && text?.includes("My name is Roo"))) {
+				break
 			}
 
-			if (globalThis.provider.messages.length === 0) {
-				assert.fail("No messages received")
-			}
+			await new Promise((resolve) => setTimeout(resolve, interval))
+		}
 
-			assert.ok(
-				globalThis.provider.messages.some(
-					({ type, text }) => type === "say" && text?.includes("My name is Roo"),
-				),
-				"Did not receive expected response containing 'My name is Roo'",
-			)
-		} finally {
+		if (globalThis.provider.messages.length === 0) {
+			assert.fail("No messages received")
 		}
+
+		assert.ok(
+			globalThis.provider.messages.some(({ type, text }) => type === "say" && text?.includes("My name is Roo")),
+			"Did not receive expected response containing 'My name is Roo'",
+		)
 	})
 })

+ 1 - 1
webview-ui/src/components/settings/GlamaModelPicker.tsx

@@ -10,6 +10,6 @@ export const GlamaModelPicker = () => (
 		refreshMessageType="refreshGlamaModels"
 		serviceName="Glama"
 		serviceUrl="https://glama.ai/models"
-		recommendedModel="anthropic/claude-3-5-sonnet"
+		recommendedModel="anthropic/claude-3-7-sonnet"
 	/>
 )

+ 1 - 1
webview-ui/src/components/settings/OpenRouterModelPicker.tsx

@@ -10,6 +10,6 @@ export const OpenRouterModelPicker = () => (
 		refreshMessageType="refreshOpenRouterModels"
 		serviceName="OpenRouter"
 		serviceUrl="https://openrouter.ai/models"
-		recommendedModel="anthropic/claude-3.5-sonnet:beta"
+		recommendedModel="anthropic/claude-3.7-sonnet"
 	/>
 )

+ 1 - 1
webview-ui/src/components/settings/RequestyModelPicker.tsx

@@ -16,7 +16,7 @@ export const RequestyModelPicker = () => {
 			}}
 			serviceName="Requesty"
 			serviceUrl="https://requesty.ai"
-			recommendedModel="anthropic/claude-3-5-sonnet-latest"
+			recommendedModel="anthropic/claude-3-7-sonnet-latest"
 		/>
 	)
 }

+ 1 - 1
webview-ui/src/components/settings/SettingsView.tsx

@@ -765,7 +765,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
 								color: "var(--vscode-descriptionForeground)",
 							}}>
 							When enabled, Roo will be able to edit files more quickly and will automatically reject
-							truncated full-file writes. Works best with the latest Claude 3.5 Sonnet model.
+							truncated full-file writes. Works best with the latest Claude 3.7 Sonnet model.
 						</p>
 
 						{diffEnabled && (