Skip to content

[Bug]: HTML file preview can't load its own images or audio: none outside the workspace, and no audio or video inside it #32060

Open

Description

@workshop22

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Windows desktop app with the server in WSL2. A thread's workspace is /home/me/project. Agents make HTML review pages that sit next to their media:

/mnt/d/review/tyre-sounds/index.html        <audio src="road-1.wav">  (same folder)
/mnt/d/review/depth-options/index.html      <img src="media/depth-0.png">  (subfolder)
  1. An agent links a page by absolute path, e.g. [tyre sounds](/mnt/d/review/tyre-sounds/index.html), and the user clicks it.
  2. Copy the same folders into the workspace, e.g. /home/me/project/review/tyre-sounds/index.html, and open that page.

Expected behavior

The page loads files from its own folder and its subfolders, as it does when the same folder is served over HTTP (python3 -m http.server): images, audio and video.

Actual behavior

  1. Outside the workspace (absolute path): the page renders, but no images or audio load. The audio players appear but don't play.
  2. Inside the workspace: images, CSS, JS and fonts load. Audio and video still don't.

The same two pages work in the preview pane when served over HTTP: all 12 audio elements reach readyState 4, and the images load.

Impact

Major degradation or frequent failure

Version or commit

0.1.7 (desktop T3CodeBeta/0.1.7, server 0.1.7)

Environment

Windows desktop app with the server in WSL2, Ubuntu 24.04.

Cause

Both come from src/assets/AssetAccess.ts. I read them in the bundled 0.1.7 server; I haven't checked current main.

  1. issueAssetUrl sends a media-file resource with an absolute path through finalizeAbsoluteMediaFileAsset, which issues a media-file-exact claim. In resolveAsset, that claim serves only decodedPath === path.basename(claims.filePath). Every relative subresource request under the same token returns null.
  2. Workspace HTML gets a workspace-file claim with baseRelativePath, so its subresources resolve. But they are filtered by PREVIEW_ASSET_EXTENSIONS: html, htm and pdf, plus images, CSS, JS and fonts. Audio and video (.wav, .mp3, .ogg, .m4a, .mp4, .webm) aren't in the set.

Possible fix

  • For (2), add audio and video extensions to PREVIEW_ASSET_EXTENSIONS, with range support for media, which openMediaFile already has.
  • For (1), let an absolute HTML file's token cover its own directory, with the same rules as baseRelativePath: no .. or dot segments, allowed extensions only, canonical path still under that directory. The network-path rejection should still apply.

Workaround

Embed each image, video or sound directly in the chat message, or serve the folder over HTTP and open it in the preview pane.

Related: #16365 (Windows drive paths under WSL), #20887 (relative links from HTML in the mobile file tree, closed).

Investigated with Claude Code, Opus 5.5.

Activity

  1. don4of4 commented on Nov 28, 2026

    @don4of4

    Same bug on macOS, on a released build, viewed through T3 Connect from a mobile device.

    Setup: macOS desktop app, T3 Code (Beta) 0.1.9. An agent in a worktree thread wrote a review gallery to a folder outside the worktree (~/Claude/<gallery>/index.html with <img loading="lazy" src="images/<section>/<shot>.jpg">, about 1,700 images) and linked the page by absolute path. I opened the link on a mobile device through the managed relay (prod-….t3coderelay.com).

    Result: the page's text and layout render, and every image is a broken-image icon. Same cause as described above: the page gets a media-file-exact token, so /api/assets/<token>/images/...jpg fails the decodedPath !== path.basename(claims.filePath) check and returns 404. The relay isn't involved; it serves the same asset route.

    Still present: I checked apps/server/src/assets/AssetAccess.ts at v0.1.13 and at nightly 0.1.14-nightly.20261128.5372 (9ceb8bfbecd0); the exact-file check is unchanged. For a page with this many images, the practical workaround is to copy the folder inside the workspace. A symlink into the worktree doesn't help, because since #44381 it gets an exact-file grant too.

    Why it matters: agents routinely produce image-heavy HTML review pages in a folder outside the repo, and I review them on a mobile device over T3 Connect. html_render can't take them either (a 140 MiB page with images inlined versus the 25 MiB limit).

    #32085 looks like the right fix; its notes say macOS wasn't tested.

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