anomalyco / anomalyco/opencode
Drag-and-drop of a file with '?' in its name inserts a percent-encoded path that the Read tool cannot resolve (Desktop)
@Hona is already working on this.
Since Aug 15, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
In OpenCode Desktop, dragging a file whose name contains URL-reserved characters (e.g. ?) into the prompt inserts a mention with a percent-encoded path (%3F). The resolution never decodes it: the Read tool receives the encoded path and fails with "File not found" even though the file exists.
Likely root cause: encodeFilePath in packages/app/src/context/file/path.ts (introduced by #12424) percent-encodes path segments, but mention resolution does not decode them back before calling tools.
Plugins
none
OpenCode version
1.18.13
Steps to reproduce
- Create a file named
???.pngon the Desktop (/home/carole/Bureau/???.png). - In OpenCode Desktop, drag the file from the file manager into the prompt input.
- The inserted mention is
@///home/carole/Bureau/%3F%3F%3F.png(percent-encoded, with an extra leading slash). - Send a prompt such as "describe this image".
- The Read tool is invoked with
filePath: "///home/carole/Bureau/%3F%3F%3F.png"and fails: File not found.
Expected
The mention should resolve to the real filesystem path /home/carole/Bureau/???.png (percent-decoded, without the extra slash) so the file can be read.
Operating System
Debian (Linux)
Terminal
OpenCode Desktop
Related
- #12424 (origin of the encoding)
- #17488 (drag-dropped images lose their absolute path)
- #18410 (percent-encoded names resolve to the wrong file)
- #15561 (percent-encoded file URIs shown encoded)
- #31939 (feature: drag-and-drop should reference files by path)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.