Skip to content

Commit 4abadd8

Browse files
authored
Default to Sonnet 4 (#3928)
1 parent a734aca commit 4abadd8

File tree

23 files changed

+75
-49
lines changed

23 files changed

+75
-49
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jest.mock("delay", () => jest.fn(() => Promise.resolve()))
1212
jest.mock("../fetchers/modelCache", () => ({
1313
getModels: jest.fn().mockImplementation(() => {
1414
return Promise.resolve({
15-
"anthropic/claude-3.7-sonnet": {
15+
"anthropic/claude-sonnet-4": {
1616
maxTokens: 8192,
1717
contextWindow: 200000,
1818
supportsImages: true,
@@ -44,7 +44,7 @@ jest.mock("../fetchers/modelCache", () => ({
4444
describe("OpenRouterHandler", () => {
4545
const mockOptions: ApiHandlerOptions = {
4646
openRouterApiKey: "test-key",
47-
openRouterModelId: "anthropic/claude-3.7-sonnet",
47+
openRouterModelId: "anthropic/claude-sonnet-4",
4848
}
4949

5050
beforeEach(() => jest.clearAllMocks())
@@ -84,7 +84,7 @@ describe("OpenRouterHandler", () => {
8484
it("returns default model info when options are not provided", async () => {
8585
const handler = new OpenRouterHandler({})
8686
const result = await handler.fetchModel()
87-
expect(result.id).toBe("anthropic/claude-3.7-sonnet")
87+
expect(result.id).toBe("anthropic/claude-sonnet-4")
8888
expect(result.info.supportsPromptCache).toBe(true)
8989
})
9090

@@ -172,7 +172,7 @@ describe("OpenRouterHandler", () => {
172172
role: "user",
173173
},
174174
],
175-
model: "anthropic/claude-3.7-sonnet",
175+
model: "anthropic/claude-sonnet-4",
176176
stream: true,
177177
stream_options: { include_usage: true },
178178
temperature: 0,

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jest.mock("delay", () => jest.fn(() => Promise.resolve()))
1111
jest.mock("../fetchers/modelCache", () => ({
1212
getModels: jest.fn().mockImplementation(() => {
1313
return Promise.resolve({
14-
"coding/claude-3-7-sonnet": {
14+
"coding/claude-4-sonnet": {
1515
maxTokens: 8192,
1616
contextWindow: 200000,
1717
supportsImages: true,
@@ -21,7 +21,7 @@ jest.mock("../fetchers/modelCache", () => ({
2121
outputPrice: 15,
2222
cacheWritesPrice: 3.75,
2323
cacheReadsPrice: 0.3,
24-
description: "Claude 3.7 Sonnet",
24+
description: "Claude 4 Sonnet",
2525
},
2626
})
2727
}),
@@ -30,7 +30,7 @@ jest.mock("../fetchers/modelCache", () => ({
3030
describe("RequestyHandler", () => {
3131
const mockOptions: ApiHandlerOptions = {
3232
requestyApiKey: "test-key",
33-
requestyModelId: "coding/claude-3-7-sonnet",
33+
requestyModelId: "coding/claude-4-sonnet",
3434
}
3535

3636
beforeEach(() => jest.clearAllMocks())
@@ -66,7 +66,7 @@ describe("RequestyHandler", () => {
6666
outputPrice: 15,
6767
cacheWritesPrice: 3.75,
6868
cacheReadsPrice: 0.3,
69-
description: "Claude 3.7 Sonnet",
69+
description: "Claude 4 Sonnet",
7070
},
7171
})
7272
})
@@ -87,7 +87,7 @@ describe("RequestyHandler", () => {
8787
outputPrice: 15,
8888
cacheWritesPrice: 3.75,
8989
cacheReadsPrice: 0.3,
90-
description: "Claude 3.7 Sonnet",
90+
description: "Claude 4 Sonnet",
9191
},
9292
})
9393
})
@@ -161,7 +161,7 @@ describe("RequestyHandler", () => {
161161
content: "test message",
162162
},
163163
],
164-
model: "coding/claude-3-7-sonnet",
164+
model: "coding/claude-4-sonnet",
165165
stream: true,
166166
stream_options: { include_usage: true },
167167
temperature: undefined,

src/core/task/Task.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ProviderSettings } from "../../shared/api"
2020
import { findLastIndex } from "../../shared/array"
2121
import { combineApiRequests } from "../../shared/combineApiRequests"
2222
import { combineCommandSequences } from "../../shared/combineCommandSequences"
23+
import { t } from "../../i18n"
2324
import {
2425
ClineApiReqCancelReason,
2526
ClineApiReqInfo,
@@ -1039,9 +1040,7 @@ export class Task extends EventEmitter<ClineEvents> {
10391040
if (this.consecutiveMistakeCount >= this.consecutiveMistakeLimit) {
10401041
const { response, text, images } = await this.ask(
10411042
"mistake_limit_reached",
1042-
this.api.getModel().id.includes("claude")
1043-
? `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").`
1044-
: "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.",
1043+
t("common:errors.mistake_limit_guidance"),
10451044
)
10461045

10471046
if (response === "messageResponse") {

src/core/webview/__tests__/ClineProvider.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,7 +2114,7 @@ describe("getTelemetryProperties", () => {
21142114
mockCline = new Task(defaultTaskOptions)
21152115
mockCline.api = {
21162116
getModel: jest.fn().mockReturnValue({
2117-
id: "claude-3-7-sonnet-20250219",
2117+
id: "claude-sonnet-4-20250514",
21182118
info: { contextWindow: 200000 },
21192119
}),
21202120
}
@@ -2134,7 +2134,7 @@ describe("getTelemetryProperties", () => {
21342134

21352135
const properties = await provider.getTelemetryProperties()
21362136

2137-
expect(properties).toHaveProperty("modelId", "claude-3-7-sonnet-20250219")
2137+
expect(properties).toHaveProperty("modelId", "claude-sonnet-4-20250514")
21382138
})
21392139
})
21402140

src/i18n/locales/ca/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
"failed_remove_directory": "Ha fallat l'eliminació del directori de tasques: {{error}}",
5757
"custom_storage_path_unusable": "La ruta d'emmagatzematge personalitzada \"{{path}}\" no és utilitzable, s'utilitzarà la ruta predeterminada",
5858
"cannot_access_path": "No es pot accedir a la ruta {{path}}: {{error}}",
59-
"settings_import_failed": "Ha fallat la importació de la configuració: {{error}}."
59+
"settings_import_failed": "Ha fallat la importació de la configuració: {{error}}.",
60+
"mistake_limit_guidance": "Això pot indicar un error en el procés de pensament del model o la incapacitat d'utilitzar una eina correctament, que es pot mitigar amb orientació de l'usuari (p. ex. \"Prova de dividir la tasca en passos més petits\")."
6061
},
6162
"warnings": {
6263
"no_terminal_content": "No s'ha seleccionat contingut de terminal",

src/i18n/locales/de/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"failed_remove_directory": "Fehler beim Entfernen des Aufgabenverzeichnisses: {{error}}",
5353
"custom_storage_path_unusable": "Benutzerdefinierter Speicherpfad \"{{path}}\" ist nicht verwendbar, Standardpfad wird verwendet",
5454
"cannot_access_path": "Zugriff auf Pfad {{path}} nicht möglich: {{error}}",
55-
"settings_import_failed": "Fehler beim Importieren der Einstellungen: {{error}}."
55+
"settings_import_failed": "Fehler beim Importieren der Einstellungen: {{error}}.",
56+
"mistake_limit_guidance": "Dies kann auf einen Fehler im Denkprozess des Modells oder die Unfähigkeit hinweisen, ein Tool richtig zu verwenden, was durch Benutzerführung behoben werden kann (z.B. \"Versuche, die Aufgabe in kleinere Schritte zu unterteilen\")."
5657
},
5758
"warnings": {
5859
"no_terminal_content": "Kein Terminal-Inhalt ausgewählt",

src/i18n/locales/en/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"custom_storage_path_unusable": "Custom storage path \"{{path}}\" is unusable, will use default path",
5353
"cannot_access_path": "Cannot access path {{path}}: {{error}}",
5454
"failed_update_project_mcp": "Failed to update project MCP servers",
55-
"settings_import_failed": "Settings import failed: {{error}}."
55+
"settings_import_failed": "Settings import failed: {{error}}.",
56+
"mistake_limit_guidance": "This may indicate a failure in the model's 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\")."
5657
},
5758
"warnings": {
5859
"no_terminal_content": "No terminal content selected",

src/i18n/locales/es/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"failed_remove_directory": "Error al eliminar el directorio de tareas: {{error}}",
5353
"custom_storage_path_unusable": "La ruta de almacenamiento personalizada \"{{path}}\" no es utilizable, se usará la ruta predeterminada",
5454
"cannot_access_path": "No se puede acceder a la ruta {{path}}: {{error}}",
55-
"settings_import_failed": "Error al importar la configuración: {{error}}."
55+
"settings_import_failed": "Error al importar la configuración: {{error}}.",
56+
"mistake_limit_guidance": "Esto puede indicar un fallo en el proceso de pensamiento del modelo o la incapacidad de usar una herramienta correctamente, lo cual puede mitigarse con orientación del usuario (ej. \"Intenta dividir la tarea en pasos más pequeños\")."
5657
},
5758
"warnings": {
5859
"no_terminal_content": "No hay contenido de terminal seleccionado",

src/i18n/locales/fr/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"failed_remove_directory": "Échec de la suppression du répertoire de tâches : {{error}}",
5353
"custom_storage_path_unusable": "Le chemin de stockage personnalisé \"{{path}}\" est inutilisable, le chemin par défaut sera utilisé",
5454
"cannot_access_path": "Impossible d'accéder au chemin {{path}} : {{error}}",
55-
"settings_import_failed": "Échec de l'importation des paramètres : {{error}}"
55+
"settings_import_failed": "Échec de l'importation des paramètres : {{error}}",
56+
"mistake_limit_guidance": "Cela peut indiquer un échec dans le processus de réflexion du modèle ou une incapacité à utiliser un outil correctement, ce qui peut être atténué avec des conseils de l'utilisateur (par ex. \"Essaie de diviser la tâche en étapes plus petites\")."
5657
},
5758
"warnings": {
5859
"no_terminal_content": "Aucun contenu de terminal sélectionné",

src/i18n/locales/hi/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"failed_remove_directory": "टास्क डायरेक्टरी हटाने में विफल: {{error}}",
5353
"custom_storage_path_unusable": "कस्टम स्टोरेज पाथ \"{{path}}\" उपयोग योग्य नहीं है, डिफ़ॉल्ट पाथ का उपयोग किया जाएगा",
5454
"cannot_access_path": "पाथ {{path}} तक पहुंच नहीं पा रहे हैं: {{error}}",
55-
"settings_import_failed": "सेटिंग्स इम्पोर्ट करने में विफल: {{error}}।"
55+
"settings_import_failed": "सेटिंग्स इम्पोर्ट करने में विफल: {{error}}।",
56+
"mistake_limit_guidance": "यह मॉडल की सोच प्रक्रिया में विफलता या किसी टूल का सही उपयोग न कर पाने का संकेत हो सकता है, जिसे उपयोगकर्ता के मार्गदर्शन से ठीक किया जा सकता है (जैसे \"कार्य को छोटे चरणों में बांटने की कोशिश करें\")।"
5657
},
5758
"warnings": {
5859
"no_terminal_content": "कोई टर्मिनल सामग्री चयनित नहीं",

0 commit comments

Comments
 (0)