You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: local Markdown file links are sent to the HTTP-only browser opener #54816
Clicking a local-file Markdown link in an assistant reply fails with:
Only http and https links can be opened in the browser: /Users//workspace/.opencode/plan/example.md
The file exists. OpenCode is running in Cursor’s integrated terminal, where Cmd-click on other file references opens them in the editor.
Expected: local-file links should open in the editor or an appropriate file viewer rather than being passed to the browser opener.
Inspection of the installed executable shows that the transcript’s link-click handler calls a browser-opening function that rejects anything except HTTP/HTTPS URLs. No local-file link-routing setting was found in the CLI documentation.
Plugins
Local plan-write plugin, which saves Markdown plans. No custom TUI plugin. Behavior without the plugin has not been tested.
OpenCode version
2.0.27, installed through Homebrew (opencode-v2).
Steps to reproduce
Run OpenCode in an IDE’s integrated terminal.
Have an assistant response contain a Markdown link to an existing local file, such as plan.
Click/Cmd-click the link.
Observe the HTTP/HTTPS-only error instead of the file opening.
Screenshot and/or share link
No response
Operating System
macOS 27.0, Darwin 27.0.0, arm64. Shell: /bin/zsh.
Thanks for the detailed report! I was able to reproduce this on 2.0.27, and it still happens on the latest dev (bcf23b6).
Steps:
The assistant replies with a Markdown link to an existing local file, e.g. [MYPLANLINK](/tmp/example.md).
Click the link text in the transcript.
A toast appears: Only http and https links can be opened in the browser: /tmp/example.md, and nothing opens.
The TUI passes every clicked transcript link to a browser opener that deliberately accepts only http/https, so local paths always fail. I couldn't simulate Cmd-click inside Cursor specifically. However, the click handler only leaves Ctrl, Alt and Shift clicks to the terminal, not Cmd, so Cmd-click likely goes through the same path.
The recording and screenshot below show it, and the script below reproduces it.
Related: #47765 (opening files from chat in external apps) and #37891 / #44902 (file links in the desktop app).
recording.mp4
Reproduction script (drive.ts)
// Repro for anomalyco/opencode#54816: clicking a Markdown link to a local file in the TUI// transcript shows "Only http and https links can be opened in the browser: <path>".import{writeFileSync}from"node:fs"import{Effect}from"effect"import{Llm,OpenCodeDriver}from"opencode-drive"writeFileSync("/tmp/example.md","# Example plan\n")// the linked file existsexportdefaultOpenCodeDriver.use({
...(process.env.OC_DEV ? {opencode: {dev: process.env.OC_DEV}} : {}),project: {git: true,files: {"plan/example.md": "# Example plan\n"}},tui: {recording: true,pointerOverlay: true},},({ ui, llm })=>Effect.gen(function*(){// The file exists in the project; link to it with an absolute path.yield*llm.queue(Llm.text("Saved the plan: [MYPLANLINK](/tmp/example.md) done."))yield*ui.submit("Write a plan")yield*ui.waitFor("MYPLANLINK")yield*Effect.sleep(500)// Locate the link text on screen.constframe=yield*ui.capture()letpos: {x: number;y: number}|undefinedframe.lines.forEach((line,y)=>{consttext=line.spans.map((s)=>s.text).join("")constx=text.indexOf("MYPLANLINK")if(x>=0&&!pos)pos={x: x+3, y }})if(!pos)returnyield*Effect.die("link not found on screen")yield*Effect.log(`clicking link at ${pos.x},${pos.y}`)yield*ui.mouse({action: "move", ...pos})yield*ui.mouse({action: "down", ...pos,button: "left"})yield*ui.mouse({action: "up", ...pos,button: "left"})yield*ui.waitFor("Only http and https links can be opened",{timeout: 5000})yield*Effect.sleep(1500)yield*ui.screenshot("error-toast")yield*Effect.log("REPRODUCED: HTTP-only error toast shown for local file link")}),)
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
Activity
opencode-agent commentedon Oct 12, 2026
Thanks for the detailed report! I was able to reproduce this on 2.0.27, and it still happens on the latest
dev(bcf23b6).Steps:
[MYPLANLINK](/tmp/example.md).Only http and https links can be opened in the browser: /tmp/example.md, and nothing opens.The TUI passes every clicked transcript link to a browser opener that deliberately accepts only http/https, so local paths always fail. I couldn't simulate Cmd-click inside Cursor specifically. However, the click handler only leaves Ctrl, Alt and Shift clicks to the terminal, not Cmd, so Cmd-click likely goes through the same path.
The recording and screenshot below show it, and the script below reproduces it.
Related: #47765 (opening files from chat in external apps) and #37891 / #44902 (file links in the desktop app).
recording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.YidaWeng commentedon Oct 12, 2026
I'll take this — routing local absolute paths and
file://transcript links through the local file opener instead of the HTTP-only browser opener.YidaWeng commentedon Oct 12, 2026
PR is up: #54838
avvlas commentedon Nov 10, 2026
Was just thinking of doing this exact fix, would love to see this shipped!