aws / aws/amazon-q-developer-cli

fs_write relative path bug - saves to wrong directory

Aperta
#2,132 0 commenti 0 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

macOS 15.5.0 (24F74)

### Expected behaviour

Files should save relative to agent's working directory context, or agent should get accurate feedback about actual save location.

### Actual behaviour

Agent uses fs_write with relative paths believing files save to current working directory, but files actually save to parent directory. Agent reports incorrect save locations to user.

```
[chat-transcript]
You're absolutely right, and I apologize for the confusion. This does appear to be a bug on my side. Here's what happened:

1. I used relative paths like `s3-context-for-q-cli.md` instead of absolute paths
2. I believed I was saving files to the pager-pirates directory when I was actually saving them to `/Users/robgrri/`
3. I incorrectly reported success when the files weren't saved where I intended

This is definitely worth reporting as an issue because:

**The Problem:**
- When I use relative paths with `fs_write`, the files aren't being saved relative to what I believe is my current working directory
- I'm not getting proper feedback about where files are actually being saved
- This creates a disconnect between my intended behavior an

> Can you report this issue for me?

[Tool uses: report_issue]

I've reported the issue for you. The report covers:

- **Title**: File path confusion: fs_write with relative paths saves to unexpected location
- **The actual behavior**: How I incorrectly believed files were being saved to the pager-pirates directory when they were actually saved to the parent directory
- **Steps to reproduce**: The sequence of actions that led to this confusion
- **Expected behavior**: That files should be saved where intended or I should get proper feedback about actual save locations

This should help the development team understand and fix the issue with file path handling and working directory context.
[Tool uses: none]
```

### Steps to reproduce

1. Agent navigates to subdirectory 2. Uses fs_write with relative filename 3. Reports success to intended directory 4. Files actually saved elsewhere

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo fs_write dopo che l’agente ha navigato in una sottodirectory, usando un nome file relativo e verificando sia la directory prevista sia la relativa directory padre. Traccia il modo in cui fs_write risolve i percorsi relativi e confronta la posizione di salvataggio indicata con la posizione effettiva del file; il lavoro è completo quando i percorsi relativi seguono il contesto della directory di lavoro dell’agente oppure l’utente riceve informazioni accurate sulla posizione.

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

Valutazione

Stack tecnologico
rust
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.