Skip to content

Conversation

@grl-wang
Copy link
Contributor

Problem

Adding the grep search tool.

Solution

  • Implemented the tool using https://github.com/microsoft/vscode-ripgrep.
  • The grepped result show as clickable file path.
  • The tool currently is disable in current pr, once grepSearch tool tested, will update the tool_index.json to enable this tool.

  • 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.

aws-toolkit-automation and others added 30 commits March 19, 2025 00:51
feat(chat):Added chat history storage to the Q chat for agentic chat
feat(chat): Updated model for Q Agnetic Chat APIs.
## Problem
Amazon Q Agentic Chat needs the ability to read files and directories
from the user's workspace to provide context-aware assistance.
Currently, there's no tool available for Amazon Q to access the file
system in a controlled and secure manner.

## Solution
- Implemented a new fsRead tool that allows Amazon Q to:
- Read entire files or specific line ranges
- List directory contents with configurable depth
- Handle error cases gracefully with informative messages
- Enforce size limits (30KB) to prevent excessive memory usage


## Testing

```
FsRead Unit Tests
extensionHostProcess.js:178
    ✔ reads entire file
extensionHostProcess.js:178
    ✔ reads partial lines of a file
extensionHostProcess.js:178
    ✔ lists directory contents up to depth = 1
extensionHostProcess.js:178
    ✔ throws error if path does not exist
extensionHostProcess.js:178
    ✔ throws error if content exceeds 30KB
extensionHostProcess.js:178
    ✔ invalid line range
```

---

- 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.
feat(chat): Add validate method to fsRead tool
feat(chat): add fsWrite tool create command
## Problem
Setting up new Q Agentic Chat loop with tool use.

## Solution
Initial Agentic Chat loop Setup with tool use

---

- 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.
feat(chat): add fsWrite tool commands
feat(amazonq): Adding openDiff and acceptDiff UX to the agentic chat.
feat(chat): Add executeBash tool for Amazon Q Agentic Chat
feat(chat): fix for q agentic chat loop
grl-wang and others added 26 commits April 10, 2025 15:22
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

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)

## Problem
We should ask for consensus tools accessing files/dirs outside of
workspace

## Solution
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.
fix(chat): Reduce maxToolResponseSize from 800K to 200K
### 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.
## 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.
## Problem
We need to switch to using the Chat History DB instead of the local
store

## Solution
- Add the same history fixing functionality to Chat History DB as the
former chatHistory local store
- Replace all uses of the local store
- Maintain a sessionId/ConversationId for each tab

## Tested manually
---

- 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.
@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@justinmk3
Copy link
Contributor

this is targeting master branch, I assume #7021 replaces this.

Note: you can change the target branch by clicking Edit near the PR title.
image

@justinmk3 justinmk3 closed this Apr 14, 2025
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.