aws / aws/amazon-q-developer-cli

fs_write relative path bug - saves to wrong directory

Offen
#2,132 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
2k
Forks
439
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, fs_write zu reproduzieren, nachdem der Agent in ein Unterverzeichnis navigiert hat, indem du einen relativen Dateinamen verwendest und sowohl das vorgesehene Verzeichnis als auch dessen übergeordnetes Verzeichnis überprüfst. Verfolge, wie fs_write relative Pfade auflöst, und vergleiche den gemeldeten Speicherort mit dem tatsächlichen Speicherort der Datei; abgeschlossen ist die Aufgabe, wenn relative Pfade dem Arbeitsverzeichniskontext des Agents folgen oder der Benutzer eine genaue Rückmeldung zum Speicherort erhält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.