aws / aws/amazon-q-developer-cli

Q chat edits and deletes files without being instructed to

Open
#2,212 0 comments 0 reactions 0 assignees View on GitHub
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 14.7.5 (23H527)

### Expected behaviour

Given an instruction to add logic to code, amazon q should not do edits such as changing file names and deleting files.

### Actual behaviour

q chat made unasked for changes to code, including deleting files, changing file names, changing imports, changing variable names, despite only being instructed to add logic.
Context: during the session a few files were created.
I edited the files manually, and changed some of the names.
In following asks to change the logic in specific functions, amazon q kept reverting the code to the way it was before my manual changes, including deleting some of the existing files at some point. At the same time, it reported that the changes I asked for were done as requested.
I kept asking it re-read the files and it didn't help, some of the same changes were done again and again.

I think the issue could be that q retains the code it generated or read in the first iteration, and does not replace it with changes made later on.
Another issue is that when asked to perform specific changes, it also does other changes on the fly without being asked to do them. It should be more selective about changes, and only do the ones the user actually asked for, not all possible changes.

### Steps to reproduce

### Environment

```yaml

[q-details]
version = "1.12.1"
hash = "a1adeaf5df9e144dcfa0bac728de942891254df0"
date = "2025-06-18T00:46:00.699098Z (15d ago)"

[system-info]
os = "macOS 14.7.5 (23H527)"
chip = "Apple M1 Pro"
total-cores = 8
memory = "32.00 GB"

[environment]
cwd = "/Users/USER"
cli-path = "/Users/USER"
install-method = "unknown"

[env-vars]
PATH = "/Users/USER/.pyenv/plugins/pyenv-virtualenv/shims:/Users/USER/.pyenv/shims:/Users/USER/.pyenv/bin:/opt/homebrew/opt/mysql-client@8.0/bin:/Users/USER/.docker/bin:/Users/USER/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/anaconda3/bin:/opt/anaconda3/condabin:/Users/USER/.pyenv/plugins/pyenv-virtualenv/shims:/Users/USER/.pyenv/bin:/opt/homebrew/opt/mysql-client@8.0/bin:/Users/USER/.docker/bin:/Users/USER/.local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/munki"
QTERM_SESSION_ID = "fac9660c41984691ba6cccb219e3f0dc"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.7.3"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.apple.Terminal"

[chat-settings]
interactive=true

[chat-trusted_tools]

[chat-failed_request_ids]
none

[chat-context]
current_profile=default
profiles=
default

global_context=
.amazonq/rules/**/*.md
README.md
AmazonQ.md

profile_context=
.
~/dev/mdm
~/dev/bod-ui
~/dev/commongwt

files=none
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.