From ad471a3015d2de1e028f678bf8bd5e83d21ec19a Mon Sep 17 00:00:00 2001 From: Mathew Pareles Date: Tue, 18 Mar 2025 21:22:13 -0700 Subject: [PATCH] fixes --- src/vs/workbench/contrib/void/browser/editCodeService.ts | 5 +++++ src/vs/workbench/contrib/void/browser/toolsService.ts | 6 +++--- src/vs/workbench/contrib/void/common/prompt/prompts.ts | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/editCodeService.ts b/src/vs/workbench/contrib/void/browser/editCodeService.ts index a18f4a2a..ab08106a 100644 --- a/src/vs/workbench/contrib/void/browser/editCodeService.ts +++ b/src/vs/workbench/contrib/void/browser/editCodeService.ts @@ -1775,6 +1775,7 @@ class EditCodeService extends Disposable implements IEditCodeService { this._llmMessageService.abort(streamRequestIdRef.current) weAreAborting = false } + diffZone._streamState.line = 1 resMessageDonePromise() this._refreshStylesAndDiffsInURI(uri) return @@ -1850,6 +1851,10 @@ class EditCodeService extends Disposable implements IEditCodeService { } // writeover the whole file let newCode = originalFileCode + + // IMPORTANT - sort by lineNum + addedTrackingZoneOfBlockNum.sort((a, b) => a.metadata.originalBounds[0] - b.metadata.originalBounds[0]) + for (let blockNum = addedTrackingZoneOfBlockNum.length - 1; blockNum >= 0; blockNum -= 1) { const { originalBounds } = addedTrackingZoneOfBlockNum[blockNum].metadata const finalCode = blocks[blockNum].final diff --git a/src/vs/workbench/contrib/void/browser/toolsService.ts b/src/vs/workbench/contrib/void/browser/toolsService.ts index 89e4d8ae..ba7a5201 100644 --- a/src/vs/workbench/contrib/void/browser/toolsService.ts +++ b/src/vs/workbench/contrib/void/browser/toolsService.ts @@ -220,7 +220,7 @@ export class ToolsService implements IToolsService { return { queryStr, pageNumber } }, - search: async (params: string) => { + text_search: async (params: string) => { const o = validateJSON(params) const { query: queryUnknown, pageNumber: pageNumberUnknown } = o @@ -307,7 +307,7 @@ export class ToolsService implements IToolsService { return { uris, hasNextPage } }, - search: async ({ queryStr, pageNumber }) => { + text_search: async ({ queryStr, pageNumber }) => { const query = queryBuilder.text({ pattern: queryStr, isRegExp: true, @@ -376,7 +376,7 @@ export class ToolsService implements IToolsService { pathname_search: (params, result) => { return result.uris.map(uri => uri.fsPath).join('\n') + nextPageStr(result.hasNextPage) }, - search: (params, result) => { + text_search: (params, result) => { return result.uris.map(uri => uri.fsPath).join('\n') + nextPageStr(result.hasNextPage) }, // --- diff --git a/src/vs/workbench/contrib/void/common/prompt/prompts.ts b/src/vs/workbench/contrib/void/common/prompt/prompts.ts index 4ba61b6d..72f02707 100644 --- a/src/vs/workbench/contrib/void/common/prompt/prompts.ts +++ b/src/vs/workbench/contrib/void/common/prompt/prompts.ts @@ -42,6 +42,7 @@ ${(mode === 'agent') && runningTerminalIds.length !== 0 ? `\ ${mode === 'agent' || mode === 'gather' /* tool use */ ? `\ You will be given tools you can call. - Only use tools if they help you accomplish the user's goal. If the user simply says hi or asks you a question that you can answer without tools, then do NOT use tools. +- ALWAYS use tools to take actions. For example, if you would like to edit a file, you MUST use a tool. - If you think you should use tools, you do not need to ask for permission. Feel free to call tools whenever you'd like. You can use them to understand the codebase, ${mode === 'agent' ? 'run terminal commands, edit files, ' : 'gather relevant files and information, '}etc. - NEVER refer to a tool by name when speaking with the user (NEVER say something like "I'm going to use \`tool_name\`"). Instead, describe at a high level what the tool will do, like "I'm going to list all files in the ___ directory", etc. Also do not refer to "pages" of results, just say you're getting more results. - Some tools only work if the user has a workspace open.${mode === 'agent' ? `