Commit 6f0dc14
authored
fix(amazonq): Do not include references in request history (#7105)
## Problem
- We currently include codeReferences as part of the history field in
the request which can sometimes cause validation issues
- `fsWrite` tool tends to favor doing line-by-line replaces which causes
an increase in latency.
## Solution
- Do not include references in request history
- Updated the tool spec to add an important guideline around the fsWrite
tool usage - restricting strReplace command to only simple single-line
replacements, while recommending the create command for multi-line
edits.:
`* IMPORTANT: For the `fsWrite` tool, only use the `strReplace` command
for simple, isolated single-line replacements. If you are editing
multiple lines, always prefer the `create` command and replace the
entire file content instead.`
## Testing
#### Fields included in request history:
```
history: [
{
userInputMessage: {
content: 'What is aws cloudwatch in 5 sentences?',
userIntent: undefined,
origin: 'IDE',
userInputMessageContext: { toolResults: undefined }
}
},
{
assistantResponseMessage: {
messageId: 'fa3ecd66-9271-4f9b-9ee2-13b80bd65df9',
content: 'AWS CloudWatch is a monitoring and observability service that provides real-time monitoring of AWS resources and applications running on AWS infrastructure. It collects and tracks metrics, monitors log files, sets alarms, and automatically reacts to changes in your AWS resources. CloudWatch enables you to gain system-wide visibility into resource utilization, application performance, and operational health. With CloudWatch, you can detect anomalous behavior in your environments, set alarms, visualize logs and metrics side by side, take automated actions, troubleshoot issues, and discover insights to keep your applications running smoothly.',
toolUses: []
}
}
]
```
#### Latency test results
| | Build with strReplace | Build without strReplace |
| -------- | ------- | ------- |
| renaming a single function | 16s | 17s |
| translate comments (multi-line replace +19 -20) | 98s | 20s |
---
- 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 parent f6a4e20 commit 6f0dc14
2 files changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
0 commit comments