@@ -103,7 +103,6 @@ import { ExecuteBash, ExecuteBashOutput, ExecuteBashParams } from './tools/execu
103103import { ExplanatoryParams , InvokeOutput , ToolApprovalException } from './tools/toolShared'
104104import { ModelServiceException } from './errors'
105105import { FileSearch , FileSearchParams } from './tools/fileSearch'
106- import { GrepSearch , SanitizedRipgrepOutput } from './tools/grepSearch'
107106
108107type ChatHandlers = Omit <
109108 LspHandlers < Chat > ,
@@ -589,7 +588,6 @@ export class AgenticChatController implements ChatHandlers {
589588 case 'fsRead' :
590589 case 'listDirectory' :
591590 case 'fileSearch' :
592- case 'grepSearch' :
593591 case 'fsWrite' :
594592 case 'executeBash' : {
595593 const toolMap = {
@@ -598,7 +596,6 @@ export class AgenticChatController implements ChatHandlers {
598596 fsWrite : { Tool : FsWrite } ,
599597 executeBash : { Tool : ExecuteBash } ,
600598 fileSearch : { Tool : FileSearch } ,
601- grepSearch : { Tool : GrepSearch } ,
602599 }
603600
604601 const { Tool } = toolMap [ toolUse . name as keyof typeof toolMap ]
@@ -681,12 +678,6 @@ export class AgenticChatController implements ChatHandlers {
681678 // no need to write tool result for listDir and fsRead into chat stream
682679 // executeBash will stream the output instead of waiting until the end
683680 break
684- case 'grepSearch' :
685- const grepSearchResult = this . #processGrepSearchResult( toolUse , result , chatResultStream )
686- if ( grepSearchResult ) {
687- await chatResultStream . writeResultBlock ( grepSearchResult )
688- }
689- break
690681 case 'fsWrite' :
691682 const chatResult = await this . #getFsWriteChatResult( toolUse )
692683 const toolUseLookup = this . #triggerContext. getToolUseLookup ( )
@@ -1000,73 +991,6 @@ export class AgenticChatController implements ChatHandlers {
1000991 }
1001992 }
1002993
1003- /**
1004- * Process grep search results and format them for display in the chat UI
1005- */
1006- #processGrepSearchResult(
1007- toolUse : ToolUse ,
1008- result : InvokeOutput ,
1009- chatResultStream : AgenticChatResultStream
1010- ) : ChatMessage | undefined {
1011- if ( toolUse . name !== 'grepSearch' ) {
1012- return undefined
1013- }
1014-
1015- let messageIdToUpdate = toolUse . toolUseId !
1016- const currentId = chatResultStream . getMessageIdToUpdateForTool ( toolUse . name ! )
1017-
1018- if ( currentId ) {
1019- messageIdToUpdate = currentId
1020- } else {
1021- chatResultStream . setMessageIdToUpdateForTool ( toolUse . name ! , messageIdToUpdate )
1022- }
1023-
1024- // Extract search results from the tool output
1025- const output = result . output . content as SanitizedRipgrepOutput
1026- if ( ! output || ! output . fileMatches || ! Array . isArray ( output . fileMatches ) ) {
1027- return {
1028- type : 'tool' ,
1029- messageId : messageIdToUpdate ,
1030- body : 'No search results found.' ,
1031- }
1032- }
1033-
1034- // Process the matches into a structured format
1035- const matches = output . fileMatches
1036- const fileDetails : Record < string , FileDetails > = { }
1037-
1038- // Create file details directly from matches
1039- for ( const match of matches ) {
1040- const filePath = match . filePath
1041- if ( ! filePath ) continue
1042-
1043- fileDetails [ filePath ] = {
1044- description : `(${ match . matchCount } results)` ,
1045- lineRanges : [ { first : - 1 , second : - 1 } ] ,
1046- }
1047- }
1048-
1049- // Create sorted array of file paths
1050- const sortedFilePaths = Object . keys ( fileDetails )
1051-
1052- // Create the context list for display
1053- const query = ( toolUse . input as any ) ?. query || 'search term'
1054- const matchCount = matches . length
1055-
1056- const contextList : FileList = {
1057- rootFolderTitle : `Searched for "${ query } ", ${ output . totalMatchCount } found` ,
1058- filePaths : sortedFilePaths ,
1059- details : fileDetails ,
1060- }
1061-
1062- return {
1063- type : 'tool' ,
1064- contextList,
1065- messageId : messageIdToUpdate ,
1066- body : '' ,
1067- }
1068- }
1069-
1070994 /**
1071995 * Updates the request input with tool results for the next iteration
1072996 */
0 commit comments