Skip to content

Conversation

@bywang56
Copy link
Contributor

Problem

We should ask for user consensus when 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.
  • 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
ctlai95 and others added 27 commits April 8, 2025 10:46
)

## Problem

Support workflows with multiple file writes without confirmation


## Solution
- Set `requiresAcceptance` to `false` for all FsWrite executions
- Store backups of each FsWrite so we can revert the changes if needed


---

- 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
Users lose all chats when they close VSCode, and there's no way to
browse through chat history. Users also cant export their conversations
to an easily shareable format.

## Solution
Automatically persist conversations to JSON files in
~/.aws/amazonq/history, one for each workspace where Amazon Q chats
occur. Add chat history and chat export buttons to top of Amazon Q
toolbar. Clicking on the chat history button allows users to browse and
search through chat history. Users click on an old conversation to open
it back up (currently open conversations are in bold). Clicking on chat
export button allows users to save chat transcript as a markdown or
html.

Note: persistence + history is only for Q Chat Tabs (not /dev, /doc,
/transform, etc.)


![Screenshot 2025-04-08 at 12 03
11 PM](https://github.com/user-attachments/assets/9b383294-5e0a-499b-a4e8-993dd73b555c)

## Note
Agentic chat does not currently use this persisted history in it's
context. Follow-up PR will address this issue.

---

- 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

Longer streaming responses are throwing ECONNRESET


## Solution

Increase the default timeout


---

- 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.
…6966)

## Problem
- after user click the reject button of running shell command, we call
LLM to get response of shell command rejection

## Solution

![image](https://github.com/user-attachments/assets/7ee4ad3f-44df-4941-80b3-c33dcbc9919f)


---

- 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
Context is shown repeatedly in the UI if it is provided.

<img width="754" alt="image"
src="https://github.com/user-attachments/assets/30f51f7c-e504-46a6-b416-9bbd9b06023e"
/>


## Solution
- Separate initial stream and context messages into separate functions
- Only show context on the first message of the loop

<img width="679" alt="image"
src="https://github.com/user-attachments/assets/aefca516-e04f-4a29-b6e4-92236acc37c8"
/>




---

- 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.
Remove static response string for shell command reject

## Problem
- Use shell icon in shell command header
- Remove static response string for shell command reject

## Solution

![image](https://github.com/user-attachments/assets/d67b87c5-b103-4b84-a9ba-e08ed457b1d4)


---

- 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.
…ge (aws#6977)

## Problem
Before we are unclear about the commands' category and sometimes we show
warning for some wide-used commands. Also we want to show the different
warning message for destructive commands and mutable commands.

## 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](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.
## Notes
- fix(chat): Improve diffView UX, changes include:
    - Remove the icon in diff view
    - Clean up temp files when accept or reject
    - Do not open the files as they generate




---

- 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
The pair-program was off by default and there was no tooltip. 

## Solution

![image](https://github.com/user-attachments/assets/47455803-056f-4f69-9eb1-7bc4eeac05e5)





---

- 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): Send back throttling error message
## Problem
Chat input prompt should be disabled during the agentic loop


## Solution
- Disable chat prompt
- Removed stop button for now


---

- 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): handle JSON.parse error gracefully
## Problem
- We show read tool message for each file read which is occupying the
entire chat with these messages which is not super important.

## Solution
- Group all the read tool messaged under ContextList.

![image](https://github.com/user-attachments/assets/194e4ca1-7645-4419-8b9b-b5ac9a58279f)



---

- 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.
…ve file (aws#6989)

## Problem
```
An error occurred while processing your request.This error is reported to the team automatically. We will attempt to fix it as soon as possible.Details: Input is too long.
```
- A bug where status code is not being populated in error message
- A bug where output log window can be considered as active file which
can cause waste of tokens
- A bug where toolUse JSON.parse is not being handled correctly

## Solution
- Prune history if it's too large
- Fix status code bug in error message
- Fix active file bug
- Fix JSON.parse handling

---

- 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.
…ws#6995)

## Problem
- fix shell command execution output markdown block issue
- When the child process of bash command execution writes to both stdout
and stderr, we need to main the output is processed in the exact order
it was generated by the child process.

## Solution
- Before this change

![image](https://github.com/user-attachments/assets/59190c23-4f0f-452b-a9bd-8efb25fd440d)

- After this change

![image](https://github.com/user-attachments/assets/e8570eb8-477b-4611-8516-d62ce57b7373)



---

- 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
- Reverting PR: aws#6975  as this is causing regression in some cases.

## 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](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
- ToolUse input is empty when parsing fails which breaks history

## Solution
- Fix toolUse input is missing when parsing fails

---

- 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
- Markdown headers are too large 
- `no-padding` from mynah-ui is not working

Before:

![image](https://github.com/user-attachments/assets/f0996f84-6ae8-4747-8e1b-d6d9ada4c213)

![image](https://github.com/user-attachments/assets/caddda94-f6d8-4bfd-9a5e-d49f0633c529)



## Solution
- Override the font size for h1-h4
- Override the padding for any card under `no-padding`

After:

![image](https://github.com/user-attachments/assets/9373ab02-2912-48fd-af2b-2a1e72375d84)

![image](https://github.com/user-attachments/assets/a606188e-0c2e-430e-b979-2187ba6c8bf6)



---

- 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
- currently no metrics for agentic chat

## Solution
Emit telemetry events when:
- message shown to user (message sent from user already exists)
- diff was generated
- user rejected diff
- command was generated
- user accepted command
- user pressed stop button
- upstreamed metric to aws-toolkit-common:
aws/aws-toolkit-common#1010

#### TODO:
- additional telemetry events for: user interrupts Q while generating,
thumbs up/down
- see when user pressed stop (ex: chat, command execution, etc)

---

- 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.
@bywang56 bywang56 requested review from a team as code owners April 10, 2025 22:17
@bywang56 bywang56 closed this Apr 10, 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.