From 37e6c34d0309c8899ccf5fc84c19e88afdd34a39 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Mon, 4 Aug 2025 23:21:53 -0400 Subject: [PATCH 01/35] chore(gui): remove EXAONE icon --- core/llm/toolSupport.ts | 12 ++++++++++ gui/src/pages/AddNewModel/configs/models.ts | 26 +++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index a7edbbd36..177de83ca 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -60,6 +60,11 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = ) { return true; } + // LGAI EXAONE models expose an OpenAI-compatible API with tool + // calling support when served via frameworks like vLLM + if (model.toLowerCase().includes("exaone")) { + return true; + } // firworks-ai https://docs.fireworks.ai/guides/function-calling if (model.startsWith("accounts/fireworks/models/")) { switch (model.substring(26)) { @@ -299,6 +304,8 @@ export function isRecommendedAgentModel(modelName: string): boolean { [/gpt/, /4/], [/claude/, /sonnet/, /3\.5|3\.7|3-5|3-7|-4/], [/claude/, /opus/, /-4/], + // EXAONE 4.0 and 4.0-1 variants + [/exaone/, /4\.0(-1)?/], ]; for (const combo of recs) { if (combo.every((regex) => modelName.toLowerCase().match(regex))) { @@ -311,6 +318,11 @@ export function modelSupportsNativeTools(modelDescription: ModelDescription) { if (modelDescription.capabilities?.tools !== undefined) { return modelDescription.capabilities.tools; } + // EXAONE 4.0 models advertise tool-calling capability regardless of + // the provider used to serve them. + if (modelDescription.model.toLowerCase().includes("exaone")) { + return true; + } const providerSupport = PROVIDER_TOOL_SUPPORT[modelDescription.provider]; if (!providerSupport) { return false; diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index f68ac0555..c2d10702d 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -302,6 +302,32 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["nebius"], isOpenSource: true, }, + exaone32B: { + title: "EXAONE 4.0-1 32B", + description: + "LG AI Research's 32B model with integrated reasoning and agentic tool use capabilities.", + refUrl: "https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-1.32B", + params: { + title: "EXAONE-4.0-1.32B", + model: "LGAI-EXAONE/EXAONE-4.0-1.32B", + contextLength: 131072, + }, + providerOptions: ["openai"], + isOpenSource: true, + }, + exaone12B: { + title: "EXAONE 4.0-1.2B", + description: + "Compact EXAONE 4.0 model suitable for on-device use while retaining tool calling support.", + refUrl: "https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-1.2B", + params: { + title: "EXAONE-4.0-1.2B", + model: "LGAI-EXAONE/EXAONE-4.0-1.2B", + contextLength: 65536, + }, + providerOptions: ["openai"], + isOpenSource: true, + }, moonshotChat: { title: "Moonshot Chat", description: "Moonshot AI provides high-performance large language models", From 9d60f162b44bd54647f1c292c8af1ee430ca35f5 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Tue, 5 Aug 2025 09:21:56 -0400 Subject: [PATCH 02/35] fix: handle exaone version naming --- core/llm/toolSupport.ts | 4 ++-- gui/src/pages/AddNewModel/configs/models.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 177de83ca..562c315cc 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -304,8 +304,8 @@ export function isRecommendedAgentModel(modelName: string): boolean { [/gpt/, /4/], [/claude/, /sonnet/, /3\.5|3\.7|3-5|3-7|-4/], [/claude/, /opus/, /-4/], - // EXAONE 4.0 and 4.0-1 variants - [/exaone/, /4\.0(-1)?/], + // EXAONE 4.0, 4.0-1, and 4.0.1 variants + [/exaone/, /4\.0(?:[-.]1)?/], ]; for (const combo of recs) { if (combo.every((regex) => modelName.toLowerCase().match(regex))) { diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index c2d10702d..476a8c9e9 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -303,13 +303,13 @@ export const models: { [key: string]: ModelPackage } = { isOpenSource: true, }, exaone32B: { - title: "EXAONE 4.0-1 32B", + title: "EXAONE 4.0.1-32B", description: "LG AI Research's 32B model with integrated reasoning and agentic tool use capabilities.", - refUrl: "https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-1.32B", + refUrl: "https://huggingface.co/LGAI-EXAONE/EXAONE-4.0.1-32B", params: { - title: "EXAONE-4.0-1.32B", - model: "LGAI-EXAONE/EXAONE-4.0-1.32B", + title: "EXAONE-4.0.1-32B", + model: "LGAI-EXAONE/EXAONE-4.0.1-32B", contextLength: 131072, }, providerOptions: ["openai"], From 97d426bf68f402ff9cfb5691ad6b5384683c3909 Mon Sep 17 00:00:00 2001 From: Keerthana Panyam Date: Tue, 29 Jul 2025 14:38:45 -0400 Subject: [PATCH 03/35] restrict autocomplete context from other files in config.yaml added schema properties and tabAutocompleteOptions schema to to support in YAML config file, allowing proper override of default values from parameters.ts. added .optional() tags to tabAutocompleteOptions properties to enable partial override from the config.yaml file. --- core/config/yaml/loadYaml.ts | 1 + .../mainInput/Lump/EditBlockButton.tsx | 2 +- packages/config-types/src/index.ts | 29 ++++++++++++------- packages/config-yaml/src/load/unroll.ts | 10 ++++++- packages/config-yaml/src/schemas/index.ts | 5 ++++ 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index dbfd88a08..94aba67be 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -429,6 +429,7 @@ async function configYamlToContinueConfig(options: { })), false, ); + continueConfig.tabAutocompleteOptions = config.tabAutocompleteOptions; return { config: continueConfig, errors: localErrors }; } diff --git a/gui/src/components/mainInput/Lump/EditBlockButton.tsx b/gui/src/components/mainInput/Lump/EditBlockButton.tsx index 19780e875..0bce9f642 100644 --- a/gui/src/components/mainInput/Lump/EditBlockButton.tsx +++ b/gui/src/components/mainInput/Lump/EditBlockButton.tsx @@ -6,7 +6,7 @@ import { IdeMessengerContext } from "../../../context/IdeMessenger"; type SectionKey = Exclude< keyof ConfigYaml, - "name" | "version" | "schema" | "metadata" + "name" | "version" | "schema" | "metadata" | "tabAutocompleteOptions" >; interface EditBlockButtonProps { diff --git a/packages/config-types/src/index.ts b/packages/config-types/src/index.ts index 11c1ca20c..942f75219 100644 --- a/packages/config-types/src/index.ts +++ b/packages/config-types/src/index.ts @@ -136,21 +136,28 @@ export const uiOptionsSchema = z.object({ export type UiOptions = z.infer; export const tabAutocompleteOptionsSchema = z.object({ - disable: z.boolean(), - maxPromptTokens: z.number(), - debounceDelay: z.number(), - maxSuffixPercentage: z.number(), - prefixPercentage: z.number(), + disable: z.boolean().optional(), + maxPromptTokens: z.number().optional(), + debounceDelay: z.number().optional(), + maxSuffixPercentage: z.number().optional(), + prefixPercentage: z.number().optional(), transform: z.boolean().optional(), template: z.string().optional(), - multilineCompletions: z.enum(["always", "never", "auto"]), - slidingWindowPrefixPercentage: z.number(), - slidingWindowSize: z.number(), - useCache: z.boolean(), - onlyMyCode: z.boolean(), - useRecentlyEdited: z.boolean(), + multilineCompletions: z.enum(["always", "never", "auto"]).optional(), + slidingWindowPrefixPercentage: z.number().optional(), + slidingWindowSize: z.number().optional(), + useCache: z.boolean().optional(), + onlyMyCode: z.boolean().optional(), + useRecentlyEdited: z.boolean().optional(), + useRecentlyOpened: z.boolean().optional(), disableInFiles: z.array(z.string()).optional(), useImports: z.boolean().optional(), + // Experimental options + experimental_includeClipboard: z.boolean().optional(), + experimental_includeRecentlyVisitedRanges: z.boolean().optional(), + experimental_includeRecentlyEditedRanges: z.boolean().optional(), + experimental_includeDiff: z.boolean().optional(), + experimental_enableStaticContextualization: z.boolean().optional(), }); export type TabAutocompleteOptions = z.infer< typeof tabAutocompleteOptionsSchema diff --git a/packages/config-yaml/src/load/unroll.ts b/packages/config-yaml/src/load/unroll.ts index adbe45324..6ab35bc21 100644 --- a/packages/config-yaml/src/load/unroll.ts +++ b/packages/config-yaml/src/load/unroll.ts @@ -309,11 +309,19 @@ export async function unrollBlocks( const unrolledAssistant: AssistantUnrolled = { name: assistant.name, version: assistant.version, + ...(assistant.tabAutocompleteOptions && { + tabAutocompleteOptions: assistant.tabAutocompleteOptions, + }), }; const sections: (keyof Omit< ConfigYaml, - "name" | "version" | "rules" | "schema" | "metadata" + | "name" + | "version" + | "rules" + | "schema" + | "metadata" + | "tabAutocompleteOptions" >)[] = ["models", "context", "data", "mcpServers", "prompts", "docs"]; // Process all sections in parallel diff --git a/packages/config-yaml/src/schemas/index.ts b/packages/config-yaml/src/schemas/index.ts index e15a5655d..8ef2c1a61 100644 --- a/packages/config-yaml/src/schemas/index.ts +++ b/packages/config-yaml/src/schemas/index.ts @@ -1,4 +1,5 @@ import * as z from "zod"; +import { tabAutocompleteOptionsSchema } from "../../../config-types/src/index.js"; import { commonModelSlugs } from "./commonSlugs.js"; import { dataSchema } from "./data/index.js"; import { @@ -145,6 +146,7 @@ export const configYamlSchema = baseConfigYamlSchema.extend({ .optional(), prompts: z.array(blockOrSchema(promptSchema)).optional(), docs: z.array(blockOrSchema(docSchema)).optional(), + tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type ConfigYaml = z.infer; @@ -157,6 +159,7 @@ export const assistantUnrolledSchema = baseConfigYamlSchema.extend({ rules: z.array(ruleSchema.nullable()).optional(), prompts: z.array(promptSchema.nullable()).optional(), docs: z.array(docSchema.nullable()).optional(), + tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type AssistantUnrolled = z.infer; @@ -169,6 +172,7 @@ export const assistantUnrolledSchemaNonNullable = baseConfigYamlSchema.extend({ rules: z.array(ruleSchema).optional(), prompts: z.array(promptSchema).optional(), docs: z.array(docSchema).optional(), + tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type AssistantUnrolledNonNullable = z.infer< @@ -254,6 +258,7 @@ export const configSchema = z.object({ proxy: z.string().optional(), api_base: z.string().optional(), api_key: z.string().optional(), + tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type Config = z.infer; From f1a6c8eb0c46a04e9056a1accce8f193a32b92cd Mon Sep 17 00:00:00 2001 From: Keerthana Panyam Date: Thu, 31 Jul 2025 13:30:45 -0400 Subject: [PATCH 04/35] changing import from config-types package importing from the built config-types package instead of its src/ --- core/autocomplete/CompletionProvider.ts | 2 +- packages/config-yaml/src/schemas/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/autocomplete/CompletionProvider.ts b/core/autocomplete/CompletionProvider.ts index d51c15853..143dbf269 100644 --- a/core/autocomplete/CompletionProvider.ts +++ b/core/autocomplete/CompletionProvider.ts @@ -10,8 +10,8 @@ import { BracketMatchingService } from "./filtering/BracketMatchingService.js"; import { CompletionStreamer } from "./generation/CompletionStreamer.js"; import { postprocessCompletion } from "./postprocessing/index.js"; import { shouldPrefilter } from "./prefiltering/index.js"; -import { renderPromptWithTokenLimit } from "./templating/index.js"; import { getAllSnippetsWithoutRace } from "./snippets/index.js"; +import { renderPromptWithTokenLimit } from "./templating/index.js"; import { GetLspDefinitionsFunction } from "./types.js"; import { AutocompleteDebouncer } from "./util/AutocompleteDebouncer.js"; import { AutocompleteLoggingService } from "./util/AutocompleteLoggingService.js"; diff --git a/packages/config-yaml/src/schemas/index.ts b/packages/config-yaml/src/schemas/index.ts index 8ef2c1a61..dc1ff9c9d 100644 --- a/packages/config-yaml/src/schemas/index.ts +++ b/packages/config-yaml/src/schemas/index.ts @@ -1,5 +1,5 @@ +import { tabAutocompleteOptionsSchema } from "@continuedev/config-types"; import * as z from "zod"; -import { tabAutocompleteOptionsSchema } from "../../../config-types/src/index.js"; import { commonModelSlugs } from "./commonSlugs.js"; import { dataSchema } from "./data/index.js"; import { From 8da18259a37c676d8c0cd9c91a11f7e9406e5335 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Tue, 5 Aug 2025 22:33:17 -0400 Subject: [PATCH 05/35] Add lgai-exaone to openrouter options --- core/llm/toolSupport.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 0cd2e32ba..3711eaa1b 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -269,6 +269,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "deepseek/deepseek-chat", "meta-llama/llama-4", "all-hands/openhands-lm-32b", + "lgai-exaone/exaone", ]; for (const prefix of supportedPrefixes) { if (model.toLowerCase().startsWith(prefix)) { From b821fb2448f07ae930e1bba7fa505e7d1217a110 Mon Sep 17 00:00:00 2001 From: vldf Date: Wed, 6 Aug 2025 12:19:47 +0300 Subject: [PATCH 06/35] Feat: disable edit prompt action for the init prompt --- .../components/mainInput/Lump/sections/PromptsSection.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx b/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx index 10fb767b3..beb4b87e7 100644 --- a/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx @@ -60,6 +60,9 @@ function PromptRow({ } }; + const canEdit = + prompt.promptFile && !prompt.promptFile.startsWith("builtin:"); + return (
Date: Wed, 6 Aug 2025 09:02:34 -0400 Subject: [PATCH 07/35] Add exaone to ollama provider --- core/llm/toolSupport.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 3711eaa1b..7fc35c104 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -181,6 +181,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "firefunction-v2", "mistral", "devstral", + "exaone", ].some((part) => modelName.toLowerCase().includes(part)) ) { return true; From e251289d06cdfcac7e5b501849f92fc277ce2d25 Mon Sep 17 00:00:00 2001 From: QiuYang Shen <1741258352@qq.com> Date: Thu, 7 Aug 2025 02:21:01 +0800 Subject: [PATCH 08/35] fix: fix tool execute abnormal when there is no tool policy data in the local cache --- extensions/vscode/e2e/tests/GUI.test.ts | 1 - gui/src/redux/thunks/callToolById.ts | 9 ++++--- gui/src/redux/thunks/streamNormalInput.ts | 33 +++++++++++++++-------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/extensions/vscode/e2e/tests/GUI.test.ts b/extensions/vscode/e2e/tests/GUI.test.ts index 421e17772..589e37ff4 100644 --- a/extensions/vscode/e2e/tests/GUI.test.ts +++ b/extensions/vscode/e2e/tests/GUI.test.ts @@ -287,7 +287,6 @@ describe("GUI Test", () => { }).timeout(DEFAULT_TIMEOUT.MD); it("should render tool call", async () => { - await GUIActions.toggleToolPolicy(view, "view_diff", 0); const [messageInput] = await GUISelectors.getMessageInputFields(view); await messageInput.sendKeys("Hello"); await messageInput.sendKeys(Key.ENTER); diff --git a/gui/src/redux/thunks/callToolById.ts b/gui/src/redux/thunks/callToolById.ts index 468838ec6..32898f30e 100644 --- a/gui/src/redux/thunks/callToolById.ts +++ b/gui/src/redux/thunks/callToolById.ts @@ -14,6 +14,7 @@ import { import { ThunkApiType } from "../store"; import { findToolCallById, logToolUsage } from "../util"; import { streamResponseAfterToolCall } from "./streamResponseAfterToolCall"; +import { DEFAULT_TOOL_SETTING } from "../slices/uiSlice"; export const callToolById = createAsyncThunk< void, @@ -36,9 +37,11 @@ export const callToolById = createAsyncThunk< // Check if this is an auto-approved tool const toolSettings = state.ui.toolSettings; - const isAutoApproved = - toolSettings[toolCallState.toolCall.function.name] === - "allowedWithoutPermission"; + const toolPolicy = + toolSettings[toolCallState.toolCall.function.name] ?? + toolCallState.tool?.defaultToolPolicy ?? + DEFAULT_TOOL_SETTING; + const isAutoApproved = toolPolicy === "allowedWithoutPermission"; posthog.capture("gui_tool_call_decision", { decision: isAutoApproved ? "auto_accept" : "accept", diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 6e3939a5b..769f4e82e 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -28,6 +28,7 @@ import { interceptSystemToolCalls } from "core/tools/systemMessageTools/intercep import { selectCurrentToolCalls } from "../selectors/selectToolCalls"; import { getBaseSystemMessage } from "../util/getBaseSystemMessage"; import { callToolById } from "./callToolById"; +import { DEFAULT_TOOL_SETTING } from "../slices/uiSlice"; /** * Handles the execution of tool calls that may be automatically accepted. * Sets all tools as generated first, then executes auto-approved tool calls. @@ -35,6 +36,7 @@ import { callToolById } from "./callToolById"; async function handleToolCallExecution( dispatch: AppThunkDispatch, getState: () => RootState, + activeTools: Tool[], ): Promise { const newState = getState(); const toolSettings = newState.ui.toolSettings; @@ -51,11 +53,15 @@ async function handleToolCallExecution( } // Check if ALL tool calls are auto-approved - if not, wait for user approval - const allAutoApproved = toolCallStates.every( - (toolCallState) => - toolSettings[toolCallState.toolCall.function.name] === - "allowedWithoutPermission", - ); + const allAutoApproved = toolCallStates.every((toolCallState) => { + const toolPolicy = + toolSettings[toolCallState.toolCall.function.name] ?? + activeTools.find( + (tool) => tool.function.name === toolCallState.toolCall.function.name, + )?.defaultToolPolicy ?? + DEFAULT_TOOL_SETTING; + return toolPolicy == "allowedWithoutPermission"; + }); // Set all tools as generated first toolCallStates.forEach((toolCallState) => { @@ -289,11 +295,16 @@ export const streamNormalInput = createAsyncThunk< // Check if ALL generating tool calls are auto-approved const allAutoApproved = generatingToolCalls.length > 0 && - generatingToolCalls.every( - (toolCallState) => - toolSettings[toolCallState.toolCall.function.name] === - "allowedWithoutPermission", - ); + generatingToolCalls.every((toolCallState) => { + const toolPolicy = + toolSettings[toolCallState.toolCall.function.name] ?? + activeTools.find( + (tool) => + tool.function.name === toolCallState.toolCall.function.name, + )?.defaultToolPolicy ?? + DEFAULT_TOOL_SETTING; + return toolPolicy == "allowedWithoutPermission"; + }); // Only set inactive if: // 1. There are no tool calls, OR @@ -303,6 +314,6 @@ export const streamNormalInput = createAsyncThunk< dispatch(setInactive()); } - await handleToolCallExecution(dispatch, getState); + await handleToolCallExecution(dispatch, getState, activeTools); }, ); From 75fd68d8c97fb977f7ee3242934af358cbcff406 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Wed, 6 Aug 2025 23:07:30 -0400 Subject: [PATCH 09/35] Remove EXAONE from OpenRouter --- core/llm/toolSupport.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 41e43bf8c..d3a8684d0 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -277,7 +277,6 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "deepseek/deepseek-chat", "meta-llama/llama-4", "all-hands/openhands-lm-32b", - "lgai-exaone/exaone", ]; for (const prefix of supportedPrefixes) { if (model.toLowerCase().startsWith(prefix)) { From d4b0609a7a87f5b89ab7a0086901f676b658033a Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 6 Aug 2025 20:14:07 -0700 Subject: [PATCH 10/35] fix: tell model no tools are available if they aren't (#7034) * fix: tell model no tools are available if they aren't * fix: prettier * fix: no duplicate warning message for tests * fix: revert main prettier chanages --- gui/src/redux/thunks/streamNormalInput.ts | 1 + .../redux/util/getBaseSystemMessage.test.ts | 73 +++++++++++++++---- gui/src/redux/util/getBaseSystemMessage.ts | 21 +++++- 3 files changed, 75 insertions(+), 20 deletions(-) diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 13c57da8e..d3f99c64d 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -173,6 +173,7 @@ export const streamNormalInput = createAsyncThunk< const baseSystemMessage = getBaseSystemMessage( state.session.mode, selectedChatModel, + activeTools, ); const systemMessage = systemToolsFramework diff --git a/gui/src/redux/util/getBaseSystemMessage.test.ts b/gui/src/redux/util/getBaseSystemMessage.test.ts index ef2eef559..ed069693a 100644 --- a/gui/src/redux/util/getBaseSystemMessage.test.ts +++ b/gui/src/redux/util/getBaseSystemMessage.test.ts @@ -1,10 +1,10 @@ -import { ModelDescription } from "core"; +import { ModelDescription, Tool } from "core"; import { DEFAULT_AGENT_SYSTEM_MESSAGE, DEFAULT_CHAT_SYSTEM_MESSAGE, DEFAULT_PLAN_SYSTEM_MESSAGE, } from "core/llm/defaultSystemMessages"; -import { getBaseSystemMessage } from "./getBaseSystemMessage"; +import { getBaseSystemMessage, NO_TOOL_WARNING } from "./getBaseSystemMessage"; test("getBaseSystemMessage should return the correct system message based on mode", () => { const mockModel = { @@ -13,33 +13,74 @@ test("getBaseSystemMessage should return the correct system message based on mod baseAgentSystemMessage: "Custom Agent System Message", } as ModelDescription; - // Test agent mode with custom message - expect(getBaseSystemMessage("agent", mockModel)).toBe( + const mockTool = { + function: { + name: "testTool", + description: "Test tool", + parameters: {}, + }, + } as Tool; + + // Test agent mode with custom message and tools + expect(getBaseSystemMessage("agent", mockModel, [mockTool])).toBe( "Custom Agent System Message", ); - // Test plan mode with custom message - expect(getBaseSystemMessage("plan", mockModel)).toBe( + // Test plan mode with custom message and tools + expect(getBaseSystemMessage("plan", mockModel, [mockTool])).toBe( "Custom Plan System Message", ); - // Test chat mode with custom message - expect(getBaseSystemMessage("chat", mockModel)).toBe( + // Test chat mode with custom message and tools + expect(getBaseSystemMessage("chat", mockModel, [mockTool])).toBe( "Custom Chat System Message", ); - // Test agent mode with default message - expect(getBaseSystemMessage("agent", {} as ModelDescription)).toBe( - DEFAULT_AGENT_SYSTEM_MESSAGE, - ); + // Test agent mode with default message and tools + expect( + getBaseSystemMessage("agent", {} as ModelDescription, [mockTool]), + ).toBe(DEFAULT_AGENT_SYSTEM_MESSAGE); - // Test plan mode with default message - expect(getBaseSystemMessage("plan", {} as ModelDescription)).toBe( + // Test plan mode with default message and tools + expect(getBaseSystemMessage("plan", {} as ModelDescription, [mockTool])).toBe( DEFAULT_PLAN_SYSTEM_MESSAGE, ); - // Test chat mode with default message - expect(getBaseSystemMessage("chat", {} as ModelDescription)).toBe( + // Test chat mode with default message and tools + expect(getBaseSystemMessage("chat", {} as ModelDescription, [mockTool])).toBe( DEFAULT_CHAT_SYSTEM_MESSAGE, ); }); + +test("getBaseSystemMessage should append no-tools warning for agent/plan modes without tools", () => { + const mockModel = { + baseChatSystemMessage: "Custom Chat System Message", + basePlanSystemMessage: "Custom Plan System Message", + baseAgentSystemMessage: "Custom Agent System Message", + } as ModelDescription; + + // Test agent mode without tools + expect(getBaseSystemMessage("agent", mockModel, [])).toBe( + "Custom Agent System Message" + NO_TOOL_WARNING, + ); + + // Test plan mode without tools + expect(getBaseSystemMessage("plan", mockModel, [])).toBe( + "Custom Plan System Message" + NO_TOOL_WARNING, + ); + + // Test chat mode without tools (should not append warning) + expect(getBaseSystemMessage("chat", mockModel, [])).toBe( + "Custom Chat System Message", + ); + + // Test agent mode with undefined tools + expect(getBaseSystemMessage("agent", mockModel)).toBe( + "Custom Agent System Message" + NO_TOOL_WARNING, + ); + + // Test plan mode with undefined tools + expect(getBaseSystemMessage("plan", mockModel)).toBe( + "Custom Plan System Message" + NO_TOOL_WARNING, + ); +}); diff --git a/gui/src/redux/util/getBaseSystemMessage.ts b/gui/src/redux/util/getBaseSystemMessage.ts index b27d38ff7..c03493b15 100644 --- a/gui/src/redux/util/getBaseSystemMessage.ts +++ b/gui/src/redux/util/getBaseSystemMessage.ts @@ -1,19 +1,32 @@ -import { ModelDescription } from "core"; +import { ModelDescription, Tool } from "core"; import { DEFAULT_AGENT_SYSTEM_MESSAGE, DEFAULT_CHAT_SYSTEM_MESSAGE, DEFAULT_PLAN_SYSTEM_MESSAGE, } from "core/llm/defaultSystemMessages"; +export const NO_TOOL_WARNING = + "\n\nTHE USER HAS NOT PROVIDED ANY TOOLS, DO NOT ATTEMPT TO USE ANY TOOLS. STOP AND LET THE USER KNOW THAT THERE ARE NO TOOLS AVAILABLE. The user can provide tools by enabling them in the Tool Policies section of the notch (wrench icon)"; + export function getBaseSystemMessage( messageMode: string, model: ModelDescription, + activeTools?: Tool[], ): string { + let baseMessage: string; + if (messageMode === "agent") { - return model.baseAgentSystemMessage ?? DEFAULT_AGENT_SYSTEM_MESSAGE; + baseMessage = model.baseAgentSystemMessage ?? DEFAULT_AGENT_SYSTEM_MESSAGE; } else if (messageMode === "plan") { - return model.basePlanSystemMessage ?? DEFAULT_PLAN_SYSTEM_MESSAGE; + baseMessage = model.basePlanSystemMessage ?? DEFAULT_PLAN_SYSTEM_MESSAGE; } else { - return model.baseChatSystemMessage ?? DEFAULT_CHAT_SYSTEM_MESSAGE; + baseMessage = model.baseChatSystemMessage ?? DEFAULT_CHAT_SYSTEM_MESSAGE; } + + // Add no-tools warning for agent/plan modes when no tools are available + if (messageMode !== "chat" && (!activeTools || activeTools.length === 0)) { + baseMessage += NO_TOOL_WARNING; + } + + return baseMessage; } From 2513ae78e68cdc2d433e07c686a0178517339667 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 6 Aug 2025 21:08:53 -0700 Subject: [PATCH 11/35] improv: tweak file too big message (#7036) --- gui/src/components/mainInput/AtMentionDropdown/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/src/components/mainInput/AtMentionDropdown/index.tsx b/gui/src/components/mainInput/AtMentionDropdown/index.tsx index ac0bcfdba..f9638b37f 100644 --- a/gui/src/components/mainInput/AtMentionDropdown/index.tsx +++ b/gui/src/components/mainInput/AtMentionDropdown/index.tsx @@ -245,12 +245,14 @@ const AtMentionDropdown = forwardRef((props: AtMentionDropdownProps, ref) => { // Trigger warning message ideMessenger.ide.showToast( "warning", - fileSize > 0 ? "File exceeds context length" : "Can't load the file", + fileSize > 0 + ? "File exceeds model's context length" + : "Error loading file", { modal: true, detail: fileSize > 0 - ? `'${item.title}' is ${formatFileSize(fileSize)} which exceeds the allowed context length and cannot be processed by the model` + ? `'${item.title}' cannot be added because it exceeds the model's allowed context length. File size: ${formatFileSize(fileSize)}` : `'${item.title}' could not be loaded. Please check if the file exists and has the correct permissions.`, }, ); From 4fd88d3b842b31085ef5d8d6f5427d84b4466d5b Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 6 Aug 2025 21:19:15 -0700 Subject: [PATCH 12/35] chore: vscode 1.1.74 --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 77b05c381..faf1aa07a 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.1.73", + "version": "1.1.74", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From d111bc5f3a81df9be92b72bfba1008875785aa67 Mon Sep 17 00:00:00 2001 From: vldf Date: Thu, 7 Aug 2025 11:26:47 +0300 Subject: [PATCH 13/35] Fix: add missing space --- gui/src/components/mainInput/Lump/sections/PromptsSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx b/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx index beb4b87e7..ce7721d8c 100644 --- a/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx @@ -81,7 +81,7 @@ function PromptRow({
From aed9153e6ad11861e2f7db27aaa9031522006d93 Mon Sep 17 00:00:00 2001 From: vldf Date: Thu, 7 Aug 2025 13:37:04 +0300 Subject: [PATCH 14/35] Fix: remove redundant `call` word from the default agent system prompt --- core/llm/defaultSystemMessages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/defaultSystemMessages.ts b/core/llm/defaultSystemMessages.ts index edb5753fb..eebcc8510 100644 --- a/core/llm/defaultSystemMessages.ts +++ b/core/llm/defaultSystemMessages.ts @@ -61,7 +61,7 @@ export const DEFAULT_AGENT_SYSTEM_MESSAGE = `\ You are in agent mode. - If you need to use multiple tools, you can call call multiple read only tools simultaneously. + If you need to use multiple tools, you can call multiple read only tools simultaneously. ${CODEBLOCK_FORMATTING_INSTRUCTIONS} `; From a266903de19567701152d24577c24a406fb663b5 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 7 Aug 2025 18:55:19 +0530 Subject: [PATCH 15/35] improve: tool call spacing and margins --- .../StyledMarkdownPreview/StepContainerPreToolbar/index.tsx | 2 +- gui/src/pages/gui/ToolCallDiv/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx index fd5f0150a..4679c232c 100644 --- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx +++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx @@ -263,7 +263,7 @@ export function StepContainerPreToolbar({ } return ( -
+
+
( -
+
{renderToolCall(toolCallState)}
)); From e394a9aa95079b45ebff1d4c95a97a1f74d41eec Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 7 Aug 2025 19:42:51 +0530 Subject: [PATCH 16/35] improve: open conversation summary be default --- gui/src/components/StepContainer/ConversationSummary.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/src/components/StepContainer/ConversationSummary.tsx b/gui/src/components/StepContainer/ConversationSummary.tsx index 5260da58f..392b757da 100644 --- a/gui/src/components/StepContainer/ConversationSummary.tsx +++ b/gui/src/components/StepContainer/ConversationSummary.tsx @@ -1,12 +1,12 @@ -import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/solid"; import { TrashIcon } from "@heroicons/react/24/outline"; +import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/solid"; import { ChatHistoryItem } from "core"; import { useState } from "react"; -import { AnimatedEllipsis } from "../AnimatedEllipsis"; import { useAppSelector } from "../../redux/hooks"; -import StyledMarkdownPreview from "../StyledMarkdownPreview"; import { useDeleteCompaction } from "../../util/compactConversation"; +import { AnimatedEllipsis } from "../AnimatedEllipsis"; import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip"; +import StyledMarkdownPreview from "../StyledMarkdownPreview"; interface ConversationSummaryProps { item: ChatHistoryItem; @@ -14,7 +14,7 @@ interface ConversationSummaryProps { } export default function ConversationSummary(props: ConversationSummaryProps) { - const [open, setOpen] = useState(false); + const [open, setOpen] = useState(true); const isLoading = useAppSelector( (state) => state.session.compactionLoading[props.index] || false, ); From bc3375e818acc7f80b987c16ad3a7ace009f40c9 Mon Sep 17 00:00:00 2001 From: Jazzcort Date: Tue, 22 Jul 2025 09:43:02 -0400 Subject: [PATCH 17/35] Fix: Remove duplicate blocks and provide config warnings This patch is to address the following cases that duplicate blocks appear in the UI and confuse users: 1. When users refer to a local block with "- uses", if the block is already in the default directories (e.g. ~/.continue/models or /.continue/models) and users don't override its name attribute, the duplicate block will appear in the UI. 2. When users have duplicate block names among each block type in their assistant config. 3. When the injected blocks have duplicate names with the assistant config for the corresponding block type. The duplicate blocks in the UI is confusing, especially in the model selection. This patch add a blockDuplicationDetector to detect duplication. When a duplication is detected, we remove the duplicate item and push a config error to the result to warn the users that having duplicate names is not the best practice to set up their config. The detecting order: assistant config -> injected blocks To detect duplication, all block types use "name" as the identifier except for rules and context. For rules, if it's an rule object, we use the "name" attribute. Otherwise, we use its string content as the identifier. For context, the "provider" attribute is used as the identifier. The detection only happens under assistant level, which means you can have assistants with duplicate names. --- .../config-yaml/src/__tests__/index.test.ts | 82 +++++++++++++++++-- .../local-files/duplicate-test-assistant.yaml | 39 +++++++++ .../src/__tests__/local-files/mcpServer.yaml | 8 ++ .../src/__tests__/local-files/prompt.yaml | 7 ++ .../src/__tests__/local-files/rules.yaml | 6 ++ .../src/load/blockDuplicationDetector.ts | 76 +++++++++++++++++ packages/config-yaml/src/load/unroll.ts | 35 ++++++-- 7 files changed, 242 insertions(+), 11 deletions(-) create mode 100644 packages/config-yaml/src/__tests__/local-files/duplicate-test-assistant.yaml create mode 100644 packages/config-yaml/src/__tests__/local-files/mcpServer.yaml create mode 100644 packages/config-yaml/src/__tests__/local-files/prompt.yaml create mode 100644 packages/config-yaml/src/__tests__/local-files/rules.yaml create mode 100644 packages/config-yaml/src/load/blockDuplicationDetector.ts diff --git a/packages/config-yaml/src/__tests__/index.test.ts b/packages/config-yaml/src/__tests__/index.test.ts index af11cf0c4..5e0a3cdb9 100644 --- a/packages/config-yaml/src/__tests__/index.test.ts +++ b/packages/config-yaml/src/__tests__/index.test.ts @@ -93,9 +93,11 @@ describe("E2E Scenarios", () => { const registry: Registry = { getContent: async function (id: PackageIdentifier): Promise { const slug = packageIdentifierToShorthandSlug(id); - return fs - .readFileSync(`./src/__tests__/packages/${slug}.yaml`) - .toString(); + const filePath = + id.uriType === "slug" + ? `./src/__tests__/packages/${slug}.yaml` + : id.filePath; + return fs.readFileSync(filePath).toString(); }, }; @@ -230,7 +232,7 @@ describe("E2E Scenarios", () => { orgScopeId: "test-org", currentUserSlug: "test-user", onPremProxyUrl: null, - // Add an injected block + // Add injected blocks injectBlocks: [ { uriType: "slug", @@ -240,11 +242,16 @@ describe("E2E Scenarios", () => { versionSlug: "latest", }, }, + { + uriType: "file", + filePath: "./src/__tests__/local-files/rules.yaml", + }, ], }, ); const config = unrolledConfig.config; + const errors = unrolledConfig.errors; // The original rules array should have two items expect(config?.rules?.length).toBe(3); // Now 3 with the injected block @@ -255,7 +262,72 @@ describe("E2E Scenarios", () => { ); // Check the injected doc block was added - expect(config?.rules?.[2]).toBe("Be kind"); + expect( + typeof config?.rules?.[2] !== "string" && + config?.rules?.[2]?.rule === "Be humble", + ); + + // Check if we receive one error that is caused by duplicate rules + expect(errors?.length).toBe(1); + expect(errors?.[0].message.includes("Duplicate rules detected")); + }); + + it("duplicate detection should happen in the assistant config first and then the intected blocks", async () => { + const unrolledConfig = await unrollAssistant( + { + uriType: "file", + filePath: "./src/__tests__/local-files/duplicate-test-assistant.yaml", + }, + registry, + { + renderSecrets: true, + platformClient, + orgScopeId: "test-org", + currentUserSlug: "test-user", + onPremProxyUrl: null, + // Add injected blocks + injectBlocks: [ + { + uriType: "file", + filePath: "./src/__tests__/local-files/rules.yaml", + }, + { + uriType: "file", + filePath: "./src/__tests__/local-files/mcpServer.yaml", + }, + { + uriType: "file", + filePath: "./src/__tests__/local-files/prompt.yaml", + }, + ], + }, + ); + + const config = unrolledConfig.config; + const errors = unrolledConfig.errors; + + // Check if all the duplicate blocks get removed + expect(config?.models?.length).toBe(1); + expect(config?.context?.length).toBe(1); + expect(config?.mcpServers?.length).toBe(1); + expect(config?.rules?.length).toBe(1); + expect(config?.prompts?.length).toBe(1); + expect(config?.docs?.length).toBe(1); + + // Check if there are 8 duplication detected + expect(errors?.length).toBe(8); + + // Beginning of the assistant config duplication check + expect( + errors?.[0].message.includes("Duplicate models named gpt-5 detected"), + ).toBe(true); + // Beginning of the injected blocks duplication check + expect(errors?.[4].message.includes("Duplicate rules detected")).toBe(true); + expect( + errors?.[6].message.includes( + "Duplicate mcpServers named Browser search detected", + ), + ).toBe(true); }); it.skip("should prioritize org over user / package secrets", () => {}); diff --git a/packages/config-yaml/src/__tests__/local-files/duplicate-test-assistant.yaml b/packages/config-yaml/src/__tests__/local-files/duplicate-test-assistant.yaml new file mode 100644 index 000000000..7f5eca13a --- /dev/null +++ b/packages/config-yaml/src/__tests__/local-files/duplicate-test-assistant.yaml @@ -0,0 +1,39 @@ +name: Duplicate Test Assistant +version: 0.0.1 +schema: v1 + +docs: + - name: React + startUrl: https://react.dev + - name: React + startUrl: https://react.dev + +rules: + - Be humble + - uses: ./src/__tests__/local-files/rules.yaml + +models: + - name: gpt-5 + provider: openai + model: gpt-5 + apiKey: ${{ secrets.OPENAI_API_KEY }} + roles: + - chat + + - name: gpt-5 + provider: openai + model: gpt-5 + apiKey: ${{ secrets.OPENAI_API_KEY }} + roles: + - chat + +mcpServers: + - uses: ./src/__tests__/local-files/mcpServer.yaml + +prompts: + - uses: ./src/__tests__/local-files/prompt.yaml + - uses: ./src/__tests__/local-files/prompt.yaml + +context: + - provider: doc + - provider: doc diff --git a/packages/config-yaml/src/__tests__/local-files/mcpServer.yaml b/packages/config-yaml/src/__tests__/local-files/mcpServer.yaml new file mode 100644 index 000000000..b6be73016 --- /dev/null +++ b/packages/config-yaml/src/__tests__/local-files/mcpServer.yaml @@ -0,0 +1,8 @@ +name: Local MCP Server +version: 0.0.1 +schema: v1 +mcpServers: + - name: Browser search + command: npx + args: + - "@playwright/mcp@latest" diff --git a/packages/config-yaml/src/__tests__/local-files/prompt.yaml b/packages/config-yaml/src/__tests__/local-files/prompt.yaml new file mode 100644 index 000000000..7ea2c2707 --- /dev/null +++ b/packages/config-yaml/src/__tests__/local-files/prompt.yaml @@ -0,0 +1,7 @@ +name: Local prompt +version: 0.0.1 +schema: v1 +prompts: + - name: duplication test + description: test purpose + prompt: Please check that this prompt should only appear once diff --git a/packages/config-yaml/src/__tests__/local-files/rules.yaml b/packages/config-yaml/src/__tests__/local-files/rules.yaml new file mode 100644 index 000000000..6bfca2423 --- /dev/null +++ b/packages/config-yaml/src/__tests__/local-files/rules.yaml @@ -0,0 +1,6 @@ +name: Rules +version: 0.0.1 +schema: v1 + +rules: + - Be humble diff --git a/packages/config-yaml/src/load/blockDuplicationDetector.ts b/packages/config-yaml/src/load/blockDuplicationDetector.ts new file mode 100644 index 000000000..78e5ce980 --- /dev/null +++ b/packages/config-yaml/src/load/blockDuplicationDetector.ts @@ -0,0 +1,76 @@ +import { BLOCK_TYPES, BlockType } from "./getBlockType.js"; + +export class BlockDuplicationDetector { + private records: Map>; + + constructor() { + this.records = new Map(); + for (const blockType of BLOCK_TYPES) { + this.records.set(blockType, new Set()); + } + } + + private isRuleDuplicated(rule: any): boolean { + if (typeof rule === "string") { + return this.check(rule, "rules"); + } else { + return this.check(rule.name, "rules"); + } + } + + private isContextDuplicated(context: any): boolean { + return this.check(context.provider, "context"); + } + + private isCommonBlockDuplicated(block: any, blockType: BlockType): boolean { + return this.check(block.name, blockType); + } + + private check(identifier: string, blockType: BlockType): boolean { + if (this.records.get(blockType)!.has(identifier)) { + return true; + } else { + this.records.get(blockType)!.add(identifier); + return false; + } + } + + // Check if the name is duplicated within the same blockType + isDuplicated( + block: any, + blockType: BlockType, + injectError?: (errorMsg: string) => void, + ): boolean { + // Not checking any null or undefined object + if (block === null || block === undefined) { + return false; + } + + switch (blockType) { + case "rules": + if (this.isRuleDuplicated(block)) { + injectError?.( + `Duplicate rules${typeof block === "string" ? "" : ` named ${block.name}`} detected. The duplicate one has been deleted for preventing unexpected behavior.`, + ); + return true; + } + return false; + case "context": + if (this.isContextDuplicated(block)) { + injectError?.( + `Duplicate ${block.provider} context providers detected. The duplicate one has been deleted for preventing unexpected behavior.`, + ); + return true; + } + return false; + default: + if (this.isCommonBlockDuplicated(block, blockType)) { + injectError?.( + `Duplicate ${blockType} named ${block.name} detected. The duplicate one has been deleted for preventing unexpected behavior.`, + ); + return true; + } + return false; + } + } +} diff --git a/packages/config-yaml/src/load/unroll.ts b/packages/config-yaml/src/load/unroll.ts index adbe45324..5225f79aa 100644 --- a/packages/config-yaml/src/load/unroll.ts +++ b/packages/config-yaml/src/load/unroll.ts @@ -20,6 +20,7 @@ import { Rule, } from "../schemas/index.js"; import { ConfigResult, ConfigValidationError } from "../validation.js"; +import { BlockDuplicationDetector } from "./blockDuplicationDetector.js"; import { packageIdentifierToShorthandSlug, useProxyForUnrenderedSecrets, @@ -306,6 +307,13 @@ export async function unrollBlocks( ): Promise> { const errors: ConfigValidationError[] = []; + function injectDuplicationError(errorMsg: string) { + errors.push({ + fatal: false, + message: errorMsg, + }); + } + const unrolledAssistant: AssistantUnrolled = { name: assistant.name, version: assistant.version, @@ -484,7 +492,7 @@ export async function unrollBlocks( const injectedResults = await Promise.all(injectedBlockPromises); const injectedErrors: ConfigValidationError[] = []; const injectedBlocks: { - blockType: string; + blockType: BlockType; resolvedBlock: any; source?: string; }[] = []; @@ -521,16 +529,27 @@ export async function unrollBlocks( errors.push(...rulesResult.errors); errors.push(...injectedResult.errors); + const detector = new BlockDuplicationDetector(); + // Assign section results for (const sectionResult of sectionResults) { if (sectionResult.blocks) { - unrolledAssistant[sectionResult.section] = sectionResult.blocks; + unrolledAssistant[sectionResult.section] = sectionResult.blocks.filter( + (block) => + !detector.isDuplicated( + block, + sectionResult.section, + injectDuplicationError, + ), + ); } } // Assign rules result if (rulesResult.rules) { - unrolledAssistant.rules = rulesResult.rules; + unrolledAssistant.rules = rulesResult.rules.filter( + (rule) => !detector.isDuplicated(rule, "rules", injectDuplicationError), + ); } // Add injected blocks @@ -539,16 +558,20 @@ export async function unrollBlocks( resolvedBlock, source, } of injectedResult.injectedBlocks) { - const key = blockType as BlockType; + const key = blockType; if (!unrolledAssistant[key]) { unrolledAssistant[key] = []; } - const blocksWithSourceFiles = injectLocalSourceFile( + + const filteredBlocks = injectLocalSourceFile( key, resolvedBlock, source, + ).filter( + (block: any) => + !detector.isDuplicated(block, blockType, injectDuplicationError), ); - unrolledAssistant[key]?.push(...blocksWithSourceFiles); + unrolledAssistant[key]?.push(...filteredBlocks); } const configResult: ConfigResult = { From ab4bb9c1579b591bffb713b90e7cd207586f4dc2 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 7 Aug 2025 11:56:31 -0700 Subject: [PATCH 18/35] fix: jetbrains release script (#7050) * fix: jetbrains release script - build only option * fix: channel name --- .github/workflows/jetbrains-release.yaml | 117 ++++++++++++++--------- 1 file changed, 73 insertions(+), 44 deletions(-) diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index d2eb53938..72bd84235 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -9,10 +9,18 @@ on: types: [prereleased] workflow_dispatch: inputs: - publish_build: - description: "Whether or not to publish the built extension to the JetBrains marketplace" + build_only: + description: "If true, only build the extension for the given channels, don't publish" required: true - default: false + default: "true" + eap_channel: + description: "If true, build/publish the extension to the EAP channel" + required: true + default: "true" + stable_channel: + description: "If true, build/publish the extension to the Stable channel" + required: true + default: "true" defaults: run: @@ -37,50 +45,50 @@ jobs: echo "should_run=false" >> $GITHUB_OUTPUT fi - bump-version: - runs-on: ubuntu-latest - needs: - - check_release_name - if: github.event_name != 'workflow_dispatch' || github.event.inputs.publish_build == 'true' - permissions: - contents: write - pull-requests: write - steps: - # 0. Setup git - - name: Checkout - uses: actions/checkout@v4 + # bump-version: + # runs-on: ubuntu-latest + # needs: + # - check_release_name + # if: github.event_name != 'workflow_dispatch' || github.event.inputs.eap_channel == 'true' || github.event.inputs.stable_channel == 'true' + # permissions: + # contents: write + # pull-requests: write + # steps: + # # 0. Setup git + # - name: Checkout + # uses: actions/checkout@v4 - - name: Set up Git - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + # - name: Set up Git + # run: | + # git config --local user.email "action@github.com" + # git config --local user.name "GitHub Action" - - name: Create PR branch - run: | - BRANCH_NAME="chore/bump-jetbrains-version-$(date +%Y%m%d-%H%M%S)" - git checkout -b $BRANCH_NAME - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + # - name: Create PR branch + # run: | + # BRANCH_NAME="chore/bump-jetbrains-version-$(date +%Y%m%d-%H%M%S)" + # git checkout -b $BRANCH_NAME + # echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - - name: Bump version in gradle.properties - run: | - awk '/pluginVersion=/{split($0,a,"="); split(a[2],b,"."); b[3]+=1; printf "%s=%s.%s.%s\n",a[1],b[1],b[2],b[3];next}1' gradle.properties > tmp && mv tmp gradle.properties - rm -rf tmp - NEW_VERSION=$(grep 'pluginVersion=' gradle.properties | cut -d'=' -f2) - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + # - name: Bump version in gradle.properties + # run: | + # awk '/pluginVersion=/{split($0,a,"="); split(a[2],b,"."); b[3]+=1; printf "%s=%s.%s.%s\n",a[1],b[1],b[2],b[3];next}1' gradle.properties > tmp && mv tmp gradle.properties + # rm -rf tmp + # NEW_VERSION=$(grep 'pluginVersion=' gradle.properties | cut -d'=' -f2) + # echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - with: - token: ${{ secrets.CI_GITHUB_TOKEN }} - commit-message: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" - title: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" - body: | - Automated PR to bump the JetBrains extension version after successful pre-release publication. + # - name: Create Pull Request + # uses: peter-evans/create-pull-request@v7 + # with: + # token: ${{ secrets.CI_GITHUB_TOKEN }} + # commit-message: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" + # title: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" + # body: | + # Automated PR to bump the JetBrains extension version after successful pre-release publication. - - Bumped version in extensions/intellij/gradle.properties to ${{ env.NEW_VERSION }} - branch: ${{ env.BRANCH_NAME }} - base: main - delete-branch: true + # - Bumped version in extensions/intellij/gradle.properties to ${{ env.NEW_VERSION }} + # branch: ${{ env.BRANCH_NAME }} + # base: main + # delete-branch: true # Prepare and publish the plugin to JetBrains Marketplace repository build: @@ -223,9 +231,30 @@ jobs: # apple-product-id: dev.continue.continue-binary # options: --options runtime --entitlements entitlements.xml + # Build the plugin if not publishing + - name: Build EAP Plugin (no publish) + if: github.event_name != 'release' && github.event.inputs.eap_channel == 'true' && github.event.inputs.build_only == 'true' + env: + PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }} + CERTIFICATE_CHAIN: ${{ secrets.JETBRAINS_CERTIFICATE_CHAIN }} + PRIVATE_KEY: ${{ secrets.JETBRAINS_PRIVATE_KEY }} + PRIVATE_KEY_PASSWORD: ${{ secrets.JETBRAINS_PRIVATE_KEY_PASSWORD }} + RELEASE_CHANNEL: eap + run: ./gradlew buildPlugin --info --stacktrace + + - name: Build Stable Plugin (no publish) + if: github.event_name != 'release' && github.event.inputs.stable_channel == 'true' && github.event.inputs.build_only == 'true' + env: + PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }} + CERTIFICATE_CHAIN: ${{ secrets.JETBRAINS_CERTIFICATE_CHAIN }} + PRIVATE_KEY: ${{ secrets.JETBRAINS_PRIVATE_KEY }} + PRIVATE_KEY_PASSWORD: ${{ secrets.JETBRAINS_PRIVATE_KEY_PASSWORD }} + RELEASE_CHANNEL: default + run: ./gradlew buildPlugin --info --stacktrace + # Publish the plugin to JetBrains Marketplace - name: Publish EAP Plugin - if: github.event_name == 'release' || github.event.inputs.publish_build == 'true' + if: github.event_name == 'release' || (github.event.inputs.eap_channel == 'true' && github.event.inputs.build_only != 'true') env: PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }} CERTIFICATE_CHAIN: ${{ secrets.JETBRAINS_CERTIFICATE_CHAIN }} @@ -235,7 +264,7 @@ jobs: run: ./gradlew publishPlugin --info --stacktrace - name: Publish Stable Plugin - if: github.event_name == 'release' || github.event.inputs.publish_build == 'true' + if: github.event_name == 'release' || (github.event.inputs.stable_channel == 'true' && github.event.inputs.build_only != 'true') env: PUBLISH_TOKEN: ${{ secrets.JETBRAINS_PUBLISH_TOKEN }} CERTIFICATE_CHAIN: ${{ secrets.JETBRAINS_CERTIFICATE_CHAIN }} From 01812e598f2e5b3f201c1329388d3133b0c935b7 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 7 Aug 2025 13:36:26 -0700 Subject: [PATCH 19/35] feat: gpt-5 support (#7054) * fix: gpt-5 support * fix: gpt 5 context length * fix: broken test file --- core/llm/llms/OpenAI.test.ts | 32 +++++++++---------- core/llm/llms/OpenAI.ts | 16 +++++----- core/llm/toolSupport.ts | 10 +++--- gui/src/pages/AddNewModel/configs/models.ts | 12 +++++++ .../pages/AddNewModel/configs/providers.ts | 5 +-- packages/llm-info/src/providers/openai.ts | 9 ++++++ packages/openai-adapters/src/apis/OpenAI.ts | 2 +- 7 files changed, 55 insertions(+), 31 deletions(-) diff --git a/core/llm/llms/OpenAI.test.ts b/core/llm/llms/OpenAI.test.ts index 46c8b4e23..8daf93852 100644 --- a/core/llm/llms/OpenAI.test.ts +++ b/core/llm/llms/OpenAI.test.ts @@ -5,30 +5,30 @@ describe("OpenAI", () => { const openai = new OpenAI({ model: "o3-mini", }); - expect(openai.isOSeriesModel("o4-mini")).toBeTruthy(); - expect(openai.isOSeriesModel("o3-mini")).toBeTruthy(); - expect(openai.isOSeriesModel("o1-mini")).toBeTruthy(); - expect(openai.isOSeriesModel("o1")).toBeTruthy(); - expect(openai.isOSeriesModel("o3")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o4-mini")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o3-mini")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o1-mini")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o1")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o3")).toBeTruthy(); // artificially correct samples for future models - expect(openai.isOSeriesModel("o5-mini")).toBeTruthy(); - expect(openai.isOSeriesModel("o6")).toBeTruthy(); - expect(openai.isOSeriesModel("o77")).toBeTruthy(); - expect(openai.isOSeriesModel("o54-mini")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o5-mini")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o6")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o77")).toBeTruthy(); + expect(openai.isOSeriesOrGpt5Model("o54-mini")).toBeTruthy(); }); test("should identify incorrect o-series models", () => { const openai = new OpenAI({ model: "o3-mini", }); - expect(openai.isOSeriesModel("gpt-o4-mini")).toBeFalsy(); - expect(openai.isOSeriesModel("gpt-4.5")).toBeFalsy(); - expect(openai.isOSeriesModel("gpt-4.1")).toBeFalsy(); + expect(openai.isOSeriesOrGpt5Model("gpt-o4-mini")).toBeFalsy(); + expect(openai.isOSeriesOrGpt5Model("gpt-4.5")).toBeFalsy(); + expect(openai.isOSeriesOrGpt5Model("gpt-4.1")).toBeFalsy(); // artificially wrong samples - expect(openai.isOSeriesModel("os1")).toBeFalsy(); - expect(openai.isOSeriesModel("so1")).toBeFalsy(); - expect(openai.isOSeriesModel("ao31")).toBeFalsy(); - expect(openai.isOSeriesModel("1os")).toBeFalsy(); + expect(openai.isOSeriesOrGpt5Model("os1")).toBeFalsy(); + expect(openai.isOSeriesOrGpt5Model("so1")).toBeFalsy(); + expect(openai.isOSeriesOrGpt5Model("ao31")).toBeFalsy(); + expect(openai.isOSeriesOrGpt5Model("1os")).toBeFalsy(); }); }); diff --git a/core/llm/llms/OpenAI.ts b/core/llm/llms/OpenAI.ts index c48349f83..27006aea1 100644 --- a/core/llm/llms/OpenAI.ts +++ b/core/llm/llms/OpenAI.ts @@ -36,12 +36,12 @@ function isChatOnlyModel(model: string): boolean { return model.startsWith("gpt") || model.startsWith("o"); } -const formatMessageForO1 = (messages: ChatCompletionMessageParam[]) => { +const formatMessageForO1OrGpt5 = (messages: ChatCompletionMessageParam[]) => { return messages?.map((message: any) => { if (message?.role === "system") { return { ...message, - role: "user", + role: "developer", }; } @@ -77,8 +77,8 @@ class OpenAI extends BaseLLM { return model; } - public isOSeriesModel(model?: string): boolean { - return !!model && !!model.match(/^o[0-9]+/); + public isOSeriesOrGpt5Model(model?: string): boolean { + return !!model && (!!model.match(/^o[0-9]+/) || model.includes("gpt-5")); } private isFireworksAiModel(model?: string): boolean { @@ -139,13 +139,13 @@ class OpenAI extends BaseLLM { finalOptions.stop = options.stop?.slice(0, this.getMaxStopWords()); // OpenAI o1-preview and o1-mini or o3-mini: - if (this.isOSeriesModel(options.model)) { + if (this.isOSeriesOrGpt5Model(options.model)) { // a) use max_completion_tokens instead of max_tokens finalOptions.max_completion_tokens = options.maxTokens; finalOptions.max_tokens = undefined; // b) don't support system message - finalOptions.messages = formatMessageForO1(finalOptions.messages); + finalOptions.messages = formatMessageForO1OrGpt5(finalOptions.messages); } if (options.model === "o1") { @@ -241,13 +241,13 @@ class OpenAI extends BaseLLM { body.stop = body.stop?.slice(0, this.getMaxStopWords()); // OpenAI o1-preview and o1-mini or o3-mini: - if (this.isOSeriesModel(body.model)) { + if (this.isOSeriesOrGpt5Model(body.model)) { // a) use max_completion_tokens instead of max_tokens body.max_completion_tokens = body.max_tokens; body.max_tokens = undefined; // b) don't support system message - body.messages = formatMessageForO1(body.messages); + body.messages = formatMessageForO1OrGpt5(body.messages); } if (body.model === "o1") { diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index 2700361cc..1417d8307 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -54,18 +54,20 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = return false; }, openai: (model) => { + const lower = model.toLowerCase(); // https://platform.openai.com/docs/guides/function-calling#models-supporting-function-calling if ( - model.toLowerCase().startsWith("gpt-4") || - model.toLowerCase().startsWith("o3") + lower.startsWith("gpt-4") || + lower.startsWith("gpt-5") || + lower.startsWith("o3") ) { return true; } - if (model.toLowerCase().includes("gpt-oss")) { + if (lower.includes("gpt-oss")) { return true; } // https://ai.google.dev/gemma/docs/capabilities/function-calling - if (model.toLowerCase().startsWith("gemma")) { + if (lower.startsWith("gemma")) { return true; } // firworks-ai https://docs.fireworks.ai/guides/function-calling diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index d0857d7db..b5c4bbae5 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1095,6 +1095,18 @@ export const models: { [key: string]: ModelPackage } = { icon: "cohere.png", isOpenSource: false, }, + gpt5: { + title: "GPT-5", + description: "OpenAI's next-generation, high-intelligence flagship model", + params: { + model: "gpt-5", + contextLength: 400_000, + title: "GPT-5", + }, + providerOptions: ["openai"], + icon: "openai.png", + isOpenSource: false, + }, gpt4turbo: { title: "GPT-4 Turbo", description: diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index d210da9d6..071f96be9 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -52,12 +52,13 @@ export const providers: Partial> = { openai: { title: "OpenAI", provider: "openai", - description: "Use gpt-4, gpt-3.5-turbo, or any other OpenAI model", + description: "Use gpt-5, gpt-4, or any other OpenAI model", longDescription: - "Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.", + "Use gpt-5, gpt-4, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.", icon: "openai.png", tags: [ModelProviderTags.RequiresApiKey], packages: [ + models.gpt5, models.gpt4o, models.gpt4omini, models.gpt4turbo, diff --git a/packages/llm-info/src/providers/openai.ts b/packages/llm-info/src/providers/openai.ts index a15dd3089..820559308 100644 --- a/packages/llm-info/src/providers/openai.ts +++ b/packages/llm-info/src/providers/openai.ts @@ -75,6 +75,15 @@ export const OpenAi: ModelProvider = { contextLength: 128000, maxCompletionTokens: 4096, }, + // gpt-5 + { + model: "gpt-5", + displayName: "GPT-5", + contextLength: 400000, + maxCompletionTokens: 128000, + regex: /gpt-5/, + recommendedFor: ["chat"], + }, // gpt-4o { model: "gpt-4o", diff --git a/packages/openai-adapters/src/apis/OpenAI.ts b/packages/openai-adapters/src/apis/OpenAI.ts index c1e356fa5..714ce67fd 100644 --- a/packages/openai-adapters/src/apis/OpenAI.ts +++ b/packages/openai-adapters/src/apis/OpenAI.ts @@ -38,7 +38,7 @@ export class OpenAIApi implements BaseLlmApi { // o-series models - only apply for official OpenAI API const isOfficialOpenAIAPI = this.apiBase === "https://api.openai.com/v1/"; if (isOfficialOpenAIAPI) { - if (body.model.startsWith("o")) { + if (body.model.startsWith("o") || body.model.includes("gpt-5")) { // a) use max_completion_tokens instead of max_tokens body.max_completion_tokens = body.max_tokens; body.max_tokens = undefined; From c69ed88bf0a7e156bfff6de763cacc881147e352 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 7 Aug 2025 13:52:41 -0700 Subject: [PATCH 20/35] chore: vscode 1.1.75 --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index faf1aa07a..9d15d1bb6 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.1.74", + "version": "1.1.75", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 867b06012ec1a4cdf5b8eba55482dee1c8f592ad Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 7 Aug 2025 15:56:47 -0700 Subject: [PATCH 21/35] fix: indexing toggle copy Co-authored-by: Josh Holmer --- gui/src/pages/config/IndexingSettingsSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/pages/config/IndexingSettingsSection.tsx b/gui/src/pages/config/IndexingSettingsSection.tsx index 4e4c670c0..6df4faed0 100644 --- a/gui/src/pages/config/IndexingSettingsSection.tsx +++ b/gui/src/pages/config/IndexingSettingsSection.tsx @@ -15,7 +15,7 @@ export function IndexingSettingsSection() {

Indexing is disabled

- Open settings and toggle Disable Indexing to re-enable + Open settings and toggle Enable Indexing to re-enable

) : ( From ef48171c8a3df54bed0e9719c9f09149ab381000 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:35:36 -0400 Subject: [PATCH 22/35] fix review --- core/llm/toolSupport.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index d3a8684d0..2876ba346 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -277,6 +277,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "deepseek/deepseek-chat", "meta-llama/llama-4", "all-hands/openhands-lm-32b", + "lgai-exaone/exaone" ]; for (const prefix of supportedPrefixes) { if (model.toLowerCase().startsWith(prefix)) { @@ -347,11 +348,7 @@ export function modelSupportsNativeTools(modelDescription: ModelDescription) { if (modelDescription.capabilities?.tools !== undefined) { return modelDescription.capabilities.tools; } - // EXAONE 4.0 models advertise tool-calling capability regardless of - // the provider used to serve them. - if (modelDescription.model.toLowerCase().includes("exaone")) { - return true; - } + const providerSupport = PROVIDER_TOOL_SUPPORT[modelDescription.provider]; if (!providerSupport) { return false; From 3a08e8a591f65af2ab0847adc866c7ec0f16300b Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:52:01 -0400 Subject: [PATCH 23/35] Update toolSupport.ts --- core/llm/toolSupport.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index e96318697..40648c702 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -279,7 +279,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = "deepseek/deepseek-chat", "meta-llama/llama-4", "all-hands/openhands-lm-32b", - "lgai-exaone/exaone" + "lgai-exaone/exaone", ]; for (const prefix of supportedPrefixes) { if (model.toLowerCase().startsWith(prefix)) { From 8fd7bd349c6eb96be248d9185a90ab3460907a2d Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 8 Aug 2025 12:24:46 +0530 Subject: [PATCH 24/35] style: prevent mention query input wrapping text --- .../mainInput/AtMentionDropdown/index.tsx | 80 ++++++++++++------- 1 file changed, 51 insertions(+), 29 deletions(-) diff --git a/gui/src/components/mainInput/AtMentionDropdown/index.tsx b/gui/src/components/mainInput/AtMentionDropdown/index.tsx index f9638b37f..8db383dd3 100644 --- a/gui/src/components/mainInput/AtMentionDropdown/index.tsx +++ b/gui/src/components/mainInput/AtMentionDropdown/index.tsx @@ -32,6 +32,7 @@ import FileIcon from "../../FileIcon"; import SafeImg from "../../SafeImg"; import AddDocsDialog from "../../dialogs/AddDocsDialog"; import HeaderButtonWithToolTip from "../../gui/HeaderButtonWithToolTip"; +import { Button } from "../../ui"; import { NAMED_ICONS } from "../icons"; import type { ComboBoxItem, ComboBoxItemType } from "../types"; @@ -117,6 +118,7 @@ const QueryInput = styled.textarea` background-color: #fff1; border: 1px solid ${lightGray}; border-radius: ${defaultBorderRadius}; + overflow: hidden; padding: 0.2rem 0.4rem; width: 240px; @@ -243,7 +245,7 @@ const AtMentionDropdown = forwardRef((props: AtMentionDropdownProps, ref) => { .run(); // Trigger warning message - ideMessenger.ide.showToast( + void ideMessenger.ide.showToast( "warning", fileSize > 0 ? "File exceeds model's context length" @@ -368,8 +370,9 @@ const AtMentionDropdown = forwardRef((props: AtMentionDropdownProps, ref) => { if (item) { if (item.type === "file" && item.query) { - isItemTooBig(item.type, item.query).then(([fileExceeds, fileSize]) => - handleItemTooBig(fileExceeds, fileSize, item), + void isItemTooBig(item.type, item.query).then( + ([fileExceeds, fileSize]) => + handleItemTooBig(fileExceeds, fileSize, item), ); } else { props.command({ ...item, itemType: item.type }); @@ -456,34 +459,53 @@ const AtMentionDropdown = forwardRef((props: AtMentionDropdownProps, ref) => { return ( {querySubmenuItem ? ( - { - e.stopPropagation(); - }} - rows={1} - ref={queryInputRef} - placeholder={querySubmenuItem.description} - onKeyDown={(e) => { - if (!queryInputRef.current) { - return; - } - if (e.key === "Enter") { - if (e.shiftKey) { - queryInputRef.current.innerText += "\n"; - } else { - props.command({ - ...querySubmenuItem, - itemType: querySubmenuItem.type, - query: queryInputRef.current.value, - label: `${querySubmenuItem.label}: ${queryInputRef.current.value}`, - }); + + { + e.stopPropagation(); + }} + rows={1} + ref={queryInputRef} + placeholder={querySubmenuItem.description} + onKeyDown={(e) => { + if (!queryInputRef.current) { + return; } - } else if (e.key === "Escape") { - setQuerySubmenuItem(undefined); - setSubMenuTitle(undefined); + if (e.key === "Enter") { + if (e.shiftKey) { + queryInputRef.current.innerText += "\n"; + } else { + props.command({ + ...querySubmenuItem, + itemType: querySubmenuItem.type, + query: queryInputRef.current.value, + label: `${querySubmenuItem.label}: ${queryInputRef.current.value}`, + }); + } + } else if (e.key === "Escape") { + setQuerySubmenuItem(undefined); + setSubMenuTitle(undefined); + } + }} + /> + + ) : ( <> {subMenuTitle && {subMenuTitle}} From e7d82a6290b0954280e03580220b51aa7ed50ff5 Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Mon, 28 Jul 2025 17:37:28 -0700 Subject: [PATCH 25/35] fix: :bug: Fix terminal use without a workspace --- .../runTerminalCommand.test.ts | 115 +++++++++++++++++- .../implementations/runTerminalCommand.ts | 54 +++++--- 2 files changed, 152 insertions(+), 17 deletions(-) diff --git a/core/tools/implementations/runTerminalCommand.test.ts b/core/tools/implementations/runTerminalCommand.test.ts index d688e4991..2868a51bc 100644 --- a/core/tools/implementations/runTerminalCommand.test.ts +++ b/core/tools/implementations/runTerminalCommand.test.ts @@ -352,4 +352,117 @@ describe("runTerminalCommandImpl", () => { expect(result[0].content).toBe("Command is running in the background..."); expect(result[0].status).toBe("Command is running in the background..."); }); -}); + + it("should handle missing workspace directory gracefully", async () => { + // Mock IDE to return empty workspace directories + const mockEmptyWorkspace = jest.fn().mockReturnValue(Promise.resolve([])); + + // Create IDE mock with empty workspace + const mockIde = { + getIdeInfo: jest.fn().mockReturnValue(Promise.resolve({ remoteName: "local" })), + getWorkspaceDirs: mockEmptyWorkspace, + runCommand: jest.fn(), + getIdeSettings: jest.fn(), + getDiff: jest.fn(), + getClipboardContent: jest.fn(), + isTelemetryEnabled: jest.fn(), + readFile: jest.fn(), + writeFile: jest.fn(), + renameFile: jest.fn(), + deleteFile: jest.fn(), + globFiles: jest.fn(), + ls: jest.fn(), + }; + + const extras = { + ide: mockIde as unknown as IDE, + llm: {} as any, + fetch: {} as any, + tool: {} as any, + toolCallId: "test-tool-call", + } as ToolExtras; + + const command = `node -e "console.log('no workspace test')"`; + const args = { command, waitForCompletion: true }; + + const result = await runTerminalCommandImpl(args, extras); + + // Should still work - falling back to HOME or cwd + expect(result).toHaveLength(1); + expect(result[0].name).toBe("Terminal"); + expect(result[0].description).toBe("Terminal command output"); + expect(result[0].content).toContain("no workspace test"); + expect(result[0].status).toBe("Command completed"); + + // Verify workspace dirs was called but returned empty + expect(mockEmptyWorkspace).toHaveBeenCalled(); + }); + + it("should handle case where cwd fallbacks all fail", async () => { + // Mock IDE to return empty workspace directories + const mockEmptyWorkspace = jest.fn().mockReturnValue(Promise.resolve([])); + + // Save original environment variables and process.cwd + const originalHome = process.env.HOME; + const originalUserProfile = process.env.USERPROFILE; + const originalCwd = process.cwd; + + try { + // Mock all fallbacks to fail + delete process.env.HOME; + delete process.env.USERPROFILE; + process.cwd = jest.fn().mockImplementation(() => { + throw new Error("Current directory unavailable"); + }); + + // Create IDE mock with empty workspace + const mockIde = { + getIdeInfo: jest.fn().mockReturnValue(Promise.resolve({ remoteName: "local" })), + getWorkspaceDirs: mockEmptyWorkspace, + runCommand: jest.fn(), + getIdeSettings: jest.fn(), + getDiff: jest.fn(), + getClipboardContent: jest.fn(), + isTelemetryEnabled: jest.fn(), + readFile: jest.fn(), + writeFile: jest.fn(), + renameFile: jest.fn(), + deleteFile: jest.fn(), + globFiles: jest.fn(), + ls: jest.fn(), + }; + + const extras = { + ide: mockIde as unknown as IDE, + llm: {} as any, + fetch: {} as any, + tool: {} as any, + toolCallId: "test-tool-call", + } as ToolExtras; + + const command = `node -e "console.log('fallback test')"`; + const args = { command, waitForCompletion: true }; + + // This should now handle the case gracefully by falling back to temp directory + const result = await runTerminalCommandImpl(args, extras); + + // Should work using the temp directory as fallback + expect(result).toHaveLength(1); + expect(result[0].name).toBe("Terminal"); + expect(result[0].content).toContain("fallback test"); + expect(result[0].status).toBe("Command completed"); + + console.log("Successfully handled cwd fallback to temp directory:", result[0].status); + + } finally { + // Always restore original values + if (originalHome !== undefined) { + process.env.HOME = originalHome; + } + if (originalUserProfile !== undefined) { + process.env.USERPROFILE = originalUserProfile; + } + process.cwd = originalCwd; + } + }); +}); \ No newline at end of file diff --git a/core/tools/implementations/runTerminalCommand.ts b/core/tools/implementations/runTerminalCommand.ts index c48ba2ade..7486bf810 100644 --- a/core/tools/implementations/runTerminalCommand.ts +++ b/core/tools/implementations/runTerminalCommand.ts @@ -1,5 +1,6 @@ import iconv from "iconv-lite"; import childProcess from "node:child_process"; +import os from "node:os"; import util from "node:util"; // Automatically decode the buffer according to the platform to avoid garbled Chinese function getDecodedOutput(data: Buffer): string { @@ -75,13 +76,25 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { if (ENABLED_FOR_REMOTES.includes(ideInfo.remoteName)) { // For streaming output if (extras.onPartialOutput) { - return new Promise((resolve, reject) => { - try { - const getWorkspaceDirsPromise = extras.ide.getWorkspaceDirs(); - getWorkspaceDirsPromise - .then((workspaceDirs) => { - const cwd = fileURLToPath(workspaceDirs[0]); - let terminalOutput = ""; + try { + const workspaceDirs = await extras.ide.getWorkspaceDirs(); + + // Handle case where no workspace is available + let cwd: string; + if (workspaceDirs.length > 0) { + cwd = fileURLToPath(workspaceDirs[0]); + } else { + // Default to user's home directory with fallbacks + try { + cwd = process.env.HOME || process.env.USERPROFILE || process.cwd(); + } catch (error) { + // Final fallback if even process.cwd() fails - use system temp directory + cwd = os.tmpdir(); + } + } + + return new Promise((resolve, reject) => { + let terminalOutput = ""; if (!waitForCompletion) { const status = "Command is running in the background..."; @@ -229,18 +242,27 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { reject(error); }); - }) - .catch((error) => { - reject(error); }); - } catch (error: any) { - reject(error); - } - }); + } catch (error: any) { + throw error; + } } else { // Fallback to non-streaming for older clients const workspaceDirs = await extras.ide.getWorkspaceDirs(); - const cwd = fileURLToPath(workspaceDirs[0]); + + // Handle case where no workspace is available + let cwd: string; + if (workspaceDirs.length > 0) { + cwd = fileURLToPath(workspaceDirs[0]); + } else { + // Default to user's home directory with fallbacks + try { + cwd = process.env.HOME || process.env.USERPROFILE || process.cwd(); + } catch (error) { + // Final fallback if even process.cwd() fails - use system temp directory + cwd = os.tmpdir(); + } + } if (waitForCompletion) { // Standard execution, waiting for completion @@ -375,4 +397,4 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { status: "Command failed", }, ]; -}; +}; \ No newline at end of file From c78db090371fa8b5d1d28e70292785d741785a76 Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Mon, 28 Jul 2025 17:41:04 -0700 Subject: [PATCH 26/35] fix: :art: Prettier fixes --- .../runTerminalCommand.test.ts | 30 ++- .../implementations/runTerminalCommand.ts | 223 +++++++++--------- 2 files changed, 134 insertions(+), 119 deletions(-) diff --git a/core/tools/implementations/runTerminalCommand.test.ts b/core/tools/implementations/runTerminalCommand.test.ts index 2868a51bc..9ef39632b 100644 --- a/core/tools/implementations/runTerminalCommand.test.ts +++ b/core/tools/implementations/runTerminalCommand.test.ts @@ -356,10 +356,12 @@ describe("runTerminalCommandImpl", () => { it("should handle missing workspace directory gracefully", async () => { // Mock IDE to return empty workspace directories const mockEmptyWorkspace = jest.fn().mockReturnValue(Promise.resolve([])); - + // Create IDE mock with empty workspace const mockIde = { - getIdeInfo: jest.fn().mockReturnValue(Promise.resolve({ remoteName: "local" })), + getIdeInfo: jest + .fn() + .mockReturnValue(Promise.resolve({ remoteName: "local" })), getWorkspaceDirs: mockEmptyWorkspace, runCommand: jest.fn(), getIdeSettings: jest.fn(), @@ -393,7 +395,7 @@ describe("runTerminalCommandImpl", () => { expect(result[0].description).toBe("Terminal command output"); expect(result[0].content).toContain("no workspace test"); expect(result[0].status).toBe("Command completed"); - + // Verify workspace dirs was called but returned empty expect(mockEmptyWorkspace).toHaveBeenCalled(); }); @@ -401,12 +403,12 @@ describe("runTerminalCommandImpl", () => { it("should handle case where cwd fallbacks all fail", async () => { // Mock IDE to return empty workspace directories const mockEmptyWorkspace = jest.fn().mockReturnValue(Promise.resolve([])); - + // Save original environment variables and process.cwd const originalHome = process.env.HOME; const originalUserProfile = process.env.USERPROFILE; const originalCwd = process.cwd; - + try { // Mock all fallbacks to fail delete process.env.HOME; @@ -414,10 +416,12 @@ describe("runTerminalCommandImpl", () => { process.cwd = jest.fn().mockImplementation(() => { throw new Error("Current directory unavailable"); }); - + // Create IDE mock with empty workspace const mockIde = { - getIdeInfo: jest.fn().mockReturnValue(Promise.resolve({ remoteName: "local" })), + getIdeInfo: jest + .fn() + .mockReturnValue(Promise.resolve({ remoteName: "local" })), getWorkspaceDirs: mockEmptyWorkspace, runCommand: jest.fn(), getIdeSettings: jest.fn(), @@ -445,15 +449,17 @@ describe("runTerminalCommandImpl", () => { // This should now handle the case gracefully by falling back to temp directory const result = await runTerminalCommandImpl(args, extras); - + // Should work using the temp directory as fallback expect(result).toHaveLength(1); expect(result[0].name).toBe("Terminal"); expect(result[0].content).toContain("fallback test"); expect(result[0].status).toBe("Command completed"); - - console.log("Successfully handled cwd fallback to temp directory:", result[0].status); - + + console.log( + "Successfully handled cwd fallback to temp directory:", + result[0].status, + ); } finally { // Always restore original values if (originalHome !== undefined) { @@ -465,4 +471,4 @@ describe("runTerminalCommandImpl", () => { process.cwd = originalCwd; } }); -}); \ No newline at end of file +}); diff --git a/core/tools/implementations/runTerminalCommand.ts b/core/tools/implementations/runTerminalCommand.ts index 7486bf810..919bebdd7 100644 --- a/core/tools/implementations/runTerminalCommand.ts +++ b/core/tools/implementations/runTerminalCommand.ts @@ -78,7 +78,7 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { if (extras.onPartialOutput) { try { const workspaceDirs = await extras.ide.getWorkspaceDirs(); - + // Handle case where no workspace is available let cwd: string; if (workspaceDirs.length > 0) { @@ -119,58 +119,98 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { cwd, env: getColorEnv(), // Add enhanced environment for colors }); + } + } - childProc.stdout?.on("data", (data) => { - // Skip if this process has been backgrounded - if (isProcessBackgrounded(toolCallId)) return; + // Use spawn with color environment + const childProc = childProcess.spawn(command, { + cwd, + shell: true, + env: getColorEnv(), // Add enhanced environment for colors + }); - const newOutput = getDecodedOutput(data); - terminalOutput += newOutput; + childProc.stdout?.on("data", (data) => { + // Skip if this process has been backgrounded + if (isProcessBackgrounded(toolCallId)) return; - // Send partial output to UI - if (extras.onPartialOutput) { - const status = waitForCompletion - ? "" - : "Command is running in the background..."; - extras.onPartialOutput({ - toolCallId, - contextItems: [ - { - name: "Terminal", - description: "Terminal command output", - content: terminalOutput, - status: status, - }, - ], - }); - } + const newOutput = getDecodedOutput(data); + terminalOutput += newOutput; + + // Send partial output to UI + if (extras.onPartialOutput) { + const status = waitForCompletion + ? "" + : "Command is running in the background..."; + extras.onPartialOutput({ + toolCallId, + contextItems: [ + { + name: "Terminal", + description: "Terminal command output", + content: terminalOutput, + status: status, + }, + ], }); + } + }); - childProc.stderr?.on("data", (data) => { - // Skip if this process has been backgrounded - if (isProcessBackgrounded(toolCallId)) return; + childProc.stderr?.on("data", (data) => { + // Skip if this process has been backgrounded + if (isProcessBackgrounded(toolCallId)) return; - const newOutput = getDecodedOutput(data); - terminalOutput += newOutput; + const newOutput = getDecodedOutput(data); + terminalOutput += newOutput; - // Send partial output to UI, status is not required - if (extras.onPartialOutput) { - extras.onPartialOutput({ - toolCallId, - contextItems: [ - { - name: "Terminal", - description: "Terminal command output", - content: terminalOutput, - }, - ], - }); - } + // Send partial output to UI, status is not required + if (extras.onPartialOutput) { + extras.onPartialOutput({ + toolCallId, + contextItems: [ + { + name: "Terminal", + description: "Terminal command output", + content: terminalOutput, + }, + ], }); + } + }); - // If we don't need to wait for completion, resolve immediately - if (!waitForCompletion) { - const status = "Command is running in the background..."; + // If we don't need to wait for completion, resolve immediately + if (!waitForCompletion) { + const status = "Command is running in the background..."; + resolve([ + { + name: "Terminal", + description: "Terminal command output", + content: terminalOutput, + status: status, + }, + ]); + } + + childProc.on("close", (code) => { + // If this process has been backgrounded, clean it up from the map and return + if (isProcessBackgrounded(toolCallId)) { + removeBackgroundedProcess(toolCallId); + return; + } + + if (waitForCompletion) { + // Normal completion, resolve now + if (code === 0) { + const status = "Command completed"; + resolve([ + { + name: "Terminal", + description: "Terminal command output", + content: terminalOutput, + status: status, + }, + ]); + } else { + const status = `Command failed with exit code ${code}`; resolve([ { name: "Terminal", @@ -180,76 +220,45 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { }, ]); } + } else { + // Already resolved, just update the UI with final output + if (extras.onPartialOutput) { + const status = + code === 0 || !code + ? "\nBackground command completed" + : `\nBackground command failed with exit code ${code}`; + extras.onPartialOutput({ + toolCallId, + contextItems: [ + { + name: "Terminal", + description: "Terminal command output", + content: terminalOutput, + status: status, + }, + ], + }); + } + } + }); - childProc.on("close", (code) => { - // If this process has been backgrounded, clean it up from the map and return - if (isProcessBackgrounded(toolCallId)) { - removeBackgroundedProcess(toolCallId); - return; - } + childProc.on("error", (error) => { + // If this process has been backgrounded, clean it up from the map and return + if (isProcessBackgrounded(toolCallId)) { + removeBackgroundedProcess(toolCallId); + return; + } - if (waitForCompletion) { - // Normal completion, resolve now - if (code === 0) { - const status = "Command completed"; - resolve([ - { - name: "Terminal", - description: "Terminal command output", - content: terminalOutput, - status: status, - }, - ]); - } else { - const status = `Command failed with exit code ${code}`; - resolve([ - { - name: "Terminal", - description: "Terminal command output", - content: terminalOutput, - status: status, - }, - ]); - } - } else { - // Already resolved, just update the UI with final output - if (extras.onPartialOutput) { - const status = - code === 0 || !code - ? "\nBackground command completed" - : `\nBackground command failed with exit code ${code}`; - extras.onPartialOutput({ - toolCallId, - contextItems: [ - { - name: "Terminal", - description: "Terminal command output", - content: terminalOutput, - status: status, - }, - ], - }); - } - } - }); - - childProc.on("error", (error) => { - // If this process has been backgrounded, clean it up from the map and return - if (isProcessBackgrounded(toolCallId)) { - removeBackgroundedProcess(toolCallId); - return; - } - - reject(error); - }); - }); + reject(error); + }); + }); } catch (error: any) { throw error; } } else { // Fallback to non-streaming for older clients const workspaceDirs = await extras.ide.getWorkspaceDirs(); - + // Handle case where no workspace is available let cwd: string; if (workspaceDirs.length > 0) { @@ -397,4 +406,4 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { status: "Command failed", }, ]; -}; \ No newline at end of file +}; From 33b23ae09ee19034ac136e558cb5f3d258ef3dcf Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Mon, 28 Jul 2025 17:47:53 -0700 Subject: [PATCH 27/35] fix: :art: Fix typescript error --- core/tools/implementations/runTerminalCommand.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tools/implementations/runTerminalCommand.test.ts b/core/tools/implementations/runTerminalCommand.test.ts index 9ef39632b..e744ea4f1 100644 --- a/core/tools/implementations/runTerminalCommand.test.ts +++ b/core/tools/implementations/runTerminalCommand.test.ts @@ -415,7 +415,7 @@ describe("runTerminalCommandImpl", () => { delete process.env.USERPROFILE; process.cwd = jest.fn().mockImplementation(() => { throw new Error("Current directory unavailable"); - }); + }) as jest.MockedFunction<() => string>; // Create IDE mock with empty workspace const mockIde = { From 6e0775b0ce414942433c42136a0e4830206c0ee4 Mon Sep 17 00:00:00 2001 From: chezsmithy Date: Fri, 8 Aug 2025 00:07:55 -0700 Subject: [PATCH 28/35] fix: :bug: Fix rebase issues --- .../implementations/runTerminalCommand.ts | 39 +++++++------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/core/tools/implementations/runTerminalCommand.ts b/core/tools/implementations/runTerminalCommand.ts index 919bebdd7..b106396af 100644 --- a/core/tools/implementations/runTerminalCommand.ts +++ b/core/tools/implementations/runTerminalCommand.ts @@ -96,36 +96,27 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => { return new Promise((resolve, reject) => { let terminalOutput = ""; - if (!waitForCompletion) { - const status = "Command is running in the background..."; - if (extras.onPartialOutput) { - extras.onPartialOutput({ - toolCallId, - contextItems: [ - { - name: "Terminal", - description: "Terminal command output", - content: "", - status: status, - }, - ], - }); - } - } - - // Use spawn with color environment - const { shell, args } = getShellCommand(command); - const childProc = childProcess.spawn(shell, args, { - cwd, - env: getColorEnv(), // Add enhanced environment for colors + if (!waitForCompletion) { + const status = "Command is running in the background..."; + if (extras.onPartialOutput) { + extras.onPartialOutput({ + toolCallId, + contextItems: [ + { + name: "Terminal", + description: "Terminal command output", + content: "", + status: status, + }, + ], }); } } // Use spawn with color environment - const childProc = childProcess.spawn(command, { + const { shell, args } = getShellCommand(command); + const childProc = childProcess.spawn(shell, args, { cwd, - shell: true, env: getColorEnv(), // Add enhanced environment for colors }); From 4e5ee6fbb6490c06294e1b6bc2a46e13d52c9c50 Mon Sep 17 00:00:00 2001 From: vldf Date: Fri, 8 Aug 2025 11:40:49 +0300 Subject: [PATCH 29/35] fix: increase `debouncer`'s `interval` value to fix #6199 --- .../listeners/ContinuePluginSelectionListener.kt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/listeners/ContinuePluginSelectionListener.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/listeners/ContinuePluginSelectionListener.kt index adcc86f7f..71e73369f 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/listeners/ContinuePluginSelectionListener.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/listeners/ContinuePluginSelectionListener.kt @@ -1,29 +1,27 @@ package com.github.continuedev.continueintellijextension.listeners import ToolTipComponent -import com.github.continuedev.continueintellijextension.editor.EditorUtils import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings import com.github.continuedev.continueintellijextension.utils.Debouncer import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.service +import com.intellij.openapi.editor.Document import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.LogicalPosition import com.intellij.openapi.editor.SelectionModel import com.intellij.openapi.editor.event.SelectionEvent import com.intellij.openapi.editor.event.SelectionListener -import com.intellij.openapi.project.DumbAware -import com.intellij.openapi.util.TextRange -import kotlinx.coroutines.CoroutineScope -import com.intellij.openapi.editor.Document -import com.intellij.openapi.editor.ex.util.EditorUtil import com.intellij.openapi.fileEditor.FileDocumentManager import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.fileEditor.TextEditor +import com.intellij.openapi.project.DumbAware +import com.intellij.openapi.util.TextRange +import kotlinx.coroutines.CoroutineScope class ContinuePluginSelectionListener( coroutineScope: CoroutineScope, ) : SelectionListener, DumbAware { - private val debouncer = Debouncer(100, coroutineScope) + private val debouncer = Debouncer(200, coroutineScope) private var toolTipComponents: ArrayList = ArrayList() private var lastActiveEditor: Editor? = null @@ -228,5 +226,3 @@ class ContinuePluginSelectionListener( editor.contentComponent.repaint() } } - - From d328ab24dcd05a7b613d790777ddb9af53e9ba6e Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Fri, 8 Aug 2025 07:48:42 -0700 Subject: [PATCH 30/35] chore: Add action to comment on duplicate issues --- .github/workflows/similar-issues.yml | 289 +++++++++++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100644 .github/workflows/similar-issues.yml diff --git a/.github/workflows/similar-issues.yml b/.github/workflows/similar-issues.yml new file mode 100644 index 000000000..74031688b --- /dev/null +++ b/.github/workflows/similar-issues.yml @@ -0,0 +1,289 @@ +name: Similar Issue Search & Discussion Suggestion +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + analyze: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - name: Checkout deja-view + uses: actions/checkout@v4 + with: + repository: 'bdougie/deja-view' + path: deja-view + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + cd deja-view + pip install -r requirements.txt + + - name: Search for similar issues + id: search + env: + CHROMA_CLOUD_API_KEY: ${{ secrets.CHROMA_CLOUD_API_KEY }} + CHROMA_CLOUD_API_URL: ${{ secrets.CHROMA_CLOUD_API_URL }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd deja-view + + # Determine if this is an issue or PR + if [ "${{ github.event_name }}" = "pull_request" ]; then + TITLE="${{ github.event.pull_request.title }}" + THRESHOLD="0.85" + TOP_K="5" + else + TITLE="${{ github.event.issue.title }}" + THRESHOLD="0.7" + TOP_K="3" + fi + + # Search for similar issues + SIMILAR_ISSUES=$(python cli.py search "$TITLE" \ + --repo "${{ github.repository }}" \ + --top-k $TOP_K \ + --threshold $THRESHOLD \ + --format json) + + # Save to output + echo "similar_issues<> $GITHUB_OUTPUT + echo "$SIMILAR_ISSUES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + # Check if any similar issues found + if [ "$(echo "$SIMILAR_ISSUES" | jq '. | length')" -gt 0 ]; then + echo "has_similar=true" >> $GITHUB_OUTPUT + else + echo "has_similar=false" >> $GITHUB_OUTPUT + fi + + - name: Check if issue should be a discussion + id: discussion_check + if: github.event_name == 'issues' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd deja-view + + # Create a Python script to analyze the issue + cat << 'PYTHON_SCRIPT' > check_discussion.py + import os + import json + import re + from github_similarity_service import SimilarityService + + # Get issue details from environment + issue_title = os.environ.get('ISSUE_TITLE', '') + issue_body = os.environ.get('ISSUE_BODY', '') + issue_labels = json.loads(os.environ.get('ISSUE_LABELS', '[]')) + + # Mock Issue object for analysis + class MockIssue: + def __init__(self): + self.title = issue_title + self.body = issue_body + self.labels = issue_labels + self.state = 'open' + self.number = int(os.environ.get('ISSUE_NUMBER', 0)) + self.created_at = '' + self.updated_at = '' + self.url = '' + + service = SimilarityService() + issue = MockIssue() + + score, reasons = service._calculate_discussion_score(issue) + + result = { + 'score': score, + 'reasons': reasons, + 'should_be_discussion': score >= 0.5, + 'confidence': 'high' if score >= 0.7 else 'medium' if score >= 0.5 else 'low' + } + + print(json.dumps(result)) + PYTHON_SCRIPT + + # Run the analysis + DISCUSSION_ANALYSIS=$(ISSUE_TITLE="${{ github.event.issue.title }}" \ + ISSUE_BODY='${{ github.event.issue.body }}' \ + ISSUE_LABELS='${{ toJson(github.event.issue.labels.*.name) }}' \ + ISSUE_NUMBER="${{ github.event.issue.number }}" \ + python check_discussion.py) + + echo "analysis<> $GITHUB_OUTPUT + echo "$DISCUSSION_ANALYSIS" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + # Extract whether it should be a discussion + SHOULD_BE_DISCUSSION=$(echo "$DISCUSSION_ANALYSIS" | jq -r '.should_be_discussion') + echo "should_be_discussion=$SHOULD_BE_DISCUSSION" >> $GITHUB_OUTPUT + + # Extract confidence level + CONFIDENCE=$(echo "$DISCUSSION_ANALYSIS" | jq -r '.confidence') + echo "confidence=$CONFIDENCE" >> $GITHUB_OUTPUT + + - name: Comment with analysis + uses: actions/github-script@v7 + with: + script: | + let comment = ''; + const hasSimilar = '${{ steps.search.outputs.has_similar }}' === 'true'; + const isPR = '${{ github.event_name }}' === 'pull_request'; + const shouldBeDiscussion = !isPR && '${{ steps.discussion_check.outputs.should_be_discussion }}' === 'true'; + + // Add similar issues section if found + if (hasSimilar) { + const similarIssues = JSON.parse(`${{ steps.search.outputs.similar_issues }}`); + + if (isPR) { + // Filter only open issues for PRs + const openIssues = similarIssues.filter(issue => issue.state === 'open'); + + if (openIssues.length > 0) { + // Simple table format for PRs + comment += '## 📋 Related Open Issues\n\n'; + comment += 'These open issues appear to be related to this PR (≥85% similarity):\n\n'; + comment += '| # | Title | Similarity |\n'; + comment += '|---|-------|------------|\n'; + + openIssues.forEach(issue => { + const similarity = (issue.similarity * 100).toFixed(0); + const title = issue.title.length > 50 ? issue.title.substring(0, 47) + '...' : issue.title; + comment += `| [#${issue.number}](${issue.url}) | ${title} | ${similarity}% |\n`; + }); + + comment += '\n'; + comment += '_Consider closing related issues if this PR addresses them._\n'; + } else { + // Don't add any comment if no open issues found + return; + } + } else { + // Original format for issues + comment += '## 🔍 Similar Issues Found\n\n'; + comment += 'I found some existing issues that might be related:\n\n'; + + similarIssues.forEach((issue, index) => { + const similarity = (issue.similarity * 100).toFixed(1); + const state = issue.state === 'open' ? '🟢' : '🔴'; + + comment += `${index + 1}. ${state} [#${issue.number}: ${issue.title}](${issue.url}) (${similarity}% similar)\n`; + + if (issue.summary) { + comment += ` > ${issue.summary.substring(0, 150)}${issue.summary.length > 150 ? '...' : ''}\n`; + } + comment += '\n'; + }); + + comment += '\n'; + } + } + + // Add discussion suggestion if applicable + if (shouldBeDiscussion) { + const analysis = JSON.parse(`${{ steps.discussion_check.outputs.analysis }}`); + const confidence = '${{ steps.discussion_check.outputs.confidence }}'; + + if (hasSimilar) { + comment += '---\n\n'; + } + + comment += '## 💬 Discussion Suggestion\n\n'; + + const confidenceEmoji = { + 'high': '🟢', + 'medium': '🟡', + 'low': '🔴' + }; + + comment += `This issue might be better suited as a **GitHub Discussion** ${confidenceEmoji[confidence] || ''}\n\n`; + comment += `**Confidence**: ${confidence.charAt(0).toUpperCase() + confidence.slice(1)} (${(analysis.score * 100).toFixed(0)}%)\n\n`; + + if (analysis.reasons && analysis.reasons.length > 0) { + comment += '**Reasons**:\n'; + analysis.reasons.forEach(reason => { + comment += `- ${reason}\n`; + }); + comment += '\n'; + } + + comment += 'GitHub Discussions are great for:\n'; + comment += '- Questions and help requests\n'; + comment += '- Feature requests and ideas\n'; + comment += '- General feedback and brainstorming\n'; + comment += '- Community conversations\n\n'; + + comment += '_Consider converting this to a discussion if it\'s not a bug report or actionable task._\n'; + } + + // Only comment if we have something to say + if (comment) { + comment += '\n---\n'; + comment += '_This analysis was automatically generated by [deja-view](https://github.com/bdougie/deja-view)._'; + + if ('${{ github.event_name }}' === 'pull_request') { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body: comment + }); + } else { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + } + } + + - name: Add labels + if: github.event_name == 'issues' + uses: actions/github-script@v7 + with: + script: | + const labels = []; + + // Check for duplicate + if ('${{ steps.search.outputs.has_similar }}' === 'true') { + const similarIssues = JSON.parse(`${{ steps.search.outputs.similar_issues }}`); + const hasDuplicate = similarIssues.some(issue => issue.similarity > 0.9); + + if (hasDuplicate) { + labels.push('potential-duplicate'); + } + } + + // Check for discussion suggestion + if ('${{ steps.discussion_check.outputs.should_be_discussion }}' === 'true') { + const confidence = '${{ steps.discussion_check.outputs.confidence }}'; + + if (confidence === 'high') { + labels.push('should-be-discussion'); + } else if (confidence === 'medium') { + labels.push('discussion'); + } + } + + // Add labels if any + if (labels.length > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: labels + }); + } From 8fe5077e60a0d315d4e77878ca7ef2856f606566 Mon Sep 17 00:00:00 2001 From: Keerthana Panyam Date: Wed, 6 Aug 2025 11:02:03 -0400 Subject: [PATCH 32/35] move context restriction properties to model level autocompleteOptions - added context restriction properties to model autocompleteOptions schema - discarded changes to add global tabAutocompleteOptions to config schema - added experimental parameters to both config-types. - added YAML alternative note to json reference. - updated YAML configuration example with per-model options. - added reference documentation with parameters for autocomplete options. --- core/autocomplete/CompletionProvider.ts | 2 +- core/config/yaml/loadYaml.ts | 1 - core/util/parameters.ts | 1 + docs/customize/deep-dives/autocomplete.mdx | 31 ++++++++++++++-- docs/reference.mdx | 30 ++++++++++++++- docs/reference/json-reference.mdx | 12 ++++++ .../mainInput/Lump/EditBlockButton.tsx | 2 +- packages/config-types/src/index.ts | 37 ++++++++++--------- packages/config-yaml/src/load/unroll.ts | 10 +---- packages/config-yaml/src/schemas/index.ts | 5 --- packages/config-yaml/src/schemas/models.ts | 10 +++++ 11 files changed, 102 insertions(+), 39 deletions(-) diff --git a/core/autocomplete/CompletionProvider.ts b/core/autocomplete/CompletionProvider.ts index 143dbf269..d51c15853 100644 --- a/core/autocomplete/CompletionProvider.ts +++ b/core/autocomplete/CompletionProvider.ts @@ -10,8 +10,8 @@ import { BracketMatchingService } from "./filtering/BracketMatchingService.js"; import { CompletionStreamer } from "./generation/CompletionStreamer.js"; import { postprocessCompletion } from "./postprocessing/index.js"; import { shouldPrefilter } from "./prefiltering/index.js"; -import { getAllSnippetsWithoutRace } from "./snippets/index.js"; import { renderPromptWithTokenLimit } from "./templating/index.js"; +import { getAllSnippetsWithoutRace } from "./snippets/index.js"; import { GetLspDefinitionsFunction } from "./types.js"; import { AutocompleteDebouncer } from "./util/AutocompleteDebouncer.js"; import { AutocompleteLoggingService } from "./util/AutocompleteLoggingService.js"; diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 94aba67be..dbfd88a08 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -429,7 +429,6 @@ async function configYamlToContinueConfig(options: { })), false, ); - continueConfig.tabAutocompleteOptions = config.tabAutocompleteOptions; return { config: continueConfig, errors: localErrors }; } diff --git a/core/util/parameters.ts b/core/util/parameters.ts index 147c3979a..fbcdbca66 100644 --- a/core/util/parameters.ts +++ b/core/util/parameters.ts @@ -20,6 +20,7 @@ export const DEFAULT_AUTOCOMPLETE_OPTS: TabAutocompleteOptions = { useImports: true, transform: true, showWhateverWeHaveAtXMs: 300, + // Experimental options: true = enabled, false = disabled, number = enabled w priority experimental_includeClipboard: true, experimental_includeRecentlyVisitedRanges: true, experimental_includeRecentlyEditedRanges: true, diff --git a/docs/customize/deep-dives/autocomplete.mdx b/docs/customize/deep-dives/autocomplete.mdx index d1ea3635e..818261ac5 100644 --- a/docs/customize/deep-dives/autocomplete.mdx +++ b/docs/customize/deep-dives/autocomplete.mdx @@ -84,7 +84,7 @@ Then, add the model to your configuration: Once the model has been downloaded, you should begin to see completions in VS Code. -NOTE: Typically, thinking-type models are not recommended as they generate more slowly and are not suitable for scenarios that require speed. +NOTE: Typically, thinking-type models are not recommended as they generate more slowly and are not suitable for scenarios that require speed. However, if you use any thinking-switchable models, you can configure these models for autocomplete functions by turning off the thinking mode. @@ -92,7 +92,7 @@ For example: - ```yaml title="config.yaml" +```yaml title="config.yaml" models: - name: Qwen3 without Thinking for Autocomplete provider: ollama @@ -122,9 +122,32 @@ The following settings can be configured for autocompletion in the IDE extension - `Multiline Autocompletions`: Controls multiline completions for autocomplete. Can be set to `always`, `never`, or `auto`. Defaults to `auto` - `Disable autocomplete in files`: List of comma-separated glob pattern to disable autocomplete in matching files. E.g., "\_/.md, \*/.txt" -### `config.json` Configuration +### Autocomplete Configuration -The `config.json` configuration format (deprecated) offers further configuration options through `tabAutocompleteOptions`. See the [JSON Reference](/reference) for more details. +#### YAML Configuration + +The `config.yaml` format offers model-level configuration using the `autocompleteOptions` field. See the [YAML Reference](/reference#models) for more details. + +```yaml +models: + - name: Codestral + provider: mistral + model: codestral-latest + roles: + - autocomplete + autocompleteOptions: + disable: false + maxPromptTokens: 1024 + debounceDelay: 250 + modelTimeout: 150 + maxSuffixPercentage: 0.2 + prefixPercentage: 0.3 + onlyMyCode: true +``` + +#### JSON Configuration (Deprecated) + +The `config.json` configuration format offers configuration options through `tabAutocompleteOptions`. See the [JSON Reference](/reference/json-reference#tabautocomplete-options) for more details. ## FAQs diff --git a/docs/reference.mdx b/docs/reference.mdx index bf9683e10..ee41e8f18 100644 --- a/docs/reference.mdx +++ b/docs/reference.mdx @@ -176,9 +176,10 @@ The `models` section defines the language models used in your configuration. Mod - `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`. The default value is `[chat, edit, apply, summarize]`. Note that the `summarize` role is not currently used. - `capabilities`: Array of strings denoting model capabilities, which will overwrite Continue's autodetection based on provider and model. Supported capabilities include: + - `tool_use`: Enables function/tool calling support (required for Agent mode) - `image_input`: Enables image upload and processing support - + Continue automatically detects these capabilities for most models, but you can override this when using custom deployments or if autodetection isn't working correctly. See the [Model Capabilities guide](/customize/deep-dives/model-capabilities) for detailed information. - `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists. @@ -228,6 +229,21 @@ The `models` section defines the language models used in your configuration. Mod - `key`: Path to the client certificate key file. - `passphrase`: Optional passphrase for the client certificate key file. +- `autocompleteOptions`: If the model includes role `autocomplete`, these settings apply for tab autocompletion: + + - `disable`: If `true`, disables autocomplete for this model. + - `maxPromptTokens`: Maximum number of tokens for the autocomplete prompt. + - `debounceDelay`: Delay before triggering autocomplete in milliseconds. + - `modelTimeout`: Model timeout for autocomplete requests in milliseconds. + - `maxSuffixPercentage`: Maximum percentage of prompt allocated for suffix. + - `prefixPercentage`: Percentage of input allocated for prefix. + - `template`: Custom template for autocomplete using Mustache syntax. You can use the `{{{ prefix }}}`, `{{{ suffix }}}`, `{{{ filename }}}`, `{{{ reponame }}}`, and `{{{ language }}}` variables. + - `onlyMyCode`: Only includes code within the repository for context. + - `useCache`: If `true`, enables caching for completions. + - `useImports`: If `true`, includes imports in context. + - `useRecentlyEdited`: If `true`, includes recently edited files in context. + - `useRecentlyOpened`: If `true`, includes recently opened files in context. + **Example:** ```yaml title="config.yaml" @@ -247,6 +263,10 @@ models: model: codestral-latest roles: - autocomplete + autocompleteOptions: + debounceDelay: 250 + maxPromptTokens: 1024 + onlyMyCode: true - name: My Model - OpenAI-Compatible provider: openai apiBase: http://my-endpoint/v1 @@ -456,6 +476,10 @@ models: model: starcoder roles: - autocomplete + autocompleteOptions: + debounceDelay: 350 + maxPromptTokens: 1024 + onlyMyCode: true defaultCompletionOptions: temperature: 0.3 stop: @@ -531,4 +555,8 @@ models: useLegacyCompletionsEndpoint: false roles: - autocomplete + autocompleteOptions: + debounceDelay: 350 + maxPromptTokens: 1024 + onlyMyCode: true ``` diff --git a/docs/reference/json-reference.mdx b/docs/reference/json-reference.mdx index 7d6f40568..d775b27e5 100644 --- a/docs/reference/json-reference.mdx +++ b/docs/reference/json-reference.mdx @@ -101,6 +101,12 @@ config.json Specifies options for tab autocompletion behavior. + + **Note**: Many of these parameters can also be configured per-model using the + `autocompleteOptions` field in `config.yaml`. See the [YAML + Reference](/reference#models) for more details. + + **Properties:** - `disable`: If `true`, disables tab autocomplete (default: `false`). @@ -468,16 +474,19 @@ Several experimental config parameters are available, as described below: - `defaultContext`: Defines the default context for the LLM. Uses the same format as `contextProviders` but includes an additional `query` property to specify custom query parameters.= - `modelRoles`: + - `inlineEdit`: Model title for inline edits. - `applyCodeBlock`: Model title for applying code blocks. - `repoMapFileSelection`: Model title for repo map selections. - `quickActions`: Array of custom quick actions + - `title` (**required**): Display title for the quick action. - `prompt` (**required**): Prompt for quick action. - `sendToChat`: If `true`, sends result to chat; else inserts in document. Default is `false`. - `contextMenuPrompts`: + - `comment`: Prompt for commenting code. - `docstring`: Prompt for adding docstrings. - `fix`: Prompt for fixing code. @@ -529,15 +538,18 @@ Some deprecated `config.json` settings are no longer stored in config and have b - `disableSessionTitles`/`ui.getChatTitles`: This value will be migrated to the safest merged value (`true` if either are `true`). `getChatTitles` takes precedence if set to false - `tabAutocompleteOptions` + - `useCache`: This value will override during migration. - `disableInFiles`: This value will be migrated to the safest merged value (arrays of file matches merged/deduplicated) - `multilineCompletions`: This value will override during migration. - `experimental` + - `useChromiumForDocsCrawling`: This value will override during migration. - `readResponseTTS`: This value will override during migration. - `ui` - all will override during migration + - `codeBlockToolbarPosition` - `fontSize` - `codeWrap` diff --git a/gui/src/components/mainInput/Lump/EditBlockButton.tsx b/gui/src/components/mainInput/Lump/EditBlockButton.tsx index 0bce9f642..19780e875 100644 --- a/gui/src/components/mainInput/Lump/EditBlockButton.tsx +++ b/gui/src/components/mainInput/Lump/EditBlockButton.tsx @@ -6,7 +6,7 @@ import { IdeMessengerContext } from "../../../context/IdeMessenger"; type SectionKey = Exclude< keyof ConfigYaml, - "name" | "version" | "schema" | "metadata" | "tabAutocompleteOptions" + "name" | "version" | "schema" | "metadata" >; interface EditBlockButtonProps { diff --git a/packages/config-types/src/index.ts b/packages/config-types/src/index.ts index 942f75219..a22bb00bb 100644 --- a/packages/config-types/src/index.ts +++ b/packages/config-types/src/index.ts @@ -136,27 +136,30 @@ export const uiOptionsSchema = z.object({ export type UiOptions = z.infer; export const tabAutocompleteOptionsSchema = z.object({ - disable: z.boolean().optional(), - maxPromptTokens: z.number().optional(), - debounceDelay: z.number().optional(), - maxSuffixPercentage: z.number().optional(), - prefixPercentage: z.number().optional(), + disable: z.boolean(), + maxPromptTokens: z.number(), + debounceDelay: z.number(), + maxSuffixPercentage: z.number(), + prefixPercentage: z.number(), transform: z.boolean().optional(), template: z.string().optional(), - multilineCompletions: z.enum(["always", "never", "auto"]).optional(), - slidingWindowPrefixPercentage: z.number().optional(), - slidingWindowSize: z.number().optional(), - useCache: z.boolean().optional(), - onlyMyCode: z.boolean().optional(), - useRecentlyEdited: z.boolean().optional(), - useRecentlyOpened: z.boolean().optional(), + multilineCompletions: z.enum(["always", "never", "auto"]), + slidingWindowPrefixPercentage: z.number(), + slidingWindowSize: z.number(), + useCache: z.boolean(), + onlyMyCode: z.boolean(), + useRecentlyEdited: z.boolean(), disableInFiles: z.array(z.string()).optional(), useImports: z.boolean().optional(), - // Experimental options - experimental_includeClipboard: z.boolean().optional(), - experimental_includeRecentlyVisitedRanges: z.boolean().optional(), - experimental_includeRecentlyEditedRanges: z.boolean().optional(), - experimental_includeDiff: z.boolean().optional(), + // Experimental options: true = enabled, false = disabled, number = enabled w priority + experimental_includeClipboard: z.union([z.boolean(), z.number()]).optional(), + experimental_includeRecentlyVisitedRanges: z + .union([z.boolean(), z.number()]) + .optional(), + experimental_includeRecentlyEditedRanges: z + .union([z.boolean(), z.number()]) + .optional(), + experimental_includeDiff: z.union([z.boolean(), z.number()]).optional(), experimental_enableStaticContextualization: z.boolean().optional(), }); export type TabAutocompleteOptions = z.infer< diff --git a/packages/config-yaml/src/load/unroll.ts b/packages/config-yaml/src/load/unroll.ts index 6ab35bc21..adbe45324 100644 --- a/packages/config-yaml/src/load/unroll.ts +++ b/packages/config-yaml/src/load/unroll.ts @@ -309,19 +309,11 @@ export async function unrollBlocks( const unrolledAssistant: AssistantUnrolled = { name: assistant.name, version: assistant.version, - ...(assistant.tabAutocompleteOptions && { - tabAutocompleteOptions: assistant.tabAutocompleteOptions, - }), }; const sections: (keyof Omit< ConfigYaml, - | "name" - | "version" - | "rules" - | "schema" - | "metadata" - | "tabAutocompleteOptions" + "name" | "version" | "rules" | "schema" | "metadata" >)[] = ["models", "context", "data", "mcpServers", "prompts", "docs"]; // Process all sections in parallel diff --git a/packages/config-yaml/src/schemas/index.ts b/packages/config-yaml/src/schemas/index.ts index dc1ff9c9d..e15a5655d 100644 --- a/packages/config-yaml/src/schemas/index.ts +++ b/packages/config-yaml/src/schemas/index.ts @@ -1,4 +1,3 @@ -import { tabAutocompleteOptionsSchema } from "@continuedev/config-types"; import * as z from "zod"; import { commonModelSlugs } from "./commonSlugs.js"; import { dataSchema } from "./data/index.js"; @@ -146,7 +145,6 @@ export const configYamlSchema = baseConfigYamlSchema.extend({ .optional(), prompts: z.array(blockOrSchema(promptSchema)).optional(), docs: z.array(blockOrSchema(docSchema)).optional(), - tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type ConfigYaml = z.infer; @@ -159,7 +157,6 @@ export const assistantUnrolledSchema = baseConfigYamlSchema.extend({ rules: z.array(ruleSchema.nullable()).optional(), prompts: z.array(promptSchema.nullable()).optional(), docs: z.array(docSchema.nullable()).optional(), - tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type AssistantUnrolled = z.infer; @@ -172,7 +169,6 @@ export const assistantUnrolledSchemaNonNullable = baseConfigYamlSchema.extend({ rules: z.array(ruleSchema).optional(), prompts: z.array(promptSchema).optional(), docs: z.array(docSchema).optional(), - tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type AssistantUnrolledNonNullable = z.infer< @@ -258,7 +254,6 @@ export const configSchema = z.object({ proxy: z.string().optional(), api_base: z.string().optional(), api_key: z.string().optional(), - tabAutocompleteOptions: tabAutocompleteOptionsSchema.optional(), }); export type Config = z.infer; diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 283ec6781..b6e511e2a 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -119,6 +119,16 @@ export const autocompleteOptionsSchema = z.object({ prefixPercentage: z.number().optional(), template: z.string().optional(), onlyMyCode: z.boolean().optional(), + useCache: z.boolean().optional(), + useImports: z.boolean().optional(), + useRecentlyEdited: z.boolean().optional(), + useRecentlyOpened: z.boolean().optional(), + // Experimental options: true = enabled, false = disabled, number = enabled w priority + experimental_includeClipboard: z.boolean().optional(), + experimental_includeRecentlyVisitedRanges: z.boolean().optional(), + experimental_includeRecentlyEditedRanges: z.boolean().optional(), + experimental_includeDiff: z.boolean().optional(), + experimental_enableStaticContextualization: z.boolean().optional(), }); /** Prompt templates use Handlebars syntax */ From 406f3c8e6e25f374aa0101dcca4fcc5733095d39 Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Fri, 8 Aug 2025 09:19:43 -0700 Subject: [PATCH 33/35] fix: Update similar-issues.yml --- .github/workflows/similar-issues.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/similar-issues.yml b/.github/workflows/similar-issues.yml index 74031688b..48f536e84 100644 --- a/.github/workflows/similar-issues.yml +++ b/.github/workflows/similar-issues.yml @@ -17,7 +17,8 @@ jobs: uses: actions/checkout@v4 with: repository: 'bdougie/deja-view' - path: deja-view + # Option 1: Pin to specific commit (most secure) + ref: '45e7696' # Pin to specific commit for stability - name: Setup Python uses: actions/setup-python@v5 From b11e1d80f7b52d59603a42fabc17c5859dbf6a0c Mon Sep 17 00:00:00 2001 From: Brian Douglas Date: Fri, 8 Aug 2025 09:20:11 -0700 Subject: [PATCH 34/35] fix: similar-issues.yml --- .github/workflows/similar-issues.yml | 78 +++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 13 deletions(-) diff --git a/.github/workflows/similar-issues.yml b/.github/workflows/similar-issues.yml index 48f536e84..13ebcf269 100644 --- a/.github/workflows/similar-issues.yml +++ b/.github/workflows/similar-issues.yml @@ -11,7 +11,7 @@ jobs: permissions: issues: write pull-requests: write - + steps: - name: Checkout deja-view uses: actions/checkout@v4 @@ -19,43 +19,92 @@ jobs: repository: 'bdougie/deja-view' # Option 1: Pin to specific commit (most secure) ref: '45e7696' # Pin to specific commit for stability - + + # Option 2: Use a tag (recommended after creating releases) + # ref: 'v1.0.0' + + # Option 3: Use main branch (least secure, gets latest changes) + # ref: 'main' + + path: deja-view + - name: Setup Python uses: actions/setup-python@v5 with: python-version: '3.11' - + - name: Install dependencies run: | cd deja-view pip install -r requirements.txt + - name: Index repository if needed + env: + CHROMA_API_KEY: ${{ secrets.CHROMA_CLOUD_API_KEY }} + CHROMA_TENANT: ${{ secrets.CHROMA_TENANT }} + CHROMA_DATABASE: ${{ secrets.CHROMA_DATABASE }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd deja-view + + # Index the repository (this will update existing index) + python cli.py index "${{ github.repository }}" --max-issues 200 || true + - name: Search for similar issues id: search env: - CHROMA_CLOUD_API_KEY: ${{ secrets.CHROMA_CLOUD_API_KEY }} - CHROMA_CLOUD_API_URL: ${{ secrets.CHROMA_CLOUD_API_URL }} + CHROMA_API_KEY: ${{ secrets.CHROMA_CLOUD_API_KEY }} + CHROMA_TENANT: ${{ secrets.CHROMA_TENANT }} + CHROMA_DATABASE: ${{ secrets.CHROMA_DATABASE }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd deja-view # Determine if this is an issue or PR if [ "${{ github.event_name }}" = "pull_request" ]; then - TITLE="${{ github.event.pull_request.title }}" + ISSUE_URL="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" THRESHOLD="0.85" TOP_K="5" else - TITLE="${{ github.event.issue.title }}" + ISSUE_URL="https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}" THRESHOLD="0.7" - TOP_K="3" + TOP_K="5" fi + # Create a Python script to search and format as JSON + cat << 'PYTHON_SCRIPT' > search_similar.py + import sys + import json + import os + from github_similarity_service import SimilarityService + + issue_url = sys.argv[1] + threshold = float(sys.argv[2]) + top_k = int(sys.argv[3]) + + # Parse issue number from URL + issue_number = int(issue_url.split('/')[-1]) + repo_parts = issue_url.split('/') + owner = repo_parts[3] + repo = repo_parts[4] + + service = SimilarityService() + + # Find similar issues + similar = service.find_similar_issues( + owner=owner, + repo=repo, + issue_number=issue_number, + top_k=top_k, + min_similarity=threshold + ) + + # Format as JSON + print(json.dumps(similar)) + PYTHON_SCRIPT + # Search for similar issues - SIMILAR_ISSUES=$(python cli.py search "$TITLE" \ - --repo "${{ github.repository }}" \ - --top-k $TOP_K \ - --threshold $THRESHOLD \ - --format json) + SIMILAR_ISSUES=$(python search_similar.py "$ISSUE_URL" "$THRESHOLD" "$TOP_K") # Save to output echo "similar_issues<> $GITHUB_OUTPUT @@ -73,6 +122,9 @@ jobs: id: discussion_check if: github.event_name == 'issues' env: + CHROMA_API_KEY: ${{ secrets.CHROMA_CLOUD_API_KEY }} + CHROMA_TENANT: ${{ secrets.CHROMA_TENANT }} + CHROMA_DATABASE: ${{ secrets.CHROMA_DATABASE }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd deja-view From 712b8525c13946faa0f32d7f9dbddc254d4b8c9c Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Fri, 8 Aug 2025 10:34:04 -0700 Subject: [PATCH 35/35] chore: jetbrains 1.0.35 (#7057) --- extensions/intellij/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index 175993fa2..75b2d5bd8 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -1,6 +1,6 @@ pluginGroup=com.github.continuedev.continueintellijextension pluginRepositoryUrl=https://github.com/continuedev/continue -pluginVersion=1.0.34 +pluginVersion=1.0.35 pluginSinceBuild=223 platformType=IC platformVersion=2022.3.3