aws / aws/amazon-q-developer-cli

bug: Multiple issues with Amazon Q CLI: fs_write errors and inefficient file search operations

Aperta
#2,011 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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

### Operating system

Linux (Ubuntu/Debian-based distribution)

### Expected behaviour

Describe the bug
I'm encountering two issues when using Amazon Q CLI:

Frequent errors when trying to use the fs_write tool:
Amazon Q is having trouble responding right now:
0: failed to print tool, fs_write: No such file or directory (os error 2)
Location:
crates/chat-cli/src/cli/chat/mod.rs:1012

Inefficient file search: Amazon Q uses file enumeration instead of system search commands, which significantly slows down
operations.
Regression Issue

Select this option if this issue appears to be a regression.
Expected Behavior
The fs_write tool should work reliably without "No such file or directory" errors
When searching for files, Amazon Q should use system commands (find, grep, locate, etc.) for fast searching rather than
sequential file enumeration.

### Actual behaviour

Current Behavior
When trying to modify files, fs_write errors frequently occur, forcing me to use a workaround: creating a new file and renaming
it instead of direct editing.

When searching for files, Amazon Q "thinks" for a long time, going through files one by one instead of using system search
commands. When explicitly asked to use OS commands for searching, it starts using them and finds the necessary files almost
instantly.

### Steps to reproduce

Reproduction Steps
For fs_write error:
• Ask Amazon Q to modify the contents of an existing file
• Observe the "No such file or directory" error
• Suggest a workaround (create a new file and rename it)

For search issue:
• Ask to find a file in the system without specifying to use OS commands
• Observe long waiting time
• Ask to use find/grep/locate
• Observe instant results

Possible Solution
Fix path handling in the fs_write tool for correct operation with the file system
Optimize file search algorithms, using system search commands (find, grep, locate) by default instead of sequential enumeration
Additional Information/Context
These issues significantly reduce the efficiency of working with Amazon Q CLI. Workarounds exist, but they shouldn't be necessary
for basic functionality.

CLI version used
Amazon Q CLI (latest version)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il fallimento di fs_write e ispeziona crates/chat-cli/src/cli/chat/mod.rs intorno alla riga 1012. Poi traccia il percorso di ricerca dei file utilizzato quando non viene richiesto alcun comando di ricerca dell’OS. Il lavoro è completato quando le modifiche ai file esistenti non producono più l’errore segnalato e le ricerche dei file evitano il comportamento sequenziale lento segnalato; verifica entrambi i casi di riproduzione su Ubuntu/Debian.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
cli, performance
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.