Skip to content

Conversation

@grl-wang
Copy link
Contributor

  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


  • 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.
  • 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.
@grl-wang grl-wang requested review from a team as code owners April 10, 2025 22:24
Comment on lines 89 to 90
const searchLocation = fsPath
? fsPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fsPath ??

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor Author

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()
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@grl-wang grl-wang changed the title Adding the grep search tool. feat(chat): Adding the grep search tool. Apr 10, 2025

// If updates is provided, write the processed output
if (updates) {
updates.write('\n\nGreped Results:\n\n')
Copy link
Contributor

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?

justinmk3 and others added 18 commits April 10, 2025 21:25
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.
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.
@grl-wang grl-wang closed this Apr 11, 2025
@grl-wang grl-wang deleted the agentic-chat branch April 11, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants