anomalyco / anomalyco/opencode

Desktop: file:// markdown links are not clickable

Open
#44,902 2 comments 1 reaction 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 25, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

In OpenCode Desktop, markdown links to local files (file:///...) render as links (colored/underlined) but do not open on click. The cursor often stays a normal arrow. https:// links work fine.

Environment

  • OpenCode Desktop 1.18.18 (macOS)
  • Observed across all chat threads

Root cause

Main process only allows http:, https:, and mailto: in resolveExternalURL. Local file:// targets fall through to "blocked external target" and never reach shell.openPath.

There is already a correct path for local files:

  • resolveLocalFilePath + openLocalFileURLshell.openPath
  • IPC open-local-file / preload api.openLocalFile
  • Terminal link handler already branches on protocol === "file:" and calls openLocalFile

But window navigation policy routes all non-renderer URLs through openExternalURL only:

// setWindowOpenHandler / will-navigate
openExternalURL(url)  // file:// blocked here

Markdown <a href="file://..." target="_blank"> therefore opens via setWindowOpenHandleropenExternalURL → blocked.

Suggested fix

In main process, route local files before external open:

function openExternalURL(value) {
  if (resolveLocalFilePath(value)) {
    openLocalFileURL(value);
    return;
  }
  // existing http(s)/mailto handling
}

Optionally also allow file://localhost/... in resolveLocalFilePath (currently rejects any non-empty hostname).

Workaround for agents

Until fixed: avoid file:// markdown links; give the absolute path as plain text and tell the user to open it from Finder, or run open "/absolute/path".

Notes

A local patch applying the fix above makes file:// links open correctly on Desktop 1.18.18.

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.