Skip to content

Desktop: clicking a conversation file link outside the workspace always fails to load #54540

Open

Description

@wqhdu

Description

Clicking a file in a conversation (e.g. a file the agent just wrote) shows "Failed to load file" whenever the file lives outside the current workspace root. Plain .md files fail as well, so this is not a preview/format issue.

Server log for such a click:

GET /api/fs/read/ http.status=404

The request URL carries only the bare filename, without any directory, so the server resolves it against the workspace root and every file outside the workspace returns 404. Previewing the same file with an absolute path through the agent's preview tool works fine, so the file itself is readable - this is purely how the Review pane resolves the link.

Related symptom: "Open in File Explorer" on the failed item opens the workspace root instead of the folder that actually contains the file.

Suggestion: resolve the link as written (absolute path, or relative to the session's working directory), and offer a fallback (reveal in folder / open with / copy path) when loading fails.

Plugins

None (default install, no plugins configured)

OpenCode version

Desktop 2.0.26 (bundled CLI 1.4.2)

Steps to reproduce

  1. Open a project whose workspace root is any folder (an empty folder is enough).
  2. Ask the agent to write a file outside it, e.g. onto the Desktop.
  3. Click that file in the conversation to preview it in the Review pane.

Result: "Failed to load file" on every click, for any file type. In one day of normal use this produced 21 logged 404s - files on the Desktop, files in other project folders, and even a repo-like token such as "mihomo-party-org/clash-party" that the UI turned into a file link.

Screenshot and/or share link

No screenshot. Evidence is the server log line quoted in the description, recorded in %USERPROFILE%.local\share\opencode\log\opencode.log on Windows.

Operating System

Windows 11 Pro for Workstations (x64)

Terminal

N/A - OpenCode Desktop app

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions