From 7a5731eb23783bd3144aeee279418cbe367637d5 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sat, 18 Oct 2025 01:33:39 -0700 Subject: [PATCH 01/13] feat: sonnet 4 5 updates and 3 5 deprecation --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- core/config/workspace/workspaceBlocks.ts | 7 +- core/llm/llms/Anthropic.vitest.ts | 30 ++-- core/llm/llms/OpenRouter.vitest.ts | 16 +-- core/llm/toolSupport.ts | 28 +--- .../model-providers/top-level/anthropic.mdx | 2 +- .../constants/ServerConstants.kt | 4 +- extensions/vscode/config_schema.json | 24 ++-- .../vscode/e2e/test-continue/config.json | 6 +- gui/src/pages/AddNewModel/configs/models.ts | 129 ++++++++++++------ .../pages/AddNewModel/configs/providers.ts | 11 +- manual-testing-sandbox/test.js | 38 ++++++ .../src/markdown/agentFiles.test.ts | 2 +- .../config-yaml/src/schemas/commonSlugs.ts | 7 +- packages/llm-info/src/providers/anthropic.ts | 58 ++++++-- packages/llm-info/src/providers/cometapi.ts | 18 +++ .../src/apis/OpenRouter.test.ts | 8 +- .../src/test/anthropic-adapter.vitest.ts | 14 +- .../openai-adapters/src/test/main.test.ts | 2 +- 19 files changed, 258 insertions(+), 148 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9eb505de7..ab65dca8e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -28,7 +28,7 @@ body: - **OS**: macOS - **Continue version**: v0.9.4 - **IDE version**: VSCode 1.85.1 - - Model: Claude Sonnet 3.5 + - Model: Claude Sonnet 4.5 - Agent configuration value: | - OS: diff --git a/core/config/workspace/workspaceBlocks.ts b/core/config/workspace/workspaceBlocks.ts index 9ba16b400..d055b4379 100644 --- a/core/config/workspace/workspaceBlocks.ts +++ b/core/config/workspace/workspaceBlocks.ts @@ -1,9 +1,8 @@ import { BlockType, ConfigYaml, - createRuleMarkdown, createPromptMarkdown, - RULE_FILE_EXTENSION, + createRuleMarkdown, } from "@continuedev/config-yaml"; import * as YAML from "yaml"; import { IDE } from "../.."; @@ -41,9 +40,9 @@ function getContentsForNewBlock(blockType: BlockType): ConfigYaml { configYaml.models = [ { provider: "anthropic", - model: "claude-3-7-sonnet-latest", + model: "claude-sonnet-4-latest", apiKey: "${{ secrets.ANTHROPIC_API_KEY }}", - name: "Claude 3.7 Sonnet", + name: "Claude Sonnet 4", roles: ["chat", "edit"], }, ]; diff --git a/core/llm/llms/Anthropic.vitest.ts b/core/llm/llms/Anthropic.vitest.ts index 5c623b05e..5a423ff91 100644 --- a/core/llm/llms/Anthropic.vitest.ts +++ b/core/llm/llms/Anthropic.vitest.ts @@ -134,7 +134,7 @@ describe("Anthropic", () => { test("streamChat should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); @@ -155,7 +155,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", max_tokens: 8192, stream: true, messages: [ @@ -177,7 +177,7 @@ describe("Anthropic", () => { test("chat should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); @@ -198,7 +198,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", max_tokens: 8192, stream: true, messages: [ @@ -220,7 +220,7 @@ describe("Anthropic", () => { test("streamComplete should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); @@ -238,7 +238,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", max_tokens: 8192, stream: true, messages: [ @@ -260,7 +260,7 @@ describe("Anthropic", () => { test("complete should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); @@ -278,7 +278,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", max_tokens: 8192, stream: true, messages: [ @@ -301,7 +301,7 @@ describe("Anthropic", () => { test("should handle system message", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); @@ -325,7 +325,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", max_tokens: 8192, stream: true, messages: [ @@ -347,7 +347,7 @@ describe("Anthropic", () => { test("should handle tool calls", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); @@ -386,7 +386,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", max_tokens: 8192, stream: true, messages: [ @@ -424,7 +424,7 @@ describe("Anthropic", () => { test("should handle custom max tokens", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); @@ -446,7 +446,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", max_tokens: 1000, stream: true, messages: [ @@ -470,7 +470,7 @@ describe("Anthropic", () => { test("should throw error when API key is missing", async () => { const anthropic = new Anthropic({ apiKey: "", - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4", apiBase: "https://api.anthropic.com/v1/", }); diff --git a/core/llm/llms/OpenRouter.vitest.ts b/core/llm/llms/OpenRouter.vitest.ts index e6e8afdd2..650f14306 100644 --- a/core/llm/llms/OpenRouter.vitest.ts +++ b/core/llm/llms/OpenRouter.vitest.ts @@ -6,13 +6,13 @@ import OpenRouter from "./OpenRouter"; describe("OpenRouter Anthropic Caching", () => { it("should detect Anthropic models correctly", () => { const openRouter = new OpenRouter({ - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", apiKey: "test-key", }); // Test private method through modifyChatBody const body: ChatCompletionCreateParams = { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", messages: [], }; @@ -71,7 +71,7 @@ describe("OpenRouter Anthropic Caching", () => { it("should correctly handle cache_control with system messages present", () => { const openRouter = new OpenRouter({ - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", apiKey: "test-key", cacheBehavior: { cacheConversation: true, @@ -80,7 +80,7 @@ describe("OpenRouter Anthropic Caching", () => { }); const body: ChatCompletionCreateParams = { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", messages: [ { role: "system", content: "You are a helpful assistant" }, { role: "user", content: "First user message" }, @@ -137,7 +137,7 @@ describe("OpenRouter Anthropic Caching", () => { it("should add cache_control to system message when caching is enabled", () => { const openRouter = new OpenRouter({ - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", apiKey: "test-key", cacheBehavior: { cacheConversation: false, @@ -146,7 +146,7 @@ describe("OpenRouter Anthropic Caching", () => { }); const body: ChatCompletionCreateParams = { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", messages: [ { role: "system", content: "You are a helpful assistant" }, { role: "user", content: "Hello" }, @@ -176,7 +176,7 @@ describe("OpenRouter Anthropic Caching", () => { it("should handle array content correctly", () => { const openRouter = new OpenRouter({ - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", apiKey: "test-key", cacheBehavior: { cacheConversation: true, @@ -185,7 +185,7 @@ describe("OpenRouter Anthropic Caching", () => { }); const body: ChatCompletionCreateParams = { - model: "claude-3-5-sonnet-latest", + model: "claude-sonnet-4-latest", messages: [ { role: "user", diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 7cdbd02cd..50f26e373 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -14,32 +14,12 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = } } catch (e) {} - return [ - "claude-3-5", - "claude-3.5", - "claude-3-7", - "claude-3.7", - "claude-sonnet-4", - "claude-4-sonnet", - "gpt-4", - "o3", - "gemini", - "claude-opus-4", - "gemma", - ].some((part) => model.toLowerCase().startsWith(part)); + return ["claude", "gpt-4", "o3", "gemini", "gemma"].some((part) => + model.toLowerCase().startsWith(part), + ); }, anthropic: (model) => { - if ( - [ - "claude-3-5", - "claude-3.5", - "claude-3-7", - "claude-3.7", - "claude-sonnet-4", - "claude-4-sonnet", - "claude-opus-4", - ].some((part) => model.toLowerCase().startsWith(part)) - ) { + if (["claude"].some((part) => model.toLowerCase().startsWith(part))) { return true; } diff --git a/docs/customize/model-providers/top-level/anthropic.mdx b/docs/customize/model-providers/top-level/anthropic.mdx index 7231e93e9..fc8ec83f8 100644 --- a/docs/customize/model-providers/top-level/anthropic.mdx +++ b/docs/customize/model-providers/top-level/anthropic.mdx @@ -41,7 +41,7 @@ sidebarTitle: "Anthropic" - **Check out a more advanced configuration [here](https://hub.continue.dev/anthropic/claude-4-sonnet?view=config)** + **Check out a more advanced configuration [here](https://hub.continue.dev/anthropic/claude-sonnet-4-5?view=config)** ## How to Enable Prompt Caching with Claude diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt index 5135dc87a..725cc948a 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/ServerConstants.kt @@ -14,10 +14,10 @@ const val DEFAULT_CONFIG = { "models": [ { - "model": "claude-3-5-sonnet-latest", + "model": "claude-sonnet-4-5", "provider": "anthropic", "apiKey": "", - "title": "Claude 3.5 Sonnet" + "title": "Claude Sonnet 4.5" } ], "tabAutocompleteModel": { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index e22df61b8..75f8df3fd 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -850,14 +850,10 @@ "anyOf": [ { "enum": [ - "claude-2", - "claude-instant-1", - "claude-3-5-sonnet-latest", - "claude-3-7-sonnet-20250219", - "claude-3-opus-20240229", - "claude-3-sonnet-20240229", - "claude-3-haiku-20240307", - "claude-2.1" + "claude-sonnet-4", + "claude-sonnet-4-5", + "claude-opus-4-1", + "claude-haiku-4-5" ] }, { @@ -1608,14 +1604,10 @@ "codeup-13b", "deepseek-7b", "deepseek-33b", - "claude-2", - "claude-instant-1", - "claude-3-5-sonnet-latest", - "claude-3-5-sonnet-20240620", - "claude-3-opus-20240229", - "claude-3-sonnet-20240229", - "claude-3-haiku-20240307", - "claude-2.1", + "claude-sonnet-4", + "claude-sonnet-4-5", + "claude-opus-4-1", + "claude-haiku-4-5", "command-r", "command-r-plus", "chat-bison-001", diff --git a/extensions/vscode/e2e/test-continue/config.json b/extensions/vscode/e2e/test-continue/config.json index fbe78fa0a..bb0a7c22f 100644 --- a/extensions/vscode/e2e/test-continue/config.json +++ b/extensions/vscode/e2e/test-continue/config.json @@ -16,7 +16,7 @@ { "provider": "mock", "title": "TOOL MOCK LLM", - "model": "claude-3-5-sonnet-latest", + "model": "claude-sonnet-4-latest", "capabilities": { "tools": true }, @@ -50,7 +50,7 @@ { "provider": "mock", "title": "SYSTEM MESSAGE MOCK LLM", - "model": "claude-3-5-sonnet-latest", + "model": "claude-sonnet-4-latest", "requestOptions": { "extraBodyProperties": { "chatStream": [["REPEAT_SYSTEM_MSG"]] @@ -60,7 +60,7 @@ { "provider": "mock", "title": "LAST MESSAGE MOCK LLM", - "model": "claude-3-5-sonnet-latest", + "model": "claude-sonnet-4-latest", "requestOptions": { "extraBodyProperties": { "chatStream": [["REPEAT_LAST_MSG"]] diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index aaa8092f7..bf77f1de2 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1145,27 +1145,42 @@ export const models: { [key: string]: ModelPackage } = { icon: "openai.png", isOpenSource: false, }, - claude4Sonnet: { - title: "Claude 4 Sonnet", + claude45Sonnet: { + title: "Claude Sonnet 4.5", description: - "The most intelligent model in the Claude 4 series. Costing lesser than Claude 4 Opus.", + "Anthropic's smartest model for complex agents and coding with exceptional performance in reasoning and multilingual tasks.", params: { - model: "claude-4-sonnet-latest", + model: "claude-sonnet-4-5-20250929", contextLength: 200_000, - title: "Claude 4 Sonnet", + title: "Claude 4.5 Sonnet", apiKey: "", }, providerOptions: ["anthropic"], icon: "anthropic.png", isOpenSource: false, }, - claude41Opus: { - title: "Claude 4.1 Opus", - description: "The most capable model in the Claude 4 series", + claude45Haiku: { + title: "Claude Haiku 4.5", + description: + "Anthropic's fastest model with near-frontier intelligence, ideal for quick and accurate responses.", params: { - model: "claude-opus-4-1-20250805", + model: "claude-haiku-4-5-20251001", contextLength: 200_000, - title: "Claude 4.1 Opus", + title: "Claude Haiku 4.5", + apiKey: "", + }, + providerOptions: ["anthropic"], + icon: "anthropic.png", + isOpenSource: false, + }, + claude4Sonnet: { + title: "Claude Sonnet 4", + description: + "The most intelligent model in the Claude 4 series. Costing lesser than Claude Opus 4.", + params: { + model: "claude-4-sonnet-latest", + contextLength: 200_000, + title: "Claude 4 Sonnet", apiKey: "", }, providerOptions: ["anthropic"], @@ -1186,6 +1201,20 @@ export const models: { [key: string]: ModelPackage } = { icon: "anthropic.png", isOpenSource: false, }, + claude41Opus: { + title: "Claude Opus 4.1", + description: "The most capable model in the Claude 4 series", + params: { + model: "claude-opus-4-1-20250805", + contextLength: 200_000, + title: "Claude Opus 4.1", + apiKey: "", + }, + providerOptions: ["anthropic"], + icon: "anthropic.png", + isOpenSource: false, + }, + graniteChat: { title: "Granite Chat 13b", description: @@ -1575,20 +1604,7 @@ export const models: { [key: string]: ModelPackage } = { icon: "openai.png", isOpenSource: false, }, - asksageclaude35Sonnet: { - title: "Claude 3.5 Sonnet", - description: - "Anthropic's most intelligent model, but much less expensive than Claude 3 Opus", - params: { - model: "claude-35-sonnet", - contextLength: 200_000, - title: "Claude 3.5 Sonnet", - apiKey: "", - }, - providerOptions: ["askSage"], - icon: "anthropic.png", - isOpenSource: false, - }, + asksageclaude37sonnet: { title: "Claude 3.7 Sonnet", description: "Anthropic's 3.7 model.", @@ -1615,19 +1631,7 @@ export const models: { [key: string]: ModelPackage } = { icon: "anthropic.png", isOpenSource: false, }, - asksageclaude35gov: { - title: "Claude 3.5 Sonnet gov*", - description: "Anthropic's 3.5 Sonnet model.", - params: { - model: "aws-bedrock-claude-35-sonnet-gov", - contextLength: 200_000, - title: "Claude 3.5 Sonnet gov*", - apiKey: "", - }, - providerOptions: ["askSage"], - icon: "anthropic.png", - isOpenSource: false, - }, + asksageclaude4s: { title: "Claude 4 Sonnet", description: "Anthropic's Claude 4 Sonnet", @@ -2320,20 +2324,61 @@ export const models: { [key: string]: ModelPackage } = { icon: "cometapi.png", isOpenSource: false, }, - cometapiClaude35HaikuLatest: { - title: "Claude 3.5 Haiku Latest", + cometapiClaude45Sonnet: { + title: "Claude 4.5 Sonnet Latest", description: - "Claude 3.5 Haiku Latest via CometAPI - fast and efficient model from Anthropic.", + "Claude 4.5 Sonnet Latest via CometAPI - Anthropic's smartest model for complex agents and coding.", params: { - model: "claude-3-5-haiku-latest", + model: "claude-sonnet-4-5-20250929", contextLength: 200_000, - title: "Claude 3.5 Haiku Latest", + title: "Claude 4.5 Sonnet Latest", apiKey: "", }, providerOptions: ["cometapi"], icon: "cometapi.png", isOpenSource: false, }, + cometapiClaude45Haiku: { + title: "Claude 4.5 Haiku Latest", + description: + "Claude 4.5 Haiku Latest via CometAPI - Anthropic's fastest model with near-frontier intelligence.", + params: { + model: "claude-haiku-4-5-20251001", + contextLength: 200_000, + title: "Claude 4.5 Haiku Latest", + apiKey: "", + }, + providerOptions: ["cometapi"], + icon: "cometapi.png", + isOpenSource: false, + }, + asksageclaude35Sonnet: { + title: "Claude 3.5 Sonnet", + description: + "Anthropic's most intelligent model, but much less expensive than Claude 3 Opus", + params: { + model: "claude-35-sonnet", + contextLength: 200_000, + title: "Claude 3.5 Sonnet", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, + asksageclaude35gov: { + title: "Claude 3.5 Sonnet gov*", + description: "Anthropic's 3.5 Sonnet model.", + params: { + model: "aws-bedrock-claude-35-sonnet-gov", + contextLength: 200_000, + title: "Claude 3.5 Sonnet gov*", + apiKey: "", + }, + providerOptions: ["askSage"], + icon: "anthropic.png", + isOpenSource: false, + }, // Gemini series models via CometAPI cometapiGemini25Pro: { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 88e091ce7..062533ead 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -77,12 +77,13 @@ export const providers: Partial> = { models.cometapiO4Mini, models.cometapiO3Pro, // Anthropic Claude family + models.cometapiClaude45Sonnet, + models.cometapiClaude45Haiku, models.cometapiClaudeOpus41, models.cometapiClaudeOpus41Thinking, models.cometapiClaudeSonnet4, models.cometapiClaudeSonnet4Thinking, models.cometapiClaude37SonnetLatest, - models.cometapiClaude35HaikuLatest, // Google Gemini family models.cometapiGemini25Pro, models.cometapiGemini25Flash, @@ -166,7 +167,13 @@ export const providers: Partial> = { defaultValue: 100000, }, ], - packages: [models.claude4Sonnet, models.claude41Opus, models.claude35Haiku], + packages: [ + models.claude45Sonnet, + models.claude45Haiku, + models.claude41Opus, + models.claude4Sonnet, + models.claude35Haiku, + ], apiKeyUrl: "https://console.anthropic.com/account/keys", }, moonshot: { diff --git a/manual-testing-sandbox/test.js b/manual-testing-sandbox/test.js index d2920d6af..1716c9566 100644 --- a/manual-testing-sandbox/test.js +++ b/manual-testing-sandbox/test.js @@ -1,21 +1,51 @@ +/** + * Calculator class that performs basic arithmetic operations + * Uses method chaining for convenient calculation sequences + */ class Calculator { + /** + * Initializes the calculator with result set to 0 + */ constructor() { this.result = 0; } + /** + * Adds a number to the current result + * @param {number} number - The number to add + * @returns {Calculator} - Returns this for method chaining + */ add(number) { this.result += number; return this; } + + /** + * Subtracts a number from the current result + * @param {number} number - The number to subtract + * @returns {Calculator} - Returns this for method chaining + */ subtract(number) { + this.result -= number; return this; } + /** + * Multiplies the current result by a number + * @param {number} number - The number to multiply by + * @returns {Calculator} - Returns this for method chaining + */ multiply(number) { this.result *= number; return this; } + /** + * Divides the current result by a number + * @param {number} number - The number to divide by + * @throws {Error} - Throws an error if attempting to divide by zero + * @returns {Calculator} - Returns this for method chaining + */ divide(number) { if (number === 0) { throw new Error("Cannot divide by zero"); @@ -24,10 +54,18 @@ class Calculator { return this; } + /** + * Gets the current result value + * @returns {number} - The current calculation result + */ getResult() { return this.result; } + /** + * Resets the result to 0 + * @returns {Calculator} - Returns this for method chaining + */ reset() { this.result = 0; return this; diff --git a/packages/config-yaml/src/markdown/agentFiles.test.ts b/packages/config-yaml/src/markdown/agentFiles.test.ts index 5f1a951af..1fa477320 100644 --- a/packages/config-yaml/src/markdown/agentFiles.test.ts +++ b/packages/config-yaml/src/markdown/agentFiles.test.ts @@ -185,7 +185,7 @@ describe("serializeAgentFile", () => { const agentFile: AgentFile = { name: "Test Agent File", description: "A test agent file", - model: "anthropic/claude-3-sonnet", + model: "anthropic/claude-sonnet-4-5", tools: "tool1, tool2", rules: "rule1, rule2", prompt: "This is the test prompt", diff --git a/packages/config-yaml/src/schemas/commonSlugs.ts b/packages/config-yaml/src/schemas/commonSlugs.ts index 3ba10bbd5..c0790c448 100644 --- a/packages/config-yaml/src/schemas/commonSlugs.ts +++ b/packages/config-yaml/src/schemas/commonSlugs.ts @@ -1,19 +1,20 @@ export const commonModelSlugs = [ - "anthropic/claude-3-7-sonnet", + "anthropic/claude-sonnet-4", "togetherai/llama-4-maverick-instruct-17bx128e", "google/gemini-2.5-pro", "mistral/codestral", "voyageai/voyage-code-3", + "anthropic/claude-sonnet-4-5", "relace/instant-apply", "xai/grok-2", "openai/gpt-4o", "togetherai/llama-4-scout-instruct-17bx16e", - "anthropic/claude-3-5-sonnet", + "anthropic/claude-haiku-4-5", "google/gemini-2.0-flash", "voyageai/rerank-2", + "anthropic/claude-opus-4-1", "ollama/deepseek-r1", "morphllm/morph-v0", - "anthropic/claude-3-5-haiku", "lmstudio/deepseek-r1", "openai/o3-mini", "voyageai/voyage-code-2", diff --git a/packages/llm-info/src/providers/anthropic.ts b/packages/llm-info/src/providers/anthropic.ts index 5c37f24da..62ae62b6a 100644 --- a/packages/llm-info/src/providers/anthropic.ts +++ b/packages/llm-info/src/providers/anthropic.ts @@ -4,13 +4,43 @@ export const Anthropic: ModelProvider = { id: "anthropic", displayName: "Anthropic", models: [ + { + model: "claude-sonnet-4-5-20250929", + displayName: "Claude 4.5 Sonnet", + contextLength: 200000, + maxCompletionTokens: 64000, + description: + "Anthropic's smartest model for complex agents and coding with exceptional performance in reasoning and multilingual tasks.", + regex: /claude-(?:4[.-]5-sonnet|sonnet-4[.-]5).*/i, + recommendedFor: ["chat"], + }, + { + model: "claude-haiku-4-5-20251001", + displayName: "Claude 4.5 Haiku", + contextLength: 200000, + maxCompletionTokens: 64000, + description: + "Anthropic's fastest model with near-frontier intelligence, ideal for quick and accurate responses.", + regex: /claude-(?:4[.-]5-haiku|haiku-4[.-]5).*/i, + recommendedFor: ["chat"], + }, + { + model: "claude-opus-4-1-20250805", + displayName: "Claude 4.1 Opus", + contextLength: 200000, + maxCompletionTokens: 32000, + description: + "Exceptional model for specialized reasoning tasks with advanced agentic capabilities and superior coding performance.", + regex: /claude-opus-4[.-]1.*/i, + recommendedFor: ["chat"], + }, { model: "claude-sonnet-4-20250514", displayName: "Claude 4 Sonnet", contextLength: 200000, maxCompletionTokens: 8192, description: - "Most intelligent model with the highest level of intelligence and capability.", + "Previous generation model with strong coding and reasoning capabilities, now superseded by Claude 4.5 Sonnet.", // Sometimes written as claude-4-sonnet, other times as claude-sonnet-4 regex: /claude-(?:4-sonnet|sonnet-4).*/i, recommendedFor: ["chat"], @@ -21,30 +51,30 @@ export const Anthropic: ModelProvider = { contextLength: 200000, maxCompletionTokens: 8192, description: - "Most intelligent model with the highest level of intelligence and capability.", + "Previous generation model with high intelligence, now superseded by Claude 4.1 Opus.", regex: /claude-(?:4-opus|opus-4).*/i, recommendedFor: ["chat"], }, + { + model: "claude-3-7-sonnet-latest", + displayName: "Claude 3.7 Sonnet", + contextLength: 200000, + maxCompletionTokens: 128000, + description: + "First hybrid reasoning model with extended thinking capabilities, excellent for coding and front-end development.", + regex: /claude-3[.-]7-sonnet.*/i, + recommendedFor: ["chat"], + }, { model: "claude-3-5-sonnet-latest", displayName: "Claude 3.5 Sonnet", contextLength: 200000, maxCompletionTokens: 8192, description: - "Most intelligent model with the highest level of intelligence and capability.", + "Previous flagship model with strong performance across diverse tasks, now superseded by Claude 4.5.", regex: /claude-3[.-]5-sonnet.*/i, recommendedFor: ["chat"], }, - { - model: "claude-3-7-sonnet-latest", - displayName: "Claude 3.7 Sonnet", - contextLength: 200000, - maxCompletionTokens: 8192, - description: - "Most intelligent model with the highest level of intelligence and capability.", - regex: /claude-3[.-]7-sonnet.*/i, - recommendedFor: ["chat"], - }, { model: "claude-3-opus-20240229", displayName: "Claude 3 Opus", @@ -96,7 +126,7 @@ export const Anthropic: ModelProvider = { contextLength: 100000, maxCompletionTokens: 4096, description: - "Our cheapest small and fast model, a predecessor of Claude Haiku.", + "Anthropic's cheapest small and fast model, a predecessor of Claude Haiku.", regex: /claude-instant-1\.2/i, }, ], diff --git a/packages/llm-info/src/providers/cometapi.ts b/packages/llm-info/src/providers/cometapi.ts index 441f5bd75..34f0a998a 100644 --- a/packages/llm-info/src/providers/cometapi.ts +++ b/packages/llm-info/src/providers/cometapi.ts @@ -79,6 +79,24 @@ export const CometAPI: ModelProvider = { }, // Claude Series + { + model: "claude-sonnet-4-5", + displayName: "Claude 4.5 Sonnet", + contextLength: 200000, + maxCompletionTokens: 64000, + description: + "Anthropic's smartest model for complex agents and coding with exceptional performance in reasoning and multilingual tasks.", + recommendedFor: ["chat"], + }, + { + model: "claude-haiku-4-5-20251001", + displayName: "Claude 4.5 Haiku (2025-10-01)", + contextLength: 200000, + maxCompletionTokens: 64000, + description: + "Anthropic's fastest model with near-frontier intelligence, ideal for quick and accurate responses.", + recommendedFor: ["chat"], + }, { model: "claude-opus-4-1-20250805", displayName: "Claude Opus 4.1 (2025-08-05)", diff --git a/packages/openai-adapters/src/apis/OpenRouter.test.ts b/packages/openai-adapters/src/apis/OpenRouter.test.ts index 6b7175446..e62e2123f 100644 --- a/packages/openai-adapters/src/apis/OpenRouter.test.ts +++ b/packages/openai-adapters/src/apis/OpenRouter.test.ts @@ -14,7 +14,7 @@ describe("OpenRouterApi Anthropic caching", () => { const api = new OpenRouterApi(baseConfig); const body: ChatCompletionCreateParams = { - model: "anthropic/claude-3.5-sonnet", + model: "anthropic/claude-sonnet-4-5", messages: [ { role: "user", content: "First" }, { role: "assistant", content: "Resp" }, @@ -161,7 +161,7 @@ describe("OpenRouterApi Anthropic caching", () => { describe("applyAnthropicCachingToOpenRouterBody", () => { it("mutates OpenAI chat body with system and tool caching", () => { const body: ChatCompletionCreateParams = { - model: "anthropic/claude-3.5-sonnet", + model: "anthropic/claude-sonnet-4-5", messages: [ { role: "system", content: "You are helpful" }, { role: "user", content: "Alpha" }, @@ -241,7 +241,7 @@ describe("OpenRouterApi Anthropic caching", () => { it("leaves system untouched when strategy is none while caching users", () => { const body: ChatCompletionCreateParams = { - model: "anthropic/claude-3.5-sonnet", + model: "anthropic/claude-sonnet-4-5", messages: [ { role: "system", content: "Stay focused" }, { role: "user", content: "Question" }, @@ -276,7 +276,7 @@ describe("OpenRouterApi Anthropic caching", () => { it("adds cache_control only to final text segment of user arrays", () => { const body: ChatCompletionCreateParams = { - model: "anthropic/claude-3.5-sonnet", + model: "anthropic/claude-sonnet-4-5", messages: [ { role: "user", diff --git a/packages/openai-adapters/src/test/anthropic-adapter.vitest.ts b/packages/openai-adapters/src/test/anthropic-adapter.vitest.ts index 859bcab02..dba75137c 100644 --- a/packages/openai-adapters/src/test/anthropic-adapter.vitest.ts +++ b/packages/openai-adapters/src/test/anthropic-adapter.vitest.ts @@ -35,7 +35,7 @@ describe("Anthropic Adapter Tests", () => { methodToTest: "chatCompletionNonStream", params: [ { - model: "claude-3-5-sonnet-20241022", + model: "claude-sonnet-4-5", messages: [{ role: "user", content: "hello" }], }, new AbortController().signal, @@ -62,7 +62,7 @@ describe("Anthropic Adapter Tests", () => { }, ], system: undefined, - model: "claude-3-5-sonnet-20241022", + model: "claude-sonnet-4-5", max_tokens: 32000, stream: undefined, }, @@ -77,7 +77,7 @@ describe("Anthropic Adapter Tests", () => { text: "Hello! How can I help you today?", }, ], - model: "claude-3-5-sonnet-20241022", + model: "claude-sonnet-4-5", stop_reason: "end_turn", stop_sequence: null, usage: { @@ -98,7 +98,7 @@ describe("Anthropic Adapter Tests", () => { methodToTest: "chatCompletionStream", params: [ { - model: "claude-3-5-sonnet-20241022", + model: "claude-sonnet-4-5", messages: [{ role: "user", content: "hello" }], stream: true, }, @@ -126,7 +126,7 @@ describe("Anthropic Adapter Tests", () => { }, ], system: undefined, - model: "claude-3-5-sonnet-20241022", + model: "claude-sonnet-4-5", max_tokens: 32000, stream: true, }, @@ -160,7 +160,7 @@ describe("Anthropic Adapter Tests", () => { methodToTest: "chatCompletionStream", params: [ { - model: "claude-3-5-sonnet-20241022", + model: "claude-sonnet-4-5", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "hello" }, @@ -197,7 +197,7 @@ describe("Anthropic Adapter Tests", () => { cache_control: { type: "ephemeral" }, }, ], - model: "claude-3-5-sonnet-20241022", + model: "claude-sonnet-4-5", max_tokens: 32000, stream: true, }, diff --git a/packages/openai-adapters/src/test/main.test.ts b/packages/openai-adapters/src/test/main.test.ts index 3b7b96193..8a10c8b72 100644 --- a/packages/openai-adapters/src/test/main.test.ts +++ b/packages/openai-adapters/src/test/main.test.ts @@ -70,7 +70,7 @@ const TESTS: Omit[] = [ }, { provider: "anthropic", - model: "claude-3-5-haiku-latest", + model: "claude-haiku-4-5", apiKey: process.env.ANTHROPIC_API_KEY!, roles: ["chat"], options: { From f3daebf49fd0f75a2ceec92446407d8e90c6d438 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 27 Nov 2025 16:07:24 +0530 Subject: [PATCH 02/13] chore: retry cli tests on macos --- extensions/cli/vitest.config.ts | 1 + extensions/cli/vitest.e2e.config.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/extensions/cli/vitest.config.ts b/extensions/cli/vitest.config.ts index 81b6c4b7f..5f8f22c11 100644 --- a/extensions/cli/vitest.config.ts +++ b/extensions/cli/vitest.config.ts @@ -20,6 +20,7 @@ export default defineConfig({ }, testTimeout: 30000, hookTimeout: 30000, + retry: process.env.CI && process.platform === "darwin" ? 2 : 0, }, resolve: { extensions: [".js", ".ts", ".tsx", ".json"], diff --git a/extensions/cli/vitest.e2e.config.ts b/extensions/cli/vitest.e2e.config.ts index 53d6d8210..520a88bb5 100644 --- a/extensions/cli/vitest.e2e.config.ts +++ b/extensions/cli/vitest.e2e.config.ts @@ -8,6 +8,7 @@ export default defineConfig({ include: ["src/e2e/**/*.test.ts"], testTimeout: 30000, hookTimeout: 30000, + retry: process.env.CI && process.platform === "darwin" ? 2 : 0, }, resolve: { extensions: [".js", ".ts", ".tsx", ".json"], From 6ba729efab6d93d4d622160475e4751c0e7bc1f7 Mon Sep 17 00:00:00 2001 From: "continue[bot]" Date: Thu, 27 Nov 2025 16:19:50 +0000 Subject: [PATCH 04/13] docs: fix formatting of autocomplete template variables Remove extra spaces in Mustache variable syntax for consistency. The documentation already listed all the correct variables including the 'language' parameter added in PR #1853. Co-authored-by: nate --- docs/reference/json-reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/json-reference.mdx b/docs/reference/json-reference.mdx index ad5ef6d16..e490968ff 100644 --- a/docs/reference/json-reference.mdx +++ b/docs/reference/json-reference.mdx @@ -120,7 +120,7 @@ Specifies options for tab autocompletion behavior. - `debounceDelay`: Delay (in ms) before triggering autocomplete (default: `350`). - `maxSuffixPercentage`: Maximum percentage of prompt for suffix (default: `0.2`). - `prefixPercentage`: Percentage of input for prefix (default: `0.3`). -- `template`: Template string for autocomplete, using Mustache templating. You can use the `{{{ prefix }}}`, `{{{ suffix }}}`, `{{{ filename }}}`, `{{{ reponame }}}`, and `{{{ language }}}` variables. +- `template`: Template string for autocomplete, using Mustache templating. You can use the `{{{prefix}}}`, `{{{suffix}}}`, `{{{filename}}}`, `{{{reponame}}}`, and `{{{language}}}` variables. - `onlyMyCode`: If `true`, only includes code within the repository (default: `true`). Example From ba603e8b482979a6187acfd9bee59a680336b504 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 1 Dec 2025 15:54:21 -0800 Subject: [PATCH 06/13] Add auto-continuation after compaction in chat streaming --- .../streamChatResponse.compactionHelpers.ts | 20 +-- .../cli/src/stream/streamChatResponse.ts | 124 ++++++++++++++---- 2 files changed, 112 insertions(+), 32 deletions(-) diff --git a/extensions/cli/src/stream/streamChatResponse.compactionHelpers.ts b/extensions/cli/src/stream/streamChatResponse.compactionHelpers.ts index 722e384a3..d1c42517f 100644 --- a/extensions/cli/src/stream/streamChatResponse.compactionHelpers.ts +++ b/extensions/cli/src/stream/streamChatResponse.compactionHelpers.ts @@ -66,11 +66,11 @@ export async function handlePostToolValidation( toolCalls: ToolCall[], chatHistory: ChatHistoryItem[], options: CompactionHelperOptions, -): Promise { +): Promise<{ chatHistory: ChatHistoryItem[]; wasCompacted: boolean }> { const { model, llmApi, isHeadless, callbacks, systemMessage } = options; if (toolCalls.length === 0) { - return chatHistory; + return { chatHistory, wasCompacted: false }; } // Get updated history after tool execution @@ -150,6 +150,7 @@ export async function handlePostToolValidation( inputTokens: postCompactionValidation.inputTokens, contextLimit: postCompactionValidation.contextLimit, }); + return { chatHistory, wasCompacted: true }; } else { // Compaction failed, cannot continue logger.error("Failed to compact history after tool execution overflow"); @@ -159,7 +160,7 @@ export async function handlePostToolValidation( } } - return chatHistory; + return { chatHistory, wasCompacted: false }; } /** @@ -169,11 +170,11 @@ export async function handleNormalAutoCompaction( chatHistory: ChatHistoryItem[], shouldContinue: boolean, options: CompactionHelperOptions, -): Promise { +): Promise<{ chatHistory: ChatHistoryItem[]; wasCompacted: boolean }> { const { model, llmApi, isHeadless, callbacks, systemMessage } = options; if (!shouldContinue) { - return chatHistory; + return { chatHistory, wasCompacted: false }; } const chatHistorySvc = services.chatHistory; @@ -198,11 +199,14 @@ export async function handleNormalAutoCompaction( // Use the service to update history if available, otherwise use local copy if (chatHistorySvc && typeof chatHistorySvc.setHistory === "function") { chatHistorySvc.setHistory(updatedChatHistory); - return chatHistorySvc.getHistory(); + return { + chatHistory: chatHistorySvc.getHistory(), + wasCompacted: true, + }; } // Fallback: return the compacted history directly when service unavailable - return updatedChatHistory; + return { chatHistory: updatedChatHistory, wasCompacted: true }; } - return chatHistory; + return { chatHistory, wasCompacted: false }; } diff --git a/extensions/cli/src/stream/streamChatResponse.ts b/extensions/cli/src/stream/streamChatResponse.ts index 814a12992..be23f9f7f 100644 --- a/extensions/cli/src/stream/streamChatResponse.ts +++ b/extensions/cli/src/stream/streamChatResponse.ts @@ -70,6 +70,63 @@ function handleContentDisplay( } } +// Helper function to refresh chat history from service +function refreshChatHistoryFromService( + chatHistory: ChatHistoryItem[], + isCompacting: boolean, +): ChatHistoryItem[] { + const chatHistorySvc = services.chatHistory; + if ( + typeof chatHistorySvc?.isReady === "function" && + chatHistorySvc.isReady() + ) { + try { + // use chat history from params when isCompacting is true + // otherwise use the full history + if (!isCompacting) { + return chatHistorySvc.getHistory(); + } + } catch {} + } + return chatHistory; +} + +// Helper function to handle auto-continuation after compaction +function handleAutoContinuation( + compactionOccurred: boolean, + shouldContinue: boolean, + chatHistory: ChatHistoryItem[], +): { shouldAutoContinue: boolean; chatHistory: ChatHistoryItem[] } { + if (!compactionOccurred || shouldContinue) { + return { shouldAutoContinue: false, chatHistory }; + } + + logger.debug( + "Auto-compaction occurred during this turn - automatically continuing session", + ); + + // Add a continuation message to the history + const chatHistorySvc = services.chatHistory; + if ( + typeof chatHistorySvc?.isReady === "function" && + chatHistorySvc.isReady() + ) { + chatHistorySvc.addUserMessage("continue"); + chatHistory = chatHistorySvc.getHistory(); + } else { + chatHistory.push({ + message: { + role: "user", + content: "continue", + }, + contextItems: [], + }); + } + + logger.debug("Added continuation message after compaction"); + return { shouldAutoContinue: true, chatHistory }; +} + // Helper function to process a single chunk interface ProcessChunkOptions { chunk: any; @@ -379,22 +436,11 @@ export async function streamChatResponse( let fullResponse = ""; let finalResponse = ""; + let compactionOccurredThisTurn = false; // Track if compaction happened during this conversation turn while (true) { // If ChatHistoryService is available, refresh local chatHistory view - const chatHistorySvc = services.chatHistory; - if ( - typeof chatHistorySvc?.isReady === "function" && - chatHistorySvc.isReady() - ) { - try { - // use chat history from params when isCompacting is true - // otherwise use the full history - if (!isCompacting) { - chatHistory = chatHistorySvc.getHistory(); - } - } catch {} - } + chatHistory = refreshChatHistoryFromService(chatHistory, isCompacting); logger.debug("Starting conversation iteration"); logger.debug("debug1 streamChatResponse history", { chatHistory }); @@ -414,6 +460,9 @@ export async function streamChatResponse( systemMessage, }); chatHistory = preCompactionResult.chatHistory; + if (preCompactionResult.wasCompacted) { + compactionOccurredThisTurn = true; + } // Recompute tools on each iteration to handle mode changes during streaming const tools = await getRequestTools(isHeadless); @@ -467,17 +516,25 @@ export async function streamChatResponse( } // After tool execution, validate that we haven't exceeded context limit - chatHistory = await handlePostToolValidation(toolCalls, chatHistory, { - model, - llmApi, - isCompacting, - isHeadless, - callbacks, - systemMessage, - }); + const postToolResult = await handlePostToolValidation( + toolCalls, + chatHistory, + { + model, + llmApi, + isCompacting, + isHeadless, + callbacks, + systemMessage, + }, + ); + chatHistory = postToolResult.chatHistory; + if (postToolResult.wasCompacted) { + compactionOccurredThisTurn = true; + } // Normal auto-compaction check at 80% threshold - chatHistory = await handleNormalAutoCompaction( + const compactionResult = await handleNormalAutoCompaction( chatHistory, shouldContinue, { @@ -489,9 +546,28 @@ export async function streamChatResponse( systemMessage, }, ); + chatHistory = compactionResult.chatHistory; + if (compactionResult.wasCompacted) { + compactionOccurredThisTurn = true; + } - // Check if we should continue - if (!shouldContinue) { + // If compaction happened during this turn and we're about to stop, + // automatically send a continuation message to keep the agent going + const autoContinueResult = handleAutoContinuation( + compactionOccurredThisTurn, + shouldContinue, + chatHistory, + ); + chatHistory = autoContinueResult.chatHistory; + const shouldAutoContinue = autoContinueResult.shouldAutoContinue; + + // Reset flag to avoid infinite continuation + if (shouldAutoContinue) { + compactionOccurredThisTurn = false; + } + + // Check if we should continue (skip break if auto-continuing after compaction) + if (!shouldContinue && !shouldAutoContinue) { break; } } From 0ec0249a0264a89ed424a8226a6792a8ea638995 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 1 Dec 2025 16:10:13 -0800 Subject: [PATCH 07/13] add a test --- ...treamChatResponse.autoContinuation.test.ts | 324 ++++++++++++++++++ 1 file changed, 324 insertions(+) create mode 100644 extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts diff --git a/extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts b/extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts new file mode 100644 index 000000000..8803ea987 --- /dev/null +++ b/extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts @@ -0,0 +1,324 @@ +import { ModelConfig } from "@continuedev/config-yaml"; +import { BaseLlmApi } from "@continuedev/openai-adapters"; +import type { ChatHistoryItem } from "core/index.js"; +import { convertToUnifiedHistory } from "core/util/messageConversion.js"; +import type { ChatCompletionChunk } from "openai/resources/chat/completions.mjs"; +import { beforeEach, describe, expect, it, vi } from "vitest"; + +import { streamChatResponse } from "./streamChatResponse.js"; + +// Mock all dependencies +vi.mock("../compaction.js", () => ({ + compactChatHistory: vi.fn(), + pruneLastMessage: vi.fn((history) => history.slice(0, -1)), +})); + +vi.mock("../session.js", () => ({ + updateSessionHistory: vi.fn(), +})); + +vi.mock("../util/tokenizer.js", () => ({ + shouldAutoCompact: vi.fn(), + getAutoCompactMessage: vi.fn(() => "Auto-compacting..."), + countChatHistoryItemTokens: vi.fn(() => 100), + validateContextLength: vi.fn(() => ({ isValid: true })), +})); + +vi.mock("../telemetry/telemetryService.js", () => ({ + telemetryService: { + logApiRequest: vi.fn(), + recordResponseTime: vi.fn(), + recordTokenUsage: vi.fn(), + recordCost: vi.fn(), + }, +})); + +vi.mock("../telemetry/posthogService.js", () => ({ + posthogService: { + capture: vi.fn(), + }, +})); + +vi.mock("../util/logger.js", () => ({ + logger: { + info: vi.fn(), + debug: vi.fn(), + error: vi.fn(), + warn: vi.fn(), + }, +})); + +vi.mock("../services/index.js", () => ({ + services: { + systemMessage: { + getSystemMessage: vi.fn(() => Promise.resolve("System message")), + }, + toolPermissions: { + getState: vi.fn(() => ({ currentMode: "enabled" })), + isHeadless: vi.fn(() => false), + }, + chatHistory: { + isReady: vi.fn(() => true), + getHistory: vi.fn(() => []), + setHistory: vi.fn(), + addUserMessage: vi.fn(), + }, + }, +})); + +vi.mock("./handleToolCalls.js", () => ({ + handleToolCalls: vi.fn(() => Promise.resolve(false)), + getRequestTools: vi.fn(() => Promise.resolve([])), +})); + +vi.mock("./streamChatResponse.compactionHelpers.js", () => ({ + handlePreApiCompaction: vi.fn((chatHistory) => + Promise.resolve({ chatHistory, wasCompacted: false }), + ), + handlePostToolValidation: vi.fn((_, chatHistory) => + Promise.resolve({ chatHistory, wasCompacted: false }), + ), + handleNormalAutoCompaction: vi.fn((chatHistory) => + Promise.resolve({ chatHistory, wasCompacted: false }), + ), +})); + +describe("streamChatResponse - auto-continuation after compaction", () => { + const mockModel: ModelConfig = { + provider: "openai", + name: "gpt-4", + model: "gpt-4", + defaultCompletionOptions: { + contextLength: 8192, + maxTokens: 2048, + }, + } as any; + + let mockLlmApi: BaseLlmApi; + let mockAbortController: AbortController; + let chatHistory: ChatHistoryItem[]; + let chunks: ChatCompletionChunk[]; + let responseCount: number; + + function contentChunk(content: string): ChatCompletionChunk { + return { + id: "test", + object: "chat.completion.chunk", + created: Date.now(), + model: "test-model", + choices: [ + { + index: 0, + delta: { content }, + finish_reason: null, + }, + ], + }; + } + + beforeEach(() => { + vi.clearAllMocks(); + responseCount = 0; + chunks = [contentChunk("Initial response")]; + chatHistory = convertToUnifiedHistory([{ role: "user", content: "Hello" }]); + + mockLlmApi = { + chatCompletionStream: vi.fn().mockImplementation(async function* () { + responseCount++; + for (const chunk of chunks) { + yield chunk; + } + }), + } as unknown as BaseLlmApi; + + mockAbortController = { + signal: { aborted: false }, + abort: vi.fn(), + } as unknown as AbortController; + }); + + it("should automatically continue after compaction when no tool calls remain", async () => { + const { services } = await import("../services/index.js"); + const { handleNormalAutoCompaction } = await import( + "./streamChatResponse.compactionHelpers.js" + ); + const { logger } = await import("../util/logger.js"); + + // Track history modifications + const historyUpdates: string[] = []; + vi.mocked(services.chatHistory.addUserMessage).mockImplementation((msg) => { + historyUpdates.push(msg); + return { + message: { role: "user", content: msg }, + contextItems: [], + }; + }); + + // First call: compaction happens + // Second call (after continuation): no compaction + let compactionCallCount = 0; + vi.mocked(handleNormalAutoCompaction).mockImplementation(() => { + compactionCallCount++; + return Promise.resolve({ + chatHistory, + wasCompacted: compactionCallCount === 1, // Only first call has compaction + }); + }); + + // Simulate: first response completes (no tool calls), triggering auto-continue + let callCount = 0; + mockLlmApi.chatCompletionStream = vi + .fn() + .mockImplementation(async function* () { + callCount++; + if (callCount === 1) { + // First call: just content, no tool calls (shouldContinue = false) + yield contentChunk("First response"); + } else if (callCount === 2) { + // Second call: after auto-continuation + yield contentChunk("Continued after compaction"); + } + }) as any; + + await streamChatResponse( + chatHistory, + mockModel, + mockLlmApi, + mockAbortController, + ); + + // Verify "continue" message was added + expect(historyUpdates).toContain("continue"); + + // Verify logging occurred + expect(logger.debug).toHaveBeenCalledWith( + "Auto-compaction occurred during this turn - automatically continuing session", + ); + expect(logger.debug).toHaveBeenCalledWith( + "Added continuation message after compaction", + ); + + // Verify the LLM was called multiple times (continuing the conversation) + expect(callCount).toBeGreaterThan(1); + }); + + it("should not auto-continue if compaction occurs with tool calls pending", async () => { + const { services } = await import("../services/index.js"); + const { handleNormalAutoCompaction } = await import( + "./streamChatResponse.compactionHelpers.js" + ); + const { handleToolCalls } = await import("./handleToolCalls.js"); + + const historyUpdates: string[] = []; + vi.mocked(services.chatHistory.addUserMessage).mockImplementation((msg) => { + historyUpdates.push(msg); + return { + message: { role: "user", content: msg }, + contextItems: [], + }; + }); + + // Compaction happens + vi.mocked(handleNormalAutoCompaction).mockResolvedValue({ + chatHistory, + wasCompacted: true, + }); + + // But tool calls are still being processed (shouldContinue = true) + // This is simulated by having handleToolCalls return true (shouldReturn) + vi.mocked(handleToolCalls).mockResolvedValue(true); + + // Mock tool calls in response + mockLlmApi.chatCompletionStream = vi + .fn() + .mockImplementation(async function* () { + yield { + id: "test", + object: "chat.completion.chunk", + created: Date.now(), + model: "test-model", + choices: [ + { + index: 0, + delta: { + tool_calls: [ + { + index: 0, + id: "call_123", + type: "function", + function: { + name: "ReadFile", + arguments: '{"filepath": "/test"}', + }, + }, + ], + }, + finish_reason: null, + }, + ], + }; + }) as any; + + await streamChatResponse( + chatHistory, + mockModel, + mockLlmApi, + mockAbortController, + ); + + // Should NOT auto-continue because tool calls are pending + expect(historyUpdates).not.toContain("continue"); + }); + + it("should not create infinite loops - flag is reset after continuation", async () => { + const { services } = await import("../services/index.js"); + const { handleNormalAutoCompaction } = await import( + "./streamChatResponse.compactionHelpers.js" + ); + + const historyUpdates: string[] = []; + vi.mocked(services.chatHistory.addUserMessage).mockImplementation((msg) => { + historyUpdates.push(msg); + return { + message: { role: "user", content: msg }, + contextItems: [], + }; + }); + + // Track calls - compaction happens on 1st turn, then again on 2nd turn + let normalCompactionCallCount = 0; + vi.mocked(handleNormalAutoCompaction).mockImplementation(() => { + normalCompactionCallCount++; + // Compaction happens on first two calls + return Promise.resolve({ + chatHistory, + wasCompacted: normalCompactionCallCount <= 1, + }); + }); + + let streamCallCount = 0; + mockLlmApi.chatCompletionStream = vi + .fn() + .mockImplementation(async function* () { + streamCallCount++; + yield contentChunk(`Response ${streamCallCount}`); + }) as any; + + await streamChatResponse( + chatHistory, + mockModel, + mockLlmApi, + mockAbortController, + ); + + // Should only add "continue" once + // The flag is reset after the first continuation + const continueCount = historyUpdates.filter( + (msg) => msg === "continue", + ).length; + expect(continueCount).toBeLessThanOrEqual(1); + + // Should have called the LLM at least once + expect(streamCallCount).toBeGreaterThanOrEqual(1); + }); +}); From 12040b609f8eae0f78643809b716958952478d28 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 2 Dec 2025 19:15:49 +0530 Subject: [PATCH 08/13] fix(cli): wait for tui to update in test --- .../ui/__tests__/TUIChat.editMessage.test.tsx | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/extensions/cli/src/ui/__tests__/TUIChat.editMessage.test.tsx b/extensions/cli/src/ui/__tests__/TUIChat.editMessage.test.tsx index 9e6a92874..73af37d50 100644 --- a/extensions/cli/src/ui/__tests__/TUIChat.editMessage.test.tsx +++ b/extensions/cli/src/ui/__tests__/TUIChat.editMessage.test.tsx @@ -1,4 +1,18 @@ -import { testBothModes, renderInMode } from "./TUIChat.dualModeHelper.js"; +import { renderInMode, testBothModes } from "./TUIChat.dualModeHelper.js"; + +async function waitForCondition( + conditionFn: () => boolean, + timeoutMs = 2000, + intervalMs = 50, +): Promise { + const startTime = Date.now(); + while (Date.now() - startTime < timeoutMs) { + if (conditionFn()) { + return; + } + await new Promise((resolve) => setTimeout(resolve, intervalMs)); + } +} /** * Integration tests for the message edit feature in TUIChat @@ -10,7 +24,6 @@ import { testBothModes, renderInMode } from "./TUIChat.dualModeHelper.js"; * 4. History is rewound and new message is submitted * 5. Chat updates correctly */ - describe("TUIChat - Message Edit Feature", () => { testBothModes("double Esc should open edit selector", async (mode) => { const { lastFrame, stdin } = renderInMode(mode); @@ -119,7 +132,11 @@ describe("TUIChat - Message Edit Feature", () => { // Perform various operations stdin.write("\u001b"); stdin.write("\u001b"); // Open edit with separate Esc presses - await new Promise((resolve) => setTimeout(resolve, 100)); + + // Wait for selector to open (poll instead of fixed timeout) + await waitForCondition( + () => lastFrame()?.includes("No user messages to edit") ?? false, + ); // Verify selector opened let frame = lastFrame(); @@ -130,7 +147,11 @@ describe("TUIChat - Message Edit Feature", () => { await new Promise((resolve) => setTimeout(resolve, 50)); stdin.write("\u001b"); // Close - await new Promise((resolve) => setTimeout(resolve, 100)); + + // Wait for selector to close (poll instead of fixed timeout) + await waitForCondition( + () => !(lastFrame()?.includes("No user messages to edit") ?? true), + ); frame = lastFrame(); From 163b004ce0c51a346cc0ceb47d67c7c5d4235c7d Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 2 Dec 2025 19:16:02 +0530 Subject: [PATCH 09/13] Revert "chore: retry cli tests on macos" This reverts commit f3daebf49fd0f75a2ceec92446407d8e90c6d438. --- extensions/cli/vitest.config.ts | 1 - extensions/cli/vitest.e2e.config.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/extensions/cli/vitest.config.ts b/extensions/cli/vitest.config.ts index 5f8f22c11..81b6c4b7f 100644 --- a/extensions/cli/vitest.config.ts +++ b/extensions/cli/vitest.config.ts @@ -20,7 +20,6 @@ export default defineConfig({ }, testTimeout: 30000, hookTimeout: 30000, - retry: process.env.CI && process.platform === "darwin" ? 2 : 0, }, resolve: { extensions: [".js", ".ts", ".tsx", ".json"], diff --git a/extensions/cli/vitest.e2e.config.ts b/extensions/cli/vitest.e2e.config.ts index 520a88bb5..53d6d8210 100644 --- a/extensions/cli/vitest.e2e.config.ts +++ b/extensions/cli/vitest.e2e.config.ts @@ -8,7 +8,6 @@ export default defineConfig({ include: ["src/e2e/**/*.test.ts"], testTimeout: 30000, hookTimeout: 30000, - retry: process.env.CI && process.platform === "darwin" ? 2 : 0, }, resolve: { extensions: [".js", ".ts", ".tsx", ".json"], From 7b036c66a22466cdd4e1ba4eb2baf3c39fcf0d83 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Dec 2025 12:35:27 -0800 Subject: [PATCH 10/13] chore: sonnet 4.5 preference --- core/config/workspace/workspaceBlocks.ts | 4 +- core/llm/llms/Anthropic.vitest.ts | 30 +++++++-------- core/llm/llms/OpenRouter.vitest.ts | 20 +++++----- docs/customize/models.mdx | 4 +- .../vscode/e2e/test-continue/config.json | 6 +-- manual-testing-sandbox/test.js | 38 ------------------- 6 files changed, 32 insertions(+), 70 deletions(-) diff --git a/core/config/workspace/workspaceBlocks.ts b/core/config/workspace/workspaceBlocks.ts index 71cfae8a6..4f20eda89 100644 --- a/core/config/workspace/workspaceBlocks.ts +++ b/core/config/workspace/workspaceBlocks.ts @@ -42,9 +42,9 @@ function getContentsForNewBlock(blockType: BlockType): ConfigYaml { configYaml.models = [ { provider: "anthropic", - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", apiKey: "${{ secrets.ANTHROPIC_API_KEY }}", - name: "Claude Sonnet 4", + name: "Claude Sonnet 4.5", roles: ["chat", "edit"], }, ]; diff --git a/core/llm/llms/Anthropic.vitest.ts b/core/llm/llms/Anthropic.vitest.ts index 5a423ff91..07915a93a 100644 --- a/core/llm/llms/Anthropic.vitest.ts +++ b/core/llm/llms/Anthropic.vitest.ts @@ -134,7 +134,7 @@ describe("Anthropic", () => { test("streamChat should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); @@ -155,7 +155,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", max_tokens: 8192, stream: true, messages: [ @@ -177,7 +177,7 @@ describe("Anthropic", () => { test("chat should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); @@ -198,7 +198,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", max_tokens: 8192, stream: true, messages: [ @@ -220,7 +220,7 @@ describe("Anthropic", () => { test("streamComplete should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); @@ -238,7 +238,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", max_tokens: 8192, stream: true, messages: [ @@ -260,7 +260,7 @@ describe("Anthropic", () => { test("complete should send a valid request", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); @@ -278,7 +278,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", max_tokens: 8192, stream: true, messages: [ @@ -301,7 +301,7 @@ describe("Anthropic", () => { test("should handle system message", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); @@ -325,7 +325,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", max_tokens: 8192, stream: true, messages: [ @@ -347,7 +347,7 @@ describe("Anthropic", () => { test("should handle tool calls", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); @@ -386,7 +386,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", max_tokens: 8192, stream: true, messages: [ @@ -424,7 +424,7 @@ describe("Anthropic", () => { test("should handle custom max tokens", async () => { const anthropic = new Anthropic({ apiKey: "test-api-key", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); @@ -446,7 +446,7 @@ describe("Anthropic", () => { "x-api-key": "test-api-key", }, body: { - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", max_tokens: 1000, stream: true, messages: [ @@ -470,7 +470,7 @@ describe("Anthropic", () => { test("should throw error when API key is missing", async () => { const anthropic = new Anthropic({ apiKey: "", - model: "claude-sonnet-4", + model: "claude-sonnet-4-5", apiBase: "https://api.anthropic.com/v1/", }); diff --git a/core/llm/llms/OpenRouter.vitest.ts b/core/llm/llms/OpenRouter.vitest.ts index 650f14306..85ca5dd1c 100644 --- a/core/llm/llms/OpenRouter.vitest.ts +++ b/core/llm/llms/OpenRouter.vitest.ts @@ -6,13 +6,13 @@ import OpenRouter from "./OpenRouter"; describe("OpenRouter Anthropic Caching", () => { it("should detect Anthropic models correctly", () => { const openRouter = new OpenRouter({ - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", apiKey: "test-key", }); // Test private method through modifyChatBody const body: ChatCompletionCreateParams = { - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", messages: [], }; @@ -22,7 +22,7 @@ describe("OpenRouter Anthropic Caching", () => { it("should add cache_control to user messages when caching is enabled", () => { const openRouter = new OpenRouter({ - model: "anthropic/claude-3.5-sonnet", + model: "anthropic/claude-sonnet-4.5", apiKey: "test-key", cacheBehavior: { cacheConversation: true, @@ -31,7 +31,7 @@ describe("OpenRouter Anthropic Caching", () => { }); const body: ChatCompletionCreateParams = { - model: "anthropic/claude-3.5-sonnet", + model: "anthropic/claude-sonnet-4.5", messages: [ { role: "user", content: "First message" }, { role: "assistant", content: "Response" }, @@ -71,7 +71,7 @@ describe("OpenRouter Anthropic Caching", () => { it("should correctly handle cache_control with system messages present", () => { const openRouter = new OpenRouter({ - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", apiKey: "test-key", cacheBehavior: { cacheConversation: true, @@ -80,7 +80,7 @@ describe("OpenRouter Anthropic Caching", () => { }); const body: ChatCompletionCreateParams = { - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", messages: [ { role: "system", content: "You are a helpful assistant" }, { role: "user", content: "First user message" }, @@ -137,7 +137,7 @@ describe("OpenRouter Anthropic Caching", () => { it("should add cache_control to system message when caching is enabled", () => { const openRouter = new OpenRouter({ - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", apiKey: "test-key", cacheBehavior: { cacheConversation: false, @@ -146,7 +146,7 @@ describe("OpenRouter Anthropic Caching", () => { }); const body: ChatCompletionCreateParams = { - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", messages: [ { role: "system", content: "You are a helpful assistant" }, { role: "user", content: "Hello" }, @@ -176,7 +176,7 @@ describe("OpenRouter Anthropic Caching", () => { it("should handle array content correctly", () => { const openRouter = new OpenRouter({ - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", apiKey: "test-key", cacheBehavior: { cacheConversation: true, @@ -185,7 +185,7 @@ describe("OpenRouter Anthropic Caching", () => { }); const body: ChatCompletionCreateParams = { - model: "claude-sonnet-4-latest", + model: "claude-sonnet-4-5", messages: [ { role: "user", diff --git a/docs/customize/models.mdx b/docs/customize/models.mdx index a21827a30..85bcf25c4 100644 --- a/docs/customize/models.mdx +++ b/docs/customize/models.mdx @@ -30,10 +30,10 @@ Read more about [model roles](/customize/model-roles), [model capabilities](/cus # Frontier Models -[Claude 4 Sonnet](https://hub.continue.dev/anthropic/claude-4-sonnet) from Anthropic +[Claude Sonnet 4.5](https://hub.continue.dev/anthropic/claude-sonnet-4-5) from Anthropic 1. Get your API key from [Anthropic](https://console.anthropic.com/) -2. Add [Claude 4 Sonnet](https://hub.continue.dev/anthropic/claude-4-sonnet) to a config on Continue Mission Control +2. Add[Claude Sonnet 4.5](https://hub.continue.dev/anthropic/claude-sonnet-4-5) to a config on Continue Mission Control 3. Add `ANTHROPIC_API_KEY` as a [User Secret](https://docs.continue.dev/mission-control/secrets/secret-types#user-secrets) on Continue Mission Control [here](https://hub.continue.dev/settings/secrets) 4. Click `Reload config` in the config selector in the Continue IDE extension diff --git a/extensions/vscode/e2e/test-continue/config.json b/extensions/vscode/e2e/test-continue/config.json index bb0a7c22f..814552d91 100644 --- a/extensions/vscode/e2e/test-continue/config.json +++ b/extensions/vscode/e2e/test-continue/config.json @@ -16,7 +16,7 @@ { "provider": "mock", "title": "TOOL MOCK LLM", - "model": "claude-sonnet-4-latest", + "model": "claude-sonnet-4-5", "capabilities": { "tools": true }, @@ -50,7 +50,7 @@ { "provider": "mock", "title": "SYSTEM MESSAGE MOCK LLM", - "model": "claude-sonnet-4-latest", + "model": "claude-sonnet-4-5", "requestOptions": { "extraBodyProperties": { "chatStream": [["REPEAT_SYSTEM_MSG"]] @@ -60,7 +60,7 @@ { "provider": "mock", "title": "LAST MESSAGE MOCK LLM", - "model": "claude-sonnet-4-latest", + "model": "claude-sonnet-4-5", "requestOptions": { "extraBodyProperties": { "chatStream": [["REPEAT_LAST_MSG"]] diff --git a/manual-testing-sandbox/test.js b/manual-testing-sandbox/test.js index 1716c9566..d2920d6af 100644 --- a/manual-testing-sandbox/test.js +++ b/manual-testing-sandbox/test.js @@ -1,51 +1,21 @@ -/** - * Calculator class that performs basic arithmetic operations - * Uses method chaining for convenient calculation sequences - */ class Calculator { - /** - * Initializes the calculator with result set to 0 - */ constructor() { this.result = 0; } - /** - * Adds a number to the current result - * @param {number} number - The number to add - * @returns {Calculator} - Returns this for method chaining - */ add(number) { this.result += number; return this; } - - /** - * Subtracts a number from the current result - * @param {number} number - The number to subtract - * @returns {Calculator} - Returns this for method chaining - */ subtract(number) { - this.result -= number; return this; } - /** - * Multiplies the current result by a number - * @param {number} number - The number to multiply by - * @returns {Calculator} - Returns this for method chaining - */ multiply(number) { this.result *= number; return this; } - /** - * Divides the current result by a number - * @param {number} number - The number to divide by - * @throws {Error} - Throws an error if attempting to divide by zero - * @returns {Calculator} - Returns this for method chaining - */ divide(number) { if (number === 0) { throw new Error("Cannot divide by zero"); @@ -54,18 +24,10 @@ class Calculator { return this; } - /** - * Gets the current result value - * @returns {number} - The current calculation result - */ getResult() { return this.result; } - /** - * Resets the result to 0 - * @returns {Calculator} - Returns this for method chaining - */ reset() { this.result = 0; return this; From 5908d184ca3381a7b8679728412a2119898591ea Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Dec 2025 13:14:02 -0800 Subject: [PATCH 11/13] fix: tool support tests --- core/llm/toolSupport.test.ts | 16 +++++----------- core/llm/toolSupport.ts | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/core/llm/toolSupport.test.ts b/core/llm/toolSupport.test.ts index 2f0f566e7..7981dac5f 100644 --- a/core/llm/toolSupport.test.ts +++ b/core/llm/toolSupport.test.ts @@ -179,17 +179,11 @@ describe("PROVIDER_TOOL_SUPPORT", () => { }); it("should return undefined for Claude Haiku and Opus models", () => { - expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe( - false, - ); - expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe( - false, - ); - expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe( - false, - ); - expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(false); - expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(false); + expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(true); + expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(true); + expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(true); + expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(true); + expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(true); }); it("should return undefined for other unsupported models", () => { diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 1b2ddd266..3466a50ee 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -19,6 +19,9 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = ); }, anthropic: (model) => { + if (model.includes("claude-2") || model.includes("claude-instant")) { + return false; + } if (["claude"].some((part) => model.toLowerCase().startsWith(part))) { return true; } @@ -100,15 +103,12 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = ); }, bedrock: (model) => { + if (model.includes("claude-2") || model.includes("claude-instant")) { + return false; + } if ( [ - "claude-3-5-sonnet", - "claude-3.5-sonnet", - "claude-3-7-sonnet", - "claude-3.7-sonnet", - "claude-sonnet-4", - "claude-4-sonnet", - "claude-opus-4", + "claude", "nova-lite", "nova-pro", "nova-micro", @@ -255,8 +255,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "openai/o3", "openai/o4", "openai/gpt-oss", - "anthropic/claude-3", - "anthropic/claude-4", + "anthropic/claude", "microsoft/phi-3", "google/gemini-flash-1.5", "google/gemini-2", @@ -366,7 +365,8 @@ export function isRecommendedAgentModel(modelName: string): boolean { const recs: RegExp[][] = [ [/o[134]/], [/deepseek/, /r1|reasoner/], - [/gemini/, /2\.5|3/, /pro/], + [/gemini/, /2\.5/, /pro/], + [/gemini/, /3-pro/], [/gpt/, /-5|5\.1/], [/claude/, /sonnet/, /3\.7|3-7|-4/], [/claude/, /opus/, /-4/], From d83a2c55c5ed945bdec7053da5708359b4a5de33 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 2 Dec 2025 18:32:16 -0800 Subject: [PATCH 12/13] Increase terminal command timeout from 30s to 120s --- extensions/cli/src/tools/runTerminalCommand.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index 69706c21a..cfa096655 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -88,7 +88,7 @@ IMPORTANT: To edit files, use Edit/MultiEdit tools instead of bash commands (sed const TIMEOUT_MS = process.env.NODE_ENV === "test" && process.env.TEST_TERMINAL_TIMEOUT ? parseInt(process.env.TEST_TERMINAL_TIMEOUT, 10) - : 30000; // 30 seconds default, configurable for tests + : 120000; // 120 seconds default, configurable for tests const resetTimeout = () => { if (timeoutId) { From 28d3374f388fa6b2ae88bee4ca30d969069906a6 Mon Sep 17 00:00:00 2001 From: "continue[bot]" Date: Wed, 3 Dec 2025 02:34:32 +0000 Subject: [PATCH 13/13] docs: Update terminal command timeout from 30s to 120s in shell-mode.md Co-authored-by: nate Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- extensions/cli/spec/shell-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/cli/spec/shell-mode.md b/extensions/cli/spec/shell-mode.md index 06ad477e9..2a4693b8a 100644 --- a/extensions/cli/spec/shell-mode.md +++ b/extensions/cli/spec/shell-mode.md @@ -44,8 +44,8 @@ Output handling - Stdout is streamed into memory; Stderr is captured and appended as a trailing "Stderr: ..." section on success. - If the process exits non-zero and Stderr contains content, the tool call is marked as error and the error text is shown. - Output is truncated to the first 5000 lines if exceeded. -- Timeout behavior: If no output is received for 30 seconds (configurable in tests), the process is terminated and the result includes a note like: - "[Command timed out after 30 seconds of no output]". +- Timeout behavior: If no output is received for 120 seconds (configurable in tests), the process is terminated and the result includes a note like: + "[Command timed out after 120 seconds of no output]". Keyboard behaviors (summary)