[Bug]: Read image preview shows "Image unavailable" when the file is created by a tool call in the same message #27946
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#
- 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
Readof that same path. For example,sleep 30; <write a PNG to /tmp/later.png>followed byRead /tmp/later.png. - 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):
| Time | Event |
|---|---|
| 02:11:29.510 | Bash tool_use starts. It writes …/evidence/vmA-mc-16.png after about 40 s of sleeps. |
| 02:11:29.525 | Read tool_use for the same path is emitted. |
| 02:11:34 | ws.rpc.assets.createUrl fails: AssetWorkspaceAssetNotFoundError: Media file was not found. |
| ~02:12:14 | The file is written (mtime). Valid PNG, 1280×800, 471 KB. |
| 02:12:15.008 | Bash result. |
| 02:12:15.021 | Read 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.
tanstack-source added labelsbug
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
Readcalls on the cropped files. Timeline (UTC):Time Event 14:19:15 Bash and the four Readtool_useitems arrive in one message14:19 ws.rpc.assets.createUrlfails four times:AssetWorkspaceAssetNotFoundError: Media file was not found.14:19:41 to 14:20:08 The four files are created ( statbirth time)14:20:08 Bash 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 ofcreateUrlwhen the item's status changes from pending to completed would cover this case.shivamhwp(GitHub profile, opens in a new tab) linked this to #42921
juliusmarminge linked this to #42976
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
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 scratchpadqN.pngunder/private/tmp/...) andRead qN.pngin one message. Timeline for one occurrence (local time):Read …/scratchpad/q4.pngtool_use arrivesws.rpc.assets.createUrlfails:AssetWorkspaceAssetNotFoundError: Media file was not found.q4.pngcreated (birth time = mtime)assets.createUrlcalls succeedHappened 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.