aws / aws/amazon-q-developer-cli
For certain existing files, Q chat erases most of the file unintentionally (uses 'create' instead of 'str_replace')
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
### Checks
- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again
### Operating system
macOS 15.3.2 (24D81)
### Expected behaviour
While making targeted code changes, Q should only edit required lines.
### Actual behaviour
While making targeted code changes, Q currently unintentionally removes lines that are required. For example, in a 300 line file, it wanted to added 2 lines near line 30. However, the diff removed all lines after that line.
On prompting, Q corrected itself.
```
> no this is a bad change, you are removing lines that are need
I apologize for the error. You're right - using the create command would replace the entire file, which is not what we want. Let's make
a more targeted change using str_replace instead.
```
### Steps to reproduce
_No response_
### Environment
```yaml
```
Contributor guide
Assessment
This issue has not been assessed yet.