This commit is contained in:
Mathew Pareles 2025-03-18 21:22:13 -07:00
parent 86fddaa0e0
commit ad471a3015
3 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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)
},
// ---

View file

@ -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' ? `