fix(client-runtime): Read image previews load once the Read finishes #27954
main fromrefs/pull/27954/head·opened View on GitHubProblem#
A Claude Read row's image preview stays on "Image unavailable" when the file it reads is created by another tool call in the same message. The preview URL is requested from the Read's input path while the call is still running, before the file exists, and the client's asset URL cache keeps that failure after the Read completes. Only a page reload brings the image back.
Reproduced on main (80a2351fcb) in the web dev server with Claude Haiku 5.5: one message with Bash: python3 -c 'import time; time.sleep(40)' && convert … later3.png and Read later3.png. The Read row was expanded while pending. After the file was written and the model answered from the image, the row still said "Image unavailable · later3.png".
Change#
workEntryViewedImagePath (shared by web and mobile) returns no preview path while the entry's toolLifecycleStatus is inProgress. The preview URL is first requested once the Read has finished, when the file exists. Completed, failed, declined and stopped Reads behave as before.
Scope and approval#
Fixes pingdotgg/t3code#27946
Verification#
vp test run packages/client-runtime/src/work-log/presentation.test.ts: the new testworkEntryViewedImagePath > withholds a Read's image preview until the Read has finishedfails on main (expected '/repo/out/later3.png' to be null) and passes with the fix (21/21).vp run check:changed: format, lint, knip, typecheck (7 packages) and tests pass.- Real app (web dev server, fresh database, Claude Haiku 5.5, 1280×800, light theme). The same scripted turn ran on both sides: a 40 s delayed Bash write plus a parallel Read of that file. The Read row was opened while pending, and again after the turn finished.
| State | Before (main 80a2351fcb) | After (f9e4eae7d7) |
|---|---|---|
| Read pending | Row expandable; preview shows "Image unavailable" (file not written yet) | repro4-fix-pending.png: row shows the path only, no preview requested |
| Read finished, row reopened, no reload | repro3-main-after-complete.png: "Image unavailable · later3.png" | repro4-fix-after-complete.png: the 320×200 image renders |
The captures are attached below. Diff images are omitted: before and after are separate live provider runs (different thread, colour and timing), so a pixel diff only shows the different content. Other checks on main: expanding the row only after the turn finished showed the image (repro1-main-expand-after.png), and a page reload brought the image back.
Not checked: mobile was not captured on a device. It calls the same workEntryViewedImagePath (thread-work-log.tsx) and maps pending, running and waiting Reads to inProgress the same way as web (threadActivity.ts). Desktop uses the web renderer.
Model and harness: Claude Opus 5.5 (lead, test, fix, review) and GPT-6.1 Sol (review) via T3 Code.
🤖 Generated with Claude Code
Takeover#
Taken over from @juliusmarminge. No code changes; evidence and verification added below. The captures below replace the "Diff images are omitted" and "mobile was not captured" notes above: diffs are now included, and iOS is captured.
Evidence#
Before 80a2351 (merge-base), after f9e4eae (head). Each side runs its own real app on a fresh database (T3CODE_DEV_SEED=0), seeded by the same driver with real Claude Haiku 5.5 turns: a Bash call gated to write race.png later, and a parallel Read race.png, with the Read row opened while pending.
Environment: web Chrome 156 / Linux, no device emulation, DPR 2, 1280×800 light, 390×844 dark, 1440×900 dark. Native: iPhone 17 Pro simulator (pool), iOS 27.2, 402×874, DPR 3, font scale 1, dark. Diff0 amplifies every pixel with max RGB delta > 0; DiffT uses > 16.
| State, viewport, theme | Before 80a2351 | After f9e4eae | Diff0 | DiffT |
|---|---|---|---|---|
| R01 Read pending, web 1280 light | ![]() | ![]() | ![]() | ![]() |
| R02 Read finished, reopened, web 1280 light | ![]() | ![]() | ![]() | ![]() |
| R01 Read pending, web 390 dark | ![]() | ![]() | ![]() | ![]() |
| R02 Read finished, reopened, web 390 dark | ![]() | ![]() | ![]() | ![]() |
| R01 Read pending, web 1440 dark | ![]() | ![]() | ![]() | ![]() |
| R02 Read finished, reopened, web 1440 dark | ![]() | ![]() | ![]() | ![]() |
| R01 Read pending, iOS dark | ![]() | ![]() | ![]() | ![]() |
| R02 Read finished, reopened, iOS dark | ![]() | ![]() | ![]() | ![]() |
| R04 existing image, its Read pending, iOS dark | ![]() | ![]() | ![]() | ![]() |
| R04 same Read finished, iOS dark | ![]() | ![]() | ![]() | ![]() |
Recordings of the same scripted interaction on both sides (no reload anywhere):
- Web 1280 light, pending Read → file gate released → completed group reopened → preview opened and dismissed. before: 00:10 pending, "Image unavailable"; 00:45 completed, still "Image unavailable". after: 00:42 pending, path only; 02:30 inline image; 02:44 preview open; about 03:16 back inline.
- Web 390 dark, finished row reopened → preview → dismiss. before: 00:20 "Image unavailable"; 00:27 the tap opens nothing. after: 00:16 inline image; 00:31 preview open; 00:39 dismissed, inline again.
- iOS, pending light/dark → gate → reopen → tap preview → return. before: 02:20 dark pending; after completion the image area stays "Image unavailable" and the tap is a no-op. after: 00:30 light / 01:00 dark pending, path only; 01:30 inline image; 02:00 Quick Look shows the image; 02:30 back inline.
- iOS R04, image already on disk before the turn. before: 00:40 image shown while its Read is pending; 01:20 reopened image. after: 00:10 path only while pending; 00:17 image appears on completion; 00:42 reopened image. The Read's ID, status and timestamps from the server are logged beside each recording.
What else changed:
- Intended: while a Read is in progress, its row shows the path and no image area. This includes a Read of an image that already exists (R04), which now shows its image when the Read finishes instead of during it.
- Capture drift between separate real provider runs, not caused by the PR: Claude's reasoning wording and punctuation, an extra reasoning row in the 1280-light run, durations, timestamps, the iOS status-bar clock and home-indicator shade, and content reflow from the different media heights.
Matrix, drivers and remaining rows: fixture matrix · index, rounds 1–2 (R03, R05–R09 controls and harness rows) · index, round 3 · scripts: seed-race.sh, seed-native.sh, native-harness.js, settle-native.py, exact-scripts.zip (round 3).
Verification log
- Mode: evidence-only takeover round 1. No code changes, so tests and code review were not re-run. The PR's regression test
workEntryViewedImagePath > withholds a Read's image preview until the Read has finishedfails on main and passes on head (21/21), per the original verification above. - Proof audit: pass 1 derived the matrix (R01–R09). Pass 2 found gaps in R01–R08 and passed R09; an independent rebuild of R05 matched with zero pixel delta. After the second capture round, a re-check passed R03, R05–R09 and the native preview, and left R01 (clipped iOS pending still), R02 (390-wide preview round trip, timestamps) and R04 (iOS same-entry sequence) open. A third capture round produced exactly those three rows, shown above.
- Harness rows (labelled in the index): R05 shows the guard also withholds the legacy
detailimage path while pending and shows it once the Read finishes, on both web and iOS. R06 (blank or invalid candidates) is an unchanged control. R08 on iOS shows a synthetic error; a real provider error body was not reproduced. - CI: 41/41 checks green on f9e4eae, mergeable; main not merged in this round, so CI stays on the captured head.
- Runtime-captured: web and the iOS simulator. Desktop (same web renderer) and Android (same shared
workEntryViewedImagePathcall) are covered by the source only, not captured. - Model and harness: Claude Opus 5.5 (lead) and GPT-6.1 Sol (proof audit, capture) via T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelsbugfix
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.- Last reviewed commit: 7d5d8668c3902d874e4846a396c37d96309979f0
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- Resume reviews
- Trigger review
No actionable comments were generated in the recent review.
Walkthrough
-
The Read image preview path is withheld while the tool entry is in progress. Tests verify that the path is returned after the entry completes.
Changes: Read image preview
Layer / File(s) Summary Gate preview path by tool status
packages/client-runtime/src/work-log/presentation.ts,packages/client-runtime/src/work-log/presentation.test.tsworkEntryViewedImagePathreturnsnullfor an in-progress entry before checking image-path sources. A test checks the in-progress and completed Read states.Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
only21mil,t3dotgg,entrpi
Merge Risk:
Minimal · up to7d5d8-
Read image previews now load after the Read finishes instead of failing while the file is still being written. No merge-blocking risk remains.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the Read image preview fix and its timing (loads once the Read finishes), which matches the raw summary's main change: workEntryViewedImagePath returns null while a tool entry is inPro… Description check The description follows the template closely. It has Problem, Change, Scope, and Verification sections. The Problem section states the bug and reproduction steps. The Change section explains the fix i… Linked Issues check [ #27946] requires that a Read row show its image once the file exists and the Read result arrives, and that the preview not be requested while the Read is still pending. The whole-PR diff (merge base …Out of Scope Changes check The whole-PR diff changes packages/client-runtime/src/work-log/presentation.tsby two lines: a comment and theinProgressguard. The PR description reports one added focused test in `presentation.…Full details: Title check
-
Explanation
The title names the Read image preview fix and its timing (loads once the Read finishes), which matches the raw summary's main change: workEntryViewedImagePath returns null while a tool entry is inProgress. It follows the conventional commit form and stays short and specific.
Full details: Description check
-
Explanation
The description follows the template closely. It has Problem, Change, Scope, and Verification sections. The Problem section states the bug and reproduction steps. The Change section explains the fix in workEntryViewedImagePath and why web and mobile share it. The Scope section links issue
#27946and the fixed PR. The Verification section gives the focused test result (21/21, fails on main), check:changed results, and before/after captures on web and iOS. It also states what was not checked (Android, device-level desktop). The template's model and harness line is present. The 'Scope and approval' heading differs slightly from the template's 'Scope' heading, and the description includes a long takeover evidence section, but the required information is present.
Full details: Linked Issues check
-
Explanation
[
#27946] requires that a Read row show its image once the file exists and the Read result arrives, and that the preview not be requested while the Read is still pending. The whole-PR diff (merge base f313d0a6 to head 7d5d8668) adds a guard at the start ofworkEntryViewedImagePathinpackages/client-runtime/src/work-log/presentation.ts: it returnsnullwhenentry.toolLifecycleStatus === "inProgress". Other paths are unchanged, so a completed Read resolvesviewedImagePathor the read-entry detail path as before. This matches the issue's suggested fix (do not resolve the preview until the tool result arrives). The PR description reports a focused regression test that fails on main and passes on head. Captures on web and iOS show the failure pattern before the change and the image after completion. The change is shared, so the same behavior applies to web and mobile call sites. Unresolved: the guard checks onlyinProgress. The PR states that pending, running and waiting Reads map toinProgressinthreadActivity.ts, but that mapping was not re-read in this assessment. The requirement is met for the states the PR describes.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff changes
packages/client-runtime/src/work-log/presentation.tsby two lines: a comment and theinProgressguard. The PR description reports one added focused test inpresentation.test.ts(+19 lines per the change summary). Both directly implement [#27946]. The PR description also says in-progress Reads of an already existing image (R04) now show the image on completion instead of during the run. This is a consequence of the same guard and is the intended behavior. It is not an unrelated change. The takeover commits added evidence only, and the code diff is the same two lines.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt#
- Mode: Continue automatically
- Reviewed files: 1
- Charged: $0.25
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: fix/issue-27946
- File: .coderabbit.config.ts
- Commit: 7d5d866
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
9fd48110-0cba-4d8e-aa70-aad0a35629a6
Commits-
Reviewing files that changed from the base of the PR and between 0e1596696da042f1c9c4aebc36fd2e1774373bfd and 7d5d8668c3902d874e4846a396c37d96309979f0.
Files selected for processing: 1-
packages/client-runtime/src/work-log/presentation.ts
Limit details: You’ve used all 10 included reviews currently available.
-
juliusmarminge added labelspr:gate-failed
juliusmarminge removed labelspr:gate-failed
juliusmarminge added labelspr:in-progress
juliusmarminge assignedjuliusmarminge
Taking over this one
juliusmarminge removed labelspr:in-progress
juliusmarminge added labelspr:gate-failed
The automated pipeline stopped on this pull request and will not merge it:
someone else pushed to fix/issue-27946 (head is now 623dd43b33); the pipeline does not build on commits it did not review
It stays open for a person to finish or close.
The automated pipeline stopped on this pull request and will not merge it:
the capture step could not show the problem on the base commit, so there is nothing to prove fixed.
Create a project containing a Python script that waits 40 seconds and writes a valid 320x180 green PNG. Request Bash running that script and Read of the PNG's absolute path in the same assistant message, Bash first. Open the thread, expand the work-log summary and Read while the file is absent, capture the pending state, and close Read. Wait for both tools to finish successfully. Reopen the completed work log and Read without reloading, then capture the image. Base displayed Image unavailable while pending but recovered after completion; head showed only the path while pending and loaded the image after completion.
It stays open for a person to finish or close.
tanstack-source added labelsbug
juliusmarminge added labelstakeover:in-progress
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
juliusmarminge added labelstakeover:in-progress
juliusmarminge removed labelstakeover:needs-julius
The automated pipeline stopped on this pull request and will not merge it:
the fix is written and reviewed, but proving it needs something no worker has:
- Permanent blocker: the reported flow requires a working Claude thread; first-party Claude authentication is listed as unavailable on these workers. ACP replay rendered path text and was not an equivalent reproduction.
- Persistent Image unavailable on base and successful recovery on head were not demonstrated. No proof verdict can be inferred from the replay assertion failure.
It stays open for a person to finish or close.
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
Thanks for this. Main has the change since #42921.
Main now withholds a running Read's image preview until completion, preventing the premature asset lookup and cached failure; I compared this PR's complete two-file diff with the merged shared helper and regression test.
Closing as superseded.
juliusmarminge closed this
Sign in to join this conversation.








































Approvability#
Verdict: Approved at
7d5d866Macroscope's review found this PR approvable — Image previews now wait until the tool is no longer running, avoiding premature requests that can leave a cached “Image unavailable” result. The change is limited to preview timing across web and mobile and preserves existing asset restrictions.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).