Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Read image preview shows "Image unavailable" when the file is created by a tool call in the same message #27946

Closedkevingatera(GitHub profile, opens in a new tab) opened this issue 2 comments

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. In a Claude thread, have the agent send two tool calls in one message: a Bash command that writes a PNG after a delay, then a Read of that same path. For example, sleep 30; <write a PNG to /tmp/later.png> followed by Read /tmp/later.png.
  2. Expand the Read row once the turn finishes.

Expected behavior

The Read row shows the image. The file exists by the time the Read result arrives, and the model receives it.

Actual behavior

The row shows "Image unavailable · later.png" and stays that way after the file exists.

Timeline from a real run (times in UTC):

TimeEvent
02:11:29.510Bash tool_use starts. It writes …/evidence/vmA-mc-16.png after about 40 s of sleeps.
02:11:29.525Read tool_use for the same path is emitted.
02:11:34ws.rpc.assets.createUrl fails: AssetWorkspaceAssetNotFoundError: Media file was not found.
~02:12:14The file is written (mtime). Valid PNG, 1280×800, 471 KB.
02:12:15.008Bash result.
02:12:15.021Read result: one image block. The model gets the right image.

The preview's URL is requested from the Read's input path while the call is still pending, before Claude Code has run it. The failed lookup is never retried when the result arrives. The trace shows no second createUrl failure for the row, and the row still says "Image unavailable" later.

This is related to #13138: the Read row is a live lookup of viewedImagePath, not the tool result. It is a different failure, though. Open PR #23510 keys the asset query by Read item identity, which fixes stale pixels across different Reads. As far as I can tell, it would still keep this row's failed lookup, because the item identity doesn't change when the result arrives.

Impact

Minor. The agent sees the image, but the user can't. It happens whenever an agent creates an image and reads it in the same message, which is a common pattern for screenshot loops (VM or device screenshots, browser captures).

Version or commit

0.1.6-nightly.20261030.3940

Environment

Linux host (Debian 13) running the T3 server, web client, Claude Code harness (claude-opus-5-5 lead, claude-sonnet-5-5 thread). The image path is outside the project workspace (/home/<user>/.local/state/...). It doesn't look like the Files-panel restriction in #21067: the request goes to media-file, and the error is not found, not a path validation error.

Logs or stack traces

AssetWorkspaceAssetNotFoundError: Media file was not found.
    at AssetAccess.finalizeAbsoluteMediaFileAsset (…/0.1.6-nightly.20261030.3940/t3:388954:30)
    at AssetAccess.issueAssetUrl (…/t3:411012:314)
    at ws.rpc.assets.createUrl (…/t3:404835:24)
    at server.runServerCommand (…/t3:427667:203)
span ws.rpc.assets.createUrl  rpc.aggregate=workspace  start 2026-10-31T02:11:34Z

Screenshots, recordings, or supporting files

The Read row after the turn: an empty frame with "Image unavailable · vmA-mc-16.png", over the full path and "No output."

Workaround

None verified. I haven't checked whether a page reload or a second Read in a later message brings the preview back.

Possible fix: don't resolve a Read row's preview until the tool result arrives. Or treat a not found as retryable and re-request when the row's status changes from running to completed.

  1. tanstack-source added labelsbug

  2. Still reproduces on 0.1.9 (macOS arm64, T3 Code (Beta) desktop app with local server). It also shows on the iOS app connected to the same server.

    Same pattern: Claude sends Bash (device screenshot to a scratchpad qN.png under /private/tmp/...) and Read qN.png in one message. Timeline for one occurrence (local time):

    TimeEvent
    11:33:51.8Read …/scratchpad/q4.png tool_use arrives
    11:33:51.8ws.rpc.assets.createUrl fails: AssetWorkspaceAssetNotFoundError: Media file was not found.
    11:33:58q4.png created (birth time = mtime)
    11:33:59Tool results arrive; subsequent assets.createUrl calls succeed

    Happened 3× in a row (q4, q5, q6) with the same timing. One difference from the original report: on 0.1.9 the row recovers by itself a few seconds after the file is written, so the user sees "Image unavailable · q2.png" briefly and then the image. The misleading state is the placeholder while the Read is still pending. A loading state until the Read result arrives (as in #27954) would cover it.

    Comment drafted by Claude Opus 5.5 (Claude Code) via t3 triage.

  3. Still reproduces on 0.1.12-nightly.20261123.5138 (Linux server, t3 serve --tailscale-serve, Claude Code harness, web client).

    Same pattern: one assistant message held a Bash call that renders four PNGs (headless Chrome screenshot, then ffmpeg crops, about 50 s) and four Read calls on the cropped files. Timeline (UTC):

    TimeEvent
    14:19:15Bash and the four Read tool_use items arrive in one message
    14:19ws.rpc.assets.createUrl fails four times: AssetWorkspaceAssetNotFoundError: Media file was not found.
    14:19:41 to 14:20:08The four files are created (stat birth time)
    14:20:08Bash result

    All four rows still show "Image unavailable" after the files exist.

    From the bundle: the card stores the failed src (s === v.src) and does not request a new URL when the tool result arrives. A retry of createUrl when the item's status changes from pending to completed would cover this case.

  4. juliusmarminge linked this to #42976

Sign in to join this conversation.