From 45214eb7434e6ddcb584d183d6cc8556e344d252 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Tue, 5 Aug 2025 14:55:31 -0700 Subject: [PATCH 1/3] fix: skip analytics capture calls if workspaceId is undefined --- core/config/profile/doLoadConfig.ts | 3 +++ .../analytics/ContinueProxyAnalyticsProvider.ts | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/config/profile/doLoadConfig.ts b/core/config/profile/doLoadConfig.ts index 90507f4a4..ea6b0bf51 100644 --- a/core/config/profile/doLoadConfig.ts +++ b/core/config/profile/doLoadConfig.ts @@ -358,6 +358,9 @@ export default async function doLoadConfig(options: { }; if (newConfig.analytics) { + // FIXME before re-enabling TeamAnalytics.setup() populate workspaceId in + // controlPlaneProxyInfo to prevent /proxy/analytics/undefined/capture calls + // where undefined is :workspaceId // await TeamAnalytics.setup( // newConfig.analytics, // uniqueId, diff --git a/core/control-plane/analytics/ContinueProxyAnalyticsProvider.ts b/core/control-plane/analytics/ContinueProxyAnalyticsProvider.ts index bb63bcf74..678be92e0 100644 --- a/core/control-plane/analytics/ContinueProxyAnalyticsProvider.ts +++ b/core/control-plane/analytics/ContinueProxyAnalyticsProvider.ts @@ -20,8 +20,12 @@ export default class ContinueProxyAnalyticsProvider event: string, properties: { [key: string]: any }, ): Promise { + if (!this.controlPlaneProxyInfo?.workspaceId) { + return; + } + const url = new URL( - `proxy/analytics/${this.controlPlaneProxyInfo?.workspaceId}/capture`, + `proxy/analytics/${this.controlPlaneProxyInfo.workspaceId}/capture`, this.controlPlaneProxyInfo?.controlPlaneProxyUrl, ).toString(); void fetch(url, { From b8277315c15ac3dff5ec4b676a31a744ff2f7193 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 5 Aug 2025 17:05:33 -0700 Subject: [PATCH 2/3] docs: move capabilities reference to clearer location (#6968) Update reference.mdx Co-authored-by: Claude --- docs/reference.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference.mdx b/docs/reference.mdx index bf9683e10..1a827dc60 100644 --- a/docs/reference.mdx +++ b/docs/reference.mdx @@ -175,11 +175,11 @@ 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: +- `capabilities`: Array of strings denoting model capabilities, which will overwrite Continue's autodetection based on provider and model. See the [Model Capabilities guide](/customize/deep-dives/model-capabilities) for detailed information. 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. + Continue automatically detects these capabilities for most models, but you can override this when using custom deployments or if autodetection isn't working correctly. - `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists. From 7401a3abd2126e058b315c986b621d28f1be6be1 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 5 Aug 2025 17:29:13 -0700 Subject: [PATCH 3/3] fix: always read file before search and replace --- .../definitions/searchAndReplaceInFile.ts | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/core/tools/definitions/searchAndReplaceInFile.ts b/core/tools/definitions/searchAndReplaceInFile.ts index 81800e01e..cdb0d127c 100644 --- a/core/tools/definitions/searchAndReplaceInFile.ts +++ b/core/tools/definitions/searchAndReplaceInFile.ts @@ -11,9 +11,6 @@ export interface SearchAndReplaceInFileArgs { export const NO_PARALLEL_TOOL_CALLING_INSRUCTION = "Note this tool CANNOT be called in parallel."; -const SEARCH_AND_REPLACE_TOOL_DESCRIPTION = `Request to replace sections of content in an existing file using multiple SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file. ${NO_PARALLEL_TOOL_CALLING_INSRUCTION}`; -const SEARCH_AND_REPLACE_FILEPATH_DESCRIPTION = - "The path of the file to modify, relative to the root of the workspace."; const SEARCH_AND_REPLACE_EXAMPLE_BLOCK = `------- SEARCH [exact content to find] ======= @@ -40,7 +37,8 @@ const SEARCH_AND_REPLACE_RULES = `Critical rules: * DO NOT make back-to-back tool calls. Instead interleave with brief explanation of what each will do. For example, instead of [explanation, tool call, tool call] you should do [explanation, tool call, explanation, tool call] 6. Special operations: * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location) - * To delete code: Use empty REPLACE section`; + * To delete code: Use empty REPLACE section +7. You should always read the file before trying to edit it, to ensure you know the up-to-date file contents`; const SEARCH_AND_REPLACE_DIFFS_DESCRIPTION = `An array of strings, each containing one or more SEARCH/REPLACE blocks following this exact format: \`\`\` @@ -73,14 +71,14 @@ export const searchAndReplaceInFileTool: Tool = { isInstant: false, function: { name: BuiltInToolNames.SearchAndReplaceInFile, - description: SEARCH_AND_REPLACE_TOOL_DESCRIPTION, + description: `Request to replace sections of content in an existing file using multiple SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file. ${NO_PARALLEL_TOOL_CALLING_INSRUCTION}`, parameters: { type: "object", required: ["filepath", "diffs"], properties: { filepath: { type: "string", - description: SEARCH_AND_REPLACE_FILEPATH_DESCRIPTION, + description: `The path of the file to modify, relative to the root of the workspace.`, }, diffs: { type: "array", @@ -94,7 +92,7 @@ export const searchAndReplaceInFileTool: Tool = { }, systemMessageDescription: createSystemMessageExampleCall( BuiltInToolNames.SearchAndReplaceInFile, - `To make targeted edits by replacing sections of content in an existing file, use the ${BuiltInToolNames.SearchAndReplaceInFile} tool with a "diffs" argument containing an array of SEARCH/REPLACE blocks that define exact changes to specific parts of the file. + `To make targeted edits by replacing sections of content in an existing file, use the ${BuiltInToolNames.SearchAndReplaceInFile} tool with a filepath (relative to the root of the workspace) and a "diffs" argument containing an array of SEARCH/REPLACE blocks that define exact changes to specific parts of the file. Each block should follow this format: ${SEARCH_AND_REPLACE_EXAMPLE_BLOCK} @@ -106,16 +104,8 @@ ${SEARCH_AND_REPLACE_RULES} [ "diffs", `[ -"------- SEARCH -[exact content to find] -======= -[new content to replace with] -+++++++ REPLACE", -"------- SEARCH -[exact content to find] -======= -[new content to replace with] -+++++++ REPLACE" +"${SEARCH_AND_REPLACE_EXAMPLE_BLOCK}", +"${SEARCH_AND_REPLACE_EXAMPLE_BLOCK}" ]`, ], ],