From 3c16eb423f49ad259b3b32c4a9f30014ddc84928 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 26 Mar 2025 10:48:40 -0700 Subject: [PATCH 1/2] tools and settings fixes --- core/config/load.ts | 2 +- core/config/profile/doLoadConfig.ts | 1 - core/index.d.ts | 4 +- core/llm/llm.test.ts | 4 +- core/tools/definitions/createNewFile.ts | 4 +- core/tools/definitions/exactSearch.ts | 2 + .../definitions/readCurrentlyOpenFile.ts | 2 + core/tools/definitions/readFile.ts | 2 + core/tools/definitions/runTerminalCommand.ts | 4 +- core/tools/definitions/searchWeb.ts | 2 + core/tools/definitions/viewDiff.ts | 4 +- core/tools/definitions/viewRepoMap.ts | 2 + core/tools/definitions/viewSubdirectory.ts | 4 +- extensions/vscode/package-lock.json | 4 +- .../platform/AssistantSelect.tsx | 2 +- gui/src/pages/config/UserSettingsForm.tsx | 32 ++++----- gui/src/pages/gui/ToolCallDiv/ToolCall.tsx | 71 ++++++++++++++----- 17 files changed, 101 insertions(+), 45 deletions(-) diff --git a/core/config/load.ts b/core/config/load.ts index a21989522..254d69a97 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -500,7 +500,7 @@ async function intermediateToFinalConfig( ...config, contextProviders, models, - tools: allTools, + tools: [...allTools], mcpServerStatuses: [], slashCommands: config.slashCommands ?? [], modelsByRole: { diff --git a/core/config/profile/doLoadConfig.ts b/core/config/profile/doLoadConfig.ts index cc4401003..6351c4474 100644 --- a/core/config/profile/doLoadConfig.ts +++ b/core/config/profile/doLoadConfig.ts @@ -135,7 +135,6 @@ export default async function doLoadConfig( faviconUrl: server.faviconUrl, readonly: false, type: "function" as const, - wouldLikeTo: "", uri: encodeMCPToolUri(server.id, tool.name), group: server.name, })); diff --git a/core/index.d.ts b/core/index.d.ts index 9c5ffe7aa..ba97377d3 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -903,7 +903,9 @@ export interface Tool { }; displayTitle: string; - wouldLikeTo: string; + wouldLikeTo?: string; + isCurrently?: string; + hasAlready?: string; readonly: boolean; uri?: string; faviconUrl?: string; diff --git a/core/llm/llm.test.ts b/core/llm/llm.test.ts index efd98ae00..2ce2d93b2 100644 --- a/core/llm/llm.test.ts +++ b/core/llm/llm.test.ts @@ -140,7 +140,9 @@ function testLLM( }, }, type: "function", - wouldLikeTo: "Say hello", + wouldLikeTo: "say hello", + isCurrently: "saying hello", + hasAlready: "said hello", readonly: true, group: "Hello", }, diff --git a/core/tools/definitions/createNewFile.ts b/core/tools/definitions/createNewFile.ts index f932ae87b..46db25cb9 100644 --- a/core/tools/definitions/createNewFile.ts +++ b/core/tools/definitions/createNewFile.ts @@ -4,7 +4,9 @@ import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const createNewFileTool: Tool = { type: "function", displayTitle: "Create New File", - wouldLikeTo: "create a new file", + wouldLikeTo: "create a new file at {{{ filepath }}}", + isCurrently: "creating a new file at {{{ filepath }}}", + hasAlready: "created a new file at {{{ filepath }}}", group: BUILT_IN_GROUP_NAME, readonly: false, function: { diff --git a/core/tools/definitions/exactSearch.ts b/core/tools/definitions/exactSearch.ts index 400adbd9e..d20db3cec 100644 --- a/core/tools/definitions/exactSearch.ts +++ b/core/tools/definitions/exactSearch.ts @@ -5,6 +5,8 @@ export const exactSearchTool: Tool = { type: "function", displayTitle: "Exact Search", wouldLikeTo: 'search for "{{{ query }}}" in the repository', + isCurrently: 'getting search results for "{{{ query }}}"', + hasAlready: 'retreived search results for "{{{ query }}}"', readonly: true, group: BUILT_IN_GROUP_NAME, function: { diff --git a/core/tools/definitions/readCurrentlyOpenFile.ts b/core/tools/definitions/readCurrentlyOpenFile.ts index 75a0e8169..f4df8e1e5 100644 --- a/core/tools/definitions/readCurrentlyOpenFile.ts +++ b/core/tools/definitions/readCurrentlyOpenFile.ts @@ -5,6 +5,8 @@ export const readCurrentlyOpenFileTool: Tool = { type: "function", displayTitle: "Read Currently Open File", wouldLikeTo: "read the current file", + isCurrently: "reading the current file", + hasAlready: "read the current file", readonly: true, group: BUILT_IN_GROUP_NAME, function: { diff --git a/core/tools/definitions/readFile.ts b/core/tools/definitions/readFile.ts index 53d381e62..0133b54b0 100644 --- a/core/tools/definitions/readFile.ts +++ b/core/tools/definitions/readFile.ts @@ -5,6 +5,8 @@ export const readFileTool: Tool = { type: "function", displayTitle: "Read File", wouldLikeTo: "read {{{ filepath }}}", + isCurrently: "reading {{{ filepath }}}", + hasAlready: "read {{{ filepath }}}", readonly: true, group: BUILT_IN_GROUP_NAME, function: { diff --git a/core/tools/definitions/runTerminalCommand.ts b/core/tools/definitions/runTerminalCommand.ts index 2b7882167..e7f48ea32 100644 --- a/core/tools/definitions/runTerminalCommand.ts +++ b/core/tools/definitions/runTerminalCommand.ts @@ -4,7 +4,9 @@ import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const runTerminalCommandTool: Tool = { type: "function", displayTitle: "Run Terminal Command", - wouldLikeTo: "run a terminal command", + wouldLikeTo: "run the following terminal command:", + isCurrently: "running the following terminal command:", + hasAlready: "ran the following terminal command:", readonly: false, group: BUILT_IN_GROUP_NAME, function: { diff --git a/core/tools/definitions/searchWeb.ts b/core/tools/definitions/searchWeb.ts index 7e2724a7c..0f98f382c 100644 --- a/core/tools/definitions/searchWeb.ts +++ b/core/tools/definitions/searchWeb.ts @@ -6,6 +6,8 @@ export const searchWebTool: Tool = { type: "function", displayTitle: "Search Web", wouldLikeTo: 'search the web for "{{{ query }}}"', + isCurrently: 'searching the web for "{{{ query }}}"', + hasAlready: 'searched the web fore "{{{ query }}}"', readonly: true, group: BUILT_IN_GROUP_NAME, function: { diff --git a/core/tools/definitions/viewDiff.ts b/core/tools/definitions/viewDiff.ts index 3da0c71a9..e7ce716a8 100644 --- a/core/tools/definitions/viewDiff.ts +++ b/core/tools/definitions/viewDiff.ts @@ -5,7 +5,9 @@ import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const viewDiffTool: Tool = { type: "function", displayTitle: "View Diff", - wouldLikeTo: "view a diff", + wouldLikeTo: "view the git diff", + isCurrently: "getting the git diff", + hasAlready: "viewed the git diff", readonly: true, group: BUILT_IN_GROUP_NAME, function: { diff --git a/core/tools/definitions/viewRepoMap.ts b/core/tools/definitions/viewRepoMap.ts index 60d671177..21c8050a6 100644 --- a/core/tools/definitions/viewRepoMap.ts +++ b/core/tools/definitions/viewRepoMap.ts @@ -6,6 +6,8 @@ export const viewRepoMapTool: Tool = { type: "function", displayTitle: "View Repo Map", wouldLikeTo: "view the repository map", + isCurrently: "getting the repository map", + hasAlready: "viewed the repository map", readonly: true, group: BUILT_IN_GROUP_NAME, function: { diff --git a/core/tools/definitions/viewSubdirectory.ts b/core/tools/definitions/viewSubdirectory.ts index b78daba76..2f9093c54 100644 --- a/core/tools/definitions/viewSubdirectory.ts +++ b/core/tools/definitions/viewSubdirectory.ts @@ -4,7 +4,9 @@ import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; export const viewSubdirectoryTool: Tool = { type: "function", displayTitle: "View Subdirectory", - wouldLikeTo: 'view the contents of "{{{ directory_path }}}"', + wouldLikeTo: 'view a map of "{{{ directory_path }}}"', + isCurrently: 'getting a map of "{{{ directory_path }}}"', + hasAlready: 'viewed a map of "{{{ directory_path }}}"', readonly: true, group: BUILT_IN_GROUP_NAME, function: { diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 00ae46772..97512d3c4 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.1.15", + "version": "1.1.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.15", + "version": "1.1.16", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 02755be30..151277c9a 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -224,7 +224,7 @@ export default function AssistantSelect() { >
- +
handleUpdate({ - showSessionTabs: !enableSessionTabs, + showSessionTabs: !showSessionTabs, }) } text="Show Session Tabs" @@ -159,19 +159,19 @@ export function UserSettingsForm() { text="Use Chromium for Docs Crawling" /> */} handleUpdate({ - disableSessionTitles: !enableSessionTitles, + disableSessionTitles: !disableSessionTitles, }) } text="Enable Session Titles" /> handleUpdate({ - displayRawMarkdown: !formatMarkdownOutput, + displayRawMarkdown: !displayRawMarkdown, }) } text="Format Markdown" @@ -188,10 +188,10 @@ export function UserSettingsForm() { /> handleUpdate({ - disableIndexing: !enableIndexing, + disableIndexing: !disableIndexing, }) } text="Enable Indexing" diff --git a/gui/src/pages/gui/ToolCallDiv/ToolCall.tsx b/gui/src/pages/gui/ToolCallDiv/ToolCall.tsx index e5db53830..47868cfc8 100644 --- a/gui/src/pages/gui/ToolCallDiv/ToolCall.tsx +++ b/gui/src/pages/gui/ToolCallDiv/ToolCall.tsx @@ -1,7 +1,7 @@ import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/24/outline"; import { ToolCallDelta, ToolCallState } from "core"; import Mustache from "mustache"; -import { useMemo, useState } from "react"; +import { ReactNode, useMemo, useState } from "react"; import { ToolTip } from "../../../components/gui/Tooltip"; import { useAppSelector } from "../../../redux/hooks"; @@ -22,14 +22,59 @@ export function ToolCallDisplay(props: ToolCallDisplayProps) { ); }, [availableTools, props.toolCall]); - const wouldLikeToMessage = useMemo(() => { - if (!tool) return ""; + const statusMessage = useMemo(() => { + if (!tool) return "Agent tool use"; - const rendered = Mustache.render( - tool.wouldLikeTo, - props.toolCallState.parsedArgs, + const defaultToolDescription = ( + <> + {tool.displayTitle ?? tool.function.name} tool + + ); + + const futureMessage = tool.wouldLikeTo ? ( + Mustache.render(tool.wouldLikeTo, props.toolCallState.parsedArgs) + ) : ( + <> + use the {defaultToolDescription} + + ); + + let intro = ""; + let message: ReactNode = ""; + + if (props.toolCallState.status === "generating") { + intro = "is generating output to"; + message = futureMessage; + } else if (props.toolCallState.status === "generated") { + intro = "wants to"; + message = futureMessage; + } else if (props.toolCallState.status === "calling") { + intro = "is"; + message = tool.isCurrently ? ( + Mustache.render(tool.isCurrently, props.toolCallState.parsedArgs) + ) : ( + <> + using the {defaultToolDescription} + + ); + } else if (props.toolCallState.status === "done") { + intro = ""; + message = tool.hasAlready ? ( + Mustache.render(tool.hasAlready, props.toolCallState.parsedArgs) + ) : ( + <> + used the {defaultToolDescription} + + ); + } else if (props.toolCallState.status === "canceled") { + intro = "tried to"; + message = futureMessage; + } + return ( +
+ Continue {intro} {message} +
); - return rendered.trim(); }, [props.toolCallState, tool]); const args: [string, any][] = useMemo(() => { @@ -60,17 +105,7 @@ export function ToolCallDisplay(props: ToolCallDisplayProps) { {tool?.faviconUrl && ( )} -
- Continue wants to{" "} - {wouldLikeToMessage ? ( - {wouldLikeToMessage} - ) : ( - <> - use the {tool?.displayTitle}{" "} - tool - - )} -
+
{statusMessage}
{!!args.length ? (
Date: Wed, 26 Mar 2025 10:59:48 -0700 Subject: [PATCH 2/2] remove index from mcp server name --- core/config/load.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/config/load.ts b/core/config/load.ts index 254d69a97..1a3acd6c6 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -529,7 +529,7 @@ async function intermediateToFinalConfig( (config.experimental?.modelContextProtocolServers ?? []).map( (server, index) => ({ id: `continue-mcp-server-${index + 1}`, - name: `MCP Server ${index + 1}`, + name: `MCP Server`, ...server, }), ),