Skip to content

Commit 6e813fd

Browse files
ege0zcanEge Ozcan
andauthored
chore: revert 6016264 (#1122)
Co-authored-by: Ege Ozcan <[email protected]>
1 parent 00cc54b commit 6e813fd

File tree

7 files changed

+6
-607
lines changed

7 files changed

+6
-607
lines changed

chat-client/src/client/mynahUi.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,7 @@ export const createMynahUi = (
518518
? ''
519519
: `line ${range.first} - ${range.second}`
520520
)
521-
.join(', ') || fileDetails.description
522-
? fileDetails.description
523-
: '',
521+
.join(', ') || '',
524522
description: filePath,
525523
clickable: true,
526524
data: {

package-lock.json

Lines changed: 4 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/aws-lsp-codewhisperer/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@
5252
"shlex": "2.1.2",
5353
"uuid": "^11.0.5",
5454
"vscode-uri": "^3.1.0",
55-
"@modelcontextprotocol/sdk": "^1.9.0",
56-
"@vscode/ripgrep": "^1.15.11"
55+
"@modelcontextprotocol/sdk": "^1.9.0"
5756
},
5857
"devDependencies": {
5958
"@types/adm-zip": "^0.5.5",

server/aws-lsp-codewhisperer/src/language-server/agenticChat/agenticChatController.ts

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ import { ExecuteBash, ExecuteBashOutput, ExecuteBashParams } from './tools/execu
103103
import { ExplanatoryParams, InvokeOutput, ToolApprovalException } from './tools/toolShared'
104104
import { ModelServiceException } from './errors'
105105
import { FileSearch, FileSearchParams } from './tools/fileSearch'
106-
import { GrepSearch, SanitizedRipgrepOutput } from './tools/grepSearch'
107106

108107
type 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

Comments
 (0)