aws / aws/amazon-q-developer-cli

fs_write relative path bug - saves to wrong directory

Open
#2,132 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

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

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.