-
Notifications
You must be signed in to change notification settings - Fork 2k
ACP writeTextFile fails with "invalid path" when target file does not exist #2294
Copy link
Copy link
Closed
Labels
status/needs-triageIssue needs to be triaged and labeledIssue needs to be triaged and labeledtype/bugSomething isn't working as expectedSomething isn't working as expected
Description
What happened?
When using ACP's writeTextFile to write to a file path that does not yet exist (i.e., creating a new file), the operation fails with an "invalid path" error instead of creating the file.
The CLI sends a writeTextFile request via ACP protocol to the IDE companion. If the target file does not exist on disk, the request is rejected with an error containing "invalid path" in the data or message field, preventing new file creation.
This means ACP writeTextFile can only overwrite existing files but cannot create new ones.
What did you expect to happen?
writeTextFile should create the file (and any missing parent directories) when the target path does not exist, similar to how the local filesystem fallback behaves using fs.mkdir(recursive) + fs.writeFile.
Client information
Client Information
- OS: Darwin 24.1.0 arm64
- Node: v22.22.0
- VSCode: 1.111.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status/needs-triageIssue needs to be triaged and labeledIssue needs to be triaged and labeledtype/bugSomething isn't working as expectedSomething isn't working as expected