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)

Open
#42,747 0 comments 0 reactions 1 assignee View on GitHub

@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
  1. Create a file named ???.png on the Desktop (/home/carole/Bureau/???.png).
  2. In OpenCode Desktop, drag the file from the file manager into the prompt input.
  3. The inserted mention is @///home/carole/Bureau/%3F%3F%3F.png (percent-encoded, with an extra leading slash).
  4. Send a prompt such as "describe this image".
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.