aws / aws/amazon-q-developer-cli
Issues with fs_write when trying to modify .zshrc file
Nessuno ha ancora preso questa issue.
- Lingua principale
- Rust
- Stelle
- 2k
- Fork
- 439
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Checks
- I have searched github.com/aws/amazon-q-developer-cli/issues and there are no duplicates of my issue
- I have run
q doctorin the affected terminal session - I have run
q restartand replicated the issue again
Operating system
macOS 15.4.0 (24E248)
Expected behaviour
The fs_write function should successfully append or modify the .zshrc file to add the requested alias.
Actual behaviour
When trying to use fs_write to add an alias to the user's .zshrc file, the operation is being cancelled with "Tool use was cancelled by the user" error.
[chat-transcript]
> are you able to add an alias to my shell that when I type rider . it behaves much like code . for VS Code but instead of opening VS Code with the current directory in context it open the Rider IDE?
I can help you add an alias to your shell that opens JetBrains Rider with the current directory. Let me first check if Rider is installed on your system and find its location.
[Tool uses: execute_bash]
> y
I see Rider is installed at `/Applications/Rider.app`. Now let's determine which shell you're using so I can add the alias to the correct configuration file:
[Tool uses: execute_bash]
You're using zsh as your shell. Let's add the alias to your `.zshrc` file:
[Tool uses: fs_read]
Now I'll add the alias for Rider to your `.zshrc` file:
[Tool uses: fs_write]
Amazon Q is having trouble responding right now:
0: failed to print tool: No such file or directory (os error 2)
Location:
crates/q_cli/src/cli/chat/mod.rs:676
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
> q issue
I apologize for the error. Let me try again with a different approach to add the Rider alias to your shell configuration.
[Tool uses: fs_write]
Amazon Q is having trouble responding right now:
0: failed to print tool: No such file or directory (os error 2)
Location:
crates/q_cli/src/cli/chat/mod.rs:676
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
> q issue
I apologize for the issues with adding the alias to your shell configuration. Let me try a different approach.
[Tool uses: report_issue]
Steps to reproduce
- User asked to add a 'rider' alias to open JetBrains Rider IDE
- Attempted to use fs_write with str_replace and then with append command
- Both attempts resulted in "Tool use was cancelled by the user" error
Environment
<This will be visible to anyone. Do not include personal or sensitive information>
[q-details]
version = "1.7.3"
hash = "3e4ae79d371315e80ddac772b43fff2cba314104"
date = "2025-04-10T05:48:16.435186Z (7d ago)"
variant = "full"
[system-info]
os = "macOS 15.4.0 (24E248)"
chip = "Apple M1 Max"
total-cores = 10
memory = "32.00 GB"
[environment]
cwd = "/Users/USER/Documents/dev/playground-storybook-teller"
cli-path = "/Users/USER/Documents/dev/playground-storybook-teller"
os = "Mac"
shell-path = "/bin/zsh"
shell-version = "5.9"
terminal = "macOS"
install-method = "unknown"
[env-vars]
PATH = "/usr/local/share/dotnet:/usr/local/bin:/Users/USER/.nvm/versions/node/v23.2.0/bin:/opt/homebrew/opt/python/libexec/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.13/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:/usr/local/share/dotnet:~/.dotnet/tools:/Users/USER/.cargo/bin:/Users/USER/.local/bin:/Applications/Docker.app/Contents/Resources/bin"
QTERM_SESSION_ID = "41c3ea1aaf06413fbc7613bbe106b906"
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=none
files=
/Users/guimathe/Documents/dev/playground-storybook-teller/README.md, 1036 B
total context size=1036 B
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il fallimento di fs_write su .zshrc in una sessione zsh su macOS, quindi ispeziona la posizione segnalata in crates/q_cli/src/cli/chat/mod.rs:676 e la gestione degli errori circostante. Il lavoro è completato quando fs_write può aggiungere contenuto a .zshrc o modificarlo per l’alias richiato senza produrre l’errore di annullamento o l’errore "No such file or directory".
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust, zsh
- Ambito
- cli, operating-systems
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100