Skip to content

[Bug]: Files sidebar cannot preview images outside the workspace #21067

Closed

Description

@trahane

Before submitting

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

Area

apps/web

Steps to reproduce

  1. Start T3 Code with a project whose workspace is separate from /tmp/screenshots.
  2. Save a valid PNG at /tmp/screenshots/example.png.
  3. In an existing, persisted conversation, have the agent return the Markdown folder link [screenshots](/tmp/screenshots/).
  4. Open that folder link, then select example.png in the Files sidebar.

Selecting the PNG from the folder is significant: opening a direct image link uses the expanded image viewer, which already works.

Expected behavior

The Files sidebar displays the PNG, as the direct image viewer does.

Actual behavior

The image area shows Unable to load workspace image. The PNG exists and is readable. Images inside the project workspace render successfully.

Impact

Major degradation or frequent failure: screenshots and other generated images saved outside the workspace cannot be inspected through the folder/Files sidebar workflow.

Version or commit

Reproduced on upstream main at 16918b57d6754d6f145e9b6367c825aa31a740da.

Environment

macOS 26.5.2 (25F84), upstream web development app rendered in t3code's Chromium Browser panel, isolated development state. The reproduction uses an existing conversation. The failure is in file-preview routing and does not depend on the provider.

Logs or stack traces

Visible error: Unable to load workspace image.

Tracing the request shows that WorkspaceImagePreview requests a workspace-file resource for the absolute external path. The workspace containment check rejects it with AssetWorkspacePathValidationError. The existing media-file resource supports the same file with its existing authorization and exact-file asset token checks.

Screenshots, recordings, or supporting files

Before the fix:

Files sidebar fails to preview an external PNG

Proposed fix: #21064. That PR includes a matching after screenshot, regression tests, and verification that workspace images and draft previews still work. This report covers the external-image sidebar failure; HTML dependency serving is a separate concern.

Workaround

Open a direct image link in the expanded image viewer, or save the image inside the project workspace.

Activity

  1. juliusmarminge commented on Oct 22, 2026

    @juliusmarminge
    Member

    Reproduced on current main b5a226e49c in the Linux web dev app, Chromium Browser panel, 1280×800, isolated state with a persisted assistant folder link.

    Opened [screenshots](/tmp/screenshots/), then selected a readable 480×240 PNG. Files shows Unable to load workspace image. Runtime trace reports AssetWorkspacePathValidationError: Workspace file path must be relative to the project root. Opening the direct image link loads that same PNG at its correct dimensions.

    No duplicate of this Files-sidebar symptom found among 948 open issues. This is an ordinary bug under the vulnerability-only rule; no exploitable vulnerability is reported. Existing proposed fix #21064 remains open. Leaving the issue open for maintainer handling: changing the workspace-contained versus host-media asset access path meets this triage run's permissions hard stop. No second fix PR created.

    Files sidebar failure:

    Files sidebar rejects external PNG

    Control — direct image viewer:

    Direct viewer loads the same external PNG

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