Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): omit failed image reads from viewed-image previews #42265

MergedLuzivog(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/42265/headmerged by juliusmarminge View on GitHub

Problem

Claude and ACP adapters tag viewedImagePath on Read tool items targeting image paths even when the read fails (for example, when the file does not exist). Because workEntryViewedImagePath in packages/client-runtime/src/work-log/presentation.ts does not check toolLifecycleStatus, the UI renders an Image unavailable card in both the collapsed work-log image strip and the expanded failed Read row, pushing down the tool's actual error text (Error: File does not exist.).

Change

  • Return null from workEntryViewedImagePath when entry.toolLifecycleStatus === "failed".
  • Because web (MessagesTimeline.logic.ts, TimelineWorkGroupRows.tsx, TimelineWorkEntryRow.tsx), desktop, and mobile (threadActivity.ts, thread-work-log.tsx) all derive viewed-image previews through workEntryViewedImagePath / workEntriesViewedImagePaths, failed image reads drop their broken image cards across clients while the expanded row keeps displaying the target path and tool error output.
  • Kept strictly to the workEntryViewedImagePath guard requested on #38219 (no workEntryReadOutput change and no unexercised "declined" status branch, since both web and mobile map failed reads to "failed").

Scope

Fixes pingdotgg/t3code#38206. Cleanly replaces stalled #38219 with the minimal scope requested in https://github.com/pingdotgg/t3code/pull/38219#issuecomment-6956799748.

Verification

  • How the bug was found: Hit live on Antigravity (ACP) when speculative Read calls against missing .jpg paths failed (status: "failed", output: "file does not exist"), triggering AssetWorkspaceAssetNotFoundError and rendering Image unavailable cards in the work-log strip.
  • Unit tests (failed before fix, passed after):
    • packages/client-runtime/src/work-log/presentation.test.ts: failed before the fix (expected '/repo/missing.png' to be null), passes after (21 passed).
    • apps/web/src/components/chat/MessagesTimeline.logic.test.ts: failed before the fix (viewed-images row included /repo/docs/missing.png), passes after (122 passed).
    • vp run check:changed: format, lint, knip, typecheck (7 packages), and test (2 files, 143 tests) all pass.
  • Real-app before/after proof (vp run scenarios:prove against main): Ran a deterministic local ACP agent reading one existing synthetic PNG (assets/chart-ok.png) and one nonexistent PNG (assets/chart-missing.png) in the real web app (Chromium headless, Linux).
    • Base (90e6e3e69d): fails with 2 Image unavailable cards (one in the collapsed Read 2 files strip, one inside the expanded Read demo/assets/chart-missing.png row above the error text).
    • Head (e724afca21): passes with 0 Image unavailable cards; chart-ok.png still renders in the strip and expanding the failed row shows the path and Error: File does not exist. cleanly.
  • Not checked: Mobile native runtime was not launched; mobile shares workEntryViewedImagePath and workEntriesViewedImagePaths from packages/client-runtime and already renders tool error output text on expanded rows.
ViewBefore (main, 90e6e3e69d)After (e724afca21)
Collapsed work-log stripBefore: collapsed strip shows Image unavailable for chart-missing.pngAfter: collapsed strip shows only chart-ok.png
Expanded failed Read rowBefore: expanded failed Read shows a second Image unavailable cardAfter: expanded failed Read shows only path and error output

Written and verified by Gemini 4 Neon in Antigravity (via T3 Code).

    1. Pushedd19f2e8

    2. Evidence

      Replay a failed PNG Read and a successful PNG Read in one turn, then expand the work log, Read group, and failed row. Web, Chromium, light theme, 1440×1100, fresh synthetic state on each commit.

      BeforeAfter
      4c2e2b3734d19f2e8fa0
      Before: two misleading unavailable-image cardsAfter: failed previews removed, error and successful preview retained
      Before recordingAfter recording

      Base shows two Image unavailable cards; head shows zero. The missing-file path and ENOENT output remain, and the successful purple PNG still previews.

      Scenario and replay driver

      Not shown:

      • Live Claude execution and the desktop shell were not exercised; the scenario replayed equivalent Read lifecycle events through the real server and web client.
    3. juliusmarminge added labelstakeover:ready

    4. juliusmarminge removed labelstakeover:in-progress

    5. juliusmarminge merged thisff7d03d

    6. juliusmarminge closed this

    7. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.