GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — browser: preview returns success for paths that don't exist or resolve only against another repo · Issue #61625 · anomalyco/opencode

browser: preview returns success for paths that don't exist or resolve only against another repo #61625

New issue
Copy link
New issue
Copy link
Closed
#63002
Closed
browser: preview returns success for paths that don't exist or resolve only against another repo#61625
#63002
Copy link

Description

@wyr26
wyr26
opened on Nov 4, 2026
Issue body actions

Summary

browser.preview returns success for a path that does not exist, and resolves relative paths only against the session's directory. An agent that previews a file from another repo it has access to (a project reference) gets a success result while the Review pane shows a missing file, so it never learns the preview failed.

Environment

  • opencode version: v2.0.21
  • OS: Darwin 23.6.0 (darwin arm64)
  • Terminal: Apple_Terminal, xterm-256color
  • Shell: /bin/zsh
  • Install/channel: latest (desktop app)
  • Active plugins: @opencode-plugins/ai-model-router, @opencode-plugins/slack-mcp

Reproduction

  1. Use a session whose working directory is repo A, with repo B configured under references in opencode.jsonc.
  2. From Code Mode, call tools.browser.preview({ path: "pkg/file.html" }), where pkg/file.html is a real file in repo B but not in repo A.
  3. Call it again with a path that does not exist anywhere ("no-such-file.html").

Expected Behavior

The tool reports that the file was not found, so the agent can correct the path. Alternatively, a relative path resolves against the reference root it came from. Either way, the tool result should reflect whether the pane could open the file.

Actual Behavior

Every call resolves successfully and returns the input path unchanged, including a path that exists nowhere:

preview({ path: "pkg/file.html" })          -> { "path": "pkg/file.html" }
preview({ path: "no-such-file.html" })      -> { "path": "no-such-file.html" }
preview({ path: "/abs/path/to/file.html" }) -> { "path": "/abs/path/to/file.html" }

The Review pane cannot resolve the first two and shows a missing-file error (reported by the user). The agent sees three successes, so it reports "opened in the Review pane" and the failure only surfaces to the user.

Additional Context

  • Reproducible consistently: 3 of 3 inputs in the same session, and the same pattern of failures across earlier sessions.
  • Workaround: pass absolute paths only. That always opens correctly, so the pane itself is fine; the problem is path resolution and the missing validation on the tool result.
  • Related open issues that do not cover this: browser: concurrent HTTP requests return empty 502 responses in desktop preview #59593 (502s from the preview server), desktop: file tree and preview pane show stale file contents after agent edits #52941 (stale contents in the preview pane). Neither is about nonexistent paths or reference-relative resolution.

Activity

  1. opencodejr commented on Nov 4, 2026

    @opencodejr
    opencodejrBot
    on Nov 4, 2026
    Contributor
    More actions

    Thanks for the detailed report. I couldn't reproduce this here because browser.preview only works inside the OpenCode Desktop app with the Review pane connected, and this sandbox can't run the desktop app.

    The code does match what you describe, both in v2.0.21 and on the current dev branch. The preview handler passes the path to the window and returns { path } straight away. It never checks that the file exists and never waits to hear whether the pane opened it, and relative paths are resolved only against the session's workspace, not against references roots. A maintainer with the desktop app will need to confirm it. Until then, absolute paths are the workaround, as you found.

    Related, but not the same problem:

    • review-pane: video preview from browser.preview not rendered until window reload (Ctrl+R) #51862: a video from browser.preview doesn't render until the window is reloaded
    • fix(gui-extensions): hold agent previews for sessions that are not on screen #53249: holding agent previews for sessions that aren't on screen
  2. r266-tech commented on Nov 6, 2026

    @r266-tech
    r266-tech
    on Nov 6, 2026
    Contributor
    More actions

    Confirmed in a real, isolated macOS desktop at dev cd47971fd (Bun 1.4.4, Electron 44.9.1), using a deterministic local provider fixture. Both missing paths return a successful path object while Review shows a navigation error. Existing workspace files and absolute reference paths display correctly.

    The tested patch checks the server-local regular file before dispatch. In a separate patched desktop, both missing paths report ENOENT and valid previews still display. File URLs and line suffixes remain supported. Paths retain workspace-relative or absolute semantics; success still acknowledges dispatch, without waiting for pane loading.

    The regression fails on the base. Local validation: 40 browser test runs, 89 plugin tests, and the repository lint/typechecks pass. My three existing open PRs still occupy the submission slots, so the patch is available on preview-file-check in the meantime.

    AI-assisted verification and implementation.

  3. Hona
    added a commit that references this issue on Nov 12, 2026

    fix(browser): fail preview for a missing file and name the file when …

    3b37615
  4. Hona
    closed this as completedin #63002on Nov 20, 2026
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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.