Repository navigation
fix(server): images that ACP agents read show a preview - #37468
matthewcosier wants to merge 1 commit into
Conversation
The ACP adapter built Read items without viewedImagePath, so an image read by Antigravity, Kiro, Grok, fx or an ACP Registry agent showed only its path and the agent's text result, with no thumbnail. Set it on image reads, as the Claude and Codex adapters already do.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — ACP image reads now use the existing image-preview presentation, including when agents return only text. The change is narrowly scoped and retains path-length, newline, and image-extension guards. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
When an ACP agent reads an image, the Read row in the work log shows no thumbnail. Expanding it shows only the path and the agent's text result (for Antigravity,
View front.png), and the group has no viewed-image strip. The same read in a Claude or Codex thread shows the image and opens the full-size preview on click.The ACP adapter builds Read items without
viewedImagePath. Claude (ClaudeAdapterV2.ts) and Codex (CodexAdapterV2.ts) set it, and everything downstream (projection, wire, both clients) keys only on that field. Antigravity also never returns the image bytes, only a line of text, so the field is the only way the client can find the image.Found in a real Antigravity thread. The projected Read items for the same file in an Antigravity thread and a Claude thread (paths shortened):
Change
The ACP adapter's
readcase setsviewedImagePathwhen the read path has an image extension, with the same guards as the Claude adapter (at most 4096 characters, no newline). That covers every ACP-based provider: Antigravity, Kiro, Grok, fx and the ACP Registry agents.The fidelity test's mock agent gains an image read in the shape Antigravity sends (
file_pathplus line range, text-only result). The test asserts that the image read carriesviewedImagePathand that the existing.tsread does not.Not changed: ACP subagent child threads project their tools generically (no Read title or label at all). That is a separate gap.
Scope
A small fix for an obvious bug: image previews work for Claude and Codex reads but not for ACP reads, and the field that drives them was never set on the ACP path. No issue filed.
Verification
Red with the adapter change reverted, in
projects ACP v2 fidelity updates into first-class orchestration items:Title and input already matched. Only the missing field failed.
Green:
AcpAdapterV2.test.tsandAntigravityAdapterV2.test.ts, 148 of 148 pass.vp run check:changedpasses (format, lint, knip, typecheck of 14 packages, tests).Checked by reading the code that nothing downstream depends on the provider:
ProjectionStoretreats any payload withviewedImagePathas inline work output, andclient-runtimetoolPresentationreads it with no driver check.formatToolValuehides only image-block outputs, so Antigravity's text result still shows beneath the thumbnail.Real Antigravity turns (Gemini 3.8 Flash) against
vp run dev, same prompt each time ("Open dashboard-mockup.png and describe its layout in one sentence."). The first ran with the adapter change reverted, the second with it applied. The projected Read items:Evidence
Before: the expanded Read row shows only the path and Antigravity's text result. No thumbnail, and no viewed-image strip under the group.
After: the image Antigravity read shows as a thumbnail below the tool group.
Clicking the thumbnail opens the existing full-size preview:
Made with Claude Opus 5.5 in Claude Code, running in T3 Code.