VS Code extension: chat-panel link handler routes binary files through tryOpenDocument (text-only), bypassing editor associations

Resolved 💬 3 comments Opened Apr 30, 2026 by hiddenadhd Closed May 4, 2026

Summary

Markdown links in the Claude Code VS Code extension chat panel route through a text-document open path. Clicking a link to a binary file (e.g. .mp4, .png, .pdf, .zip) silently fails with no user feedback.

Repro

  1. In a Claude Code panel chat reply, render a markdown link like [render.mp4](path/to/render.mp4) (relative or absolute).
  2. Click (or Cmd+Click) the link.
  3. Nothing visible happens.

Expected

The file opens — either via VS Code's built-in viewer (e.g. the built-in Video Preview for .mp4), via a user-configured workbench.editorAssociations mapping, or via the OS default app.

Actual

DevTools console shows:

[Extension Host] rejected promise not handled within 1 second:
CodeExpectedError: cannot open file:///.../render.mp4. Detail: File seems to be binary and cannot be opened as text
    at h_e.$tryOpenDocument (vscode-file://.../workbench.desktop.main.js:1005:10890)

The link handler calls $tryOpenDocument rather than vscode.open / vscode.openWith. Because $tryOpenDocument is the text-document path, it rejects all binary content and never reaches the editor-association resolver — so installing an extension that handles .mp4 (e.g. MPEG-4 Preview) and setting workbench.editorAssociations has no effect on chat-panel link clicks. VS Code's own built-in Video Preview is also bypassed.

Impact

Users producing or referencing binary artifacts in chat (video renders, screenshots, generated PDFs) can't click through. The current workaround is right-click in the Explorer sidebar → Reveal in Finder, which defeats the point of having clickable file references in chat output.

Suggested fix

For chat-panel markdown links pointing at workspace or absolute file URIs, use vscode.commands.executeCommand('vscode.open', uri) (or vscode.openWith to honor user editor associations) instead of $tryOpenDocument. That delegates to VS Code's normal resolution chain — built-in viewers, user-configured associations, and external apps as configured.

Environment

  • VS Code (Mac, Darwin 24.6.0)
  • Claude Code VS Code extension (panel UI)
  • File: standard .mp4 (H.264) on local disk, path contains URL-encoded spaces (%20)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗