fix(web,mobile): a running Read's image shows a loading frame, not "Image unavailable" #42921
Mergedshivamhwp(GitHub profile, opens in a new tab)merged 10 commits into
main fromrefs/pull/42921/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHubPushedf190607
- @@ -0,0 +107,21 @@107+ "thread",108+ "start",109+ project,110+ "Take a screenshot and look at it",111+ "--title",112+ "Pending read",113+ "--provider",114+ "pending-read-agent",115+ "--model",116+ "default",117+ "--json",118+ ]),119+ );120+ const { threadId } = JSON.parse(started.stdout) as { threadId: string };121+122+ await t3.open({ threadId });123+ await screen.getByText("Read demo/later.png", { exact: true }).waitFor({ timeout: 60_000 });124+ // Asking for the missing file fails within a second or two of the Read row showing.125+ const unavailable = await screen126+ .getByText("Image unavailable", { exact: false })127+ .waitFor({ timeout: 8_000 })
Pushedde537a1
shivamhwp(GitHub profile, opens in a new tab) closed this
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
Sign in to join this conversation.
No actionable comments were generated in the recent review.
Walkthrough
Read image entries now include a pending state. Web and mobile timelines use that state to render loading images separately from completed images. Pending assets skip URL lookup and file-backed actions. Tests cover image aggregation and the transition from a pending image to an available preview.
Changes: Read Image Preview
packages/client-runtime/src/work-log/presentation.ts,packages/client-runtime/src/work-log/presentation.test.tsapps/mobile/src/lib/threadActivity.ts,apps/mobile/src/features/threads/ThreadFeed.tsx,apps/web/src/components/chat/MessagesTimeline.logic.ts,apps/web/src/components/chat/MessagesTimeline.logic.test.ts,apps/web/src/components/chat/TimelineWorkEntryRow.tsxViewedImageobjects. Row equality compares each image’s path and pending state. Web and mobile rendering pass pending state to image components.apps/web/src/components/chat/ChatMarkdownMedia.tsx,apps/web/src/components/chat/MessagesTimeline.browser.test.tsx,scripts/scenarios/pending-read-image-shows-loading-frame.e2e.tsEstimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix · Severity of issue fixed: Low
Sequence Diagram(s)#
Suggested reviewers:
juliusmarmingeMerge Risk:
Minimal · up to
8b331The change shows a loading frame for Read images that are still being created and swaps in the image once the Read finishes. No merge-blocking issues were found.
Pre-merge checks:
4
#27946] The issue asks that a Read row show the image once the tool creates the file and the Read result arrives. The failure comes from requesting the asset URL while the Read is still pending, and …#27946Read preview failure. The core fix and the pending state are in packages/client-runtime (presentation.ts, presentation.test.ts). The web and mobile files (ChatMarkdownMe…Full details: Title check
Explanation
The title names the fix and the affected surfaces (web and mobile). It states the main change: a running Read's image shows a loading frame instead of "Image unavailable". The changeset matches this: pending-image handling in the timeline, client-runtime presentation, and the web and mobile image components, plus the server-side path lookup change.
Full details: Linked Issues check
Explanation
[
#27946] The issue asks that a Read row show the image once the tool creates the file and the Read result arrives. The failure comes from requesting the asset URL while the Read is still pending, and the failed lookup is never retried. The whole-PR diff of packages/client-runtime/src/work-log/presentation.ts (merge base to head) shows that workEntryViewedImagePath now returns null for toolLifecycleStatus "inProgress" and "failed". The path is returned once the Read completes, so the asset request runs after the file exists. workEntriesViewedImages marks a path pending only when every entry for it is in progress, and skips failed entries. Web and mobile render a loading frame for pending images and do not request the file. When the Read completes, the image becomes non-pending and the request runs. Tests cover the withheld path (presentation.test.ts) and the loading-to-image transition (MessagesTimeline.browser.test.tsx). I did not re-run the tests. The reviewed head (8b3316121b) is later than the head the PR text cites (dedb7e221c, b617a5e54e), so the test counts in the PR text may not match this head. The code diff for the core logic is still the evidence used here.Full details: Out of Scope Changes check
Explanation
The changes address the
#27946Read preview failure. The core fix and the pending state are in packages/client-runtime (presentation.ts, presentation.test.ts). The web and mobile files (ChatMarkdownMedia.tsx, MessagesTimeline*.ts(x), TimelineWorkEntryRow.tsx, ThreadFeed.tsx, threadActivity.ts) pass the pending state through rendering. They add the loading frame, its 16:9 bound, and the copy-path-only menu for pending frames. These follow directly from showing a frame while the file is absent. The scenario file is test support for the same behavior. The PR's reference to superseding#27954is a process note, not a code change. I found no change unrelated to the Read preview.Full details: Description check
Explanation
The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections. The Problem section explains the bug: a Read that runs with a screenshot shows "Image unavailable" until a later refresh. The Change section explains the no-request loading frame on web and mobile. The Scope section links
#27946and says the PR supersedes#27954. The Verification section names a scenario test that fails on main and passes on the branch, and it includes before/after screenshots and videos for web and Android. Gaps: the Scope section does not say why this is a bug fix rather than a feature, although it links an issue that shows the bug. The description does not say which iOS or desktop checks were run, which the template asks for under Verification. It also does not say what could not be checked, beyond stating that iOS and desktop were not run separately. The author attribution is present at the end. The core template requirements are met.Finishing Touches
Generate unit tests (beta)
a3a6463e-e912-44a1-82f0-7db3956f298fReviewing files that changed from the base of the PR and between f190607f5147429b9eca0082e187b41175974ebe and 8b3316121bea7cdaf052561b5c0c0ae79ce67ebe.
scripts/scenarios/pending-read-image-shows-loading-frame.e2e.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.