-
Notifications
You must be signed in to change notification settings - Fork 748
feat(chat): Adding the grep search tool. #7009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. Implemented the tool using https://github.com/microsoft/vscode-ripgrep. 2. The grepped result show as clickable file path. 3. The tool currently is disable in current pr, once grepSearch tool tested, will update the tool_index.json to enable this tool.
| const searchLocation = fsPath | ||
| ? fsPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fsPath ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
| } | ||
|
|
||
| public queueDescription(updates: Writable): void { | ||
| const searchDirectory = this.getSearchDirectory(this.fsPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extract this outside, this is being called multiple times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| this.logger.error(`Ripgrep process exited with code ${code}`) | ||
| return new Error(`Ripgrep process exited with code ${code}`) | ||
| } | ||
| return new Error() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some message for this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't throw error when the code equal to 0 and 1(no matching), removed this error.
|
|
||
| // If updates is provided, write the processed output | ||
| if (updates) { | ||
| updates.write('\n\nGreped Results:\n\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this? Or are we planning to show this in the UI?
This was only a potential performance optimization. Remove it since it prevents tryExecute from working with vscode-defined commands (which are not found in `this.resources`).
## Problem
"memory threshold" message logged multiple times for a the same PID:
2025-04-11 ... Process 23662 exceeded memory threshold: 506986496
2025-04-11 ... Process 23662 exceeded memory threshold: 507019264
2025-04-11 ... Process 23662 exceeded memory threshold: 507052032
2025-04-11 ... Process 23662 exceeded memory threshold: 507084800
This is noisy in the logs.
## Solution
Only log "memory threshold" once per PID.
## Problem Missing the following UI elements: - Pair programmer mode toggle message - ExecuteBash confirmation direction ## Solution Make use of the new directive message type introduced in aws/mynah-ui#273 --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
## Problem - Set valid tooluse Input when parsing fails ## Solution - Server side cannot handle the raw string --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
…7008) We should ask for consensus tools accessing files/dirs outside of workspace Add validation step when accessing files/dirs outside of workspace using fsRead or listDirectories tools. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
## Problem Padding override is not needed anymore ## Solution Revert padding change since it looks like it was already fixed in mynah-ui --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
…pec for fsRead and fsWrite
This was only a potential performance optimization. Remove it since it prevents tryExecute from working with vscode-defined commands (which are not found in `this.resources`).
## Problem
"memory threshold" message logged multiple times for a the same PID:
2025-04-11 ... Process 23662 exceeded memory threshold: 506986496
2025-04-11 ... Process 23662 exceeded memory threshold: 507019264
2025-04-11 ... Process 23662 exceeded memory threshold: 507052032
2025-04-11 ... Process 23662 exceeded memory threshold: 507084800
This is noisy in the logs.
## Solution
Only log "memory threshold" once per PID.
### Problem: We identified and fixed an issue where the IDE's UI would prematurely stop displaying when executing certain commands. This occurred specifically when the Language Model (LLM) attempted to run the executeBash command before the Read/List Directory tools. ### Example: When a user asks "write a script that tells me whoami", the operation only requires the fsWrite command and not any directory reading tools. In such cases, the IDE would execute fsWrite but fail to display the executeBash tool in the chat interface. This[ UI behavior has been corrected ](https://github.com/aws/aws-toolkit-vscode/blob/2028754f3d933909f86bb65f18f06dab526d2708/packages/core/src/codewhispererChat/tools/chatStream.ts#L43-L47)in this PR, along with improvements to the Reading File user experience. - Major changes lies in this [commit](https://github.com/aws/aws-toolkit-vscode/blob/2028754f3d933909f86bb65f18f06dab526d2708/packages/core/src/codewhispererChat/tools/chatStream.ts#L43-L47) in `ChatStream.ts` ``` // For FsRead and ListDirectory tools If messageIdToUpdate is undefined, we need to first create an empty message with messageId so it can be updated later if (isReadorList && !messageIdToUpdate) { this.messenger.sendInitialToolMessage(tabID, triggerID, toolUse?.toolUseId) } else { this.messenger.sendInitalStream(tabID, triggerID) } ``` --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1. Implemented the tool using https://github.com/microsoft/vscode-ripgrep. 2. The grepped result show as clickable file path. 3. The tool currently is disable in current pr, once grepSearch tool tested, will update the tool_index.json to enable this tool.
Problem
Solution
feature/xbranches will not be squash-merged at release time.