Skip to content

Antigravity: capture image reads from disk so images render in the timeline - #1225

Merged
Tryanks merged 2 commits into
Tryanks:mainfrom
ClanEver:fix/antigravity-image-reads
Dec 4, 2026
Merged

Tryanks merged 2 commits into
Tryanks:mainfrom
ClanEver:fix/antigravity-image-reads

Conversation

@EverClan

@EverClan EverClan commented Dec 4, 2026

Copy link
Copy Markdown

Problem

When Antigravity (agy 1.5.23) reads an image with read_file over ACP, the tool_call / tool_call_update frames carry only a text placeholder ("Showing binary file of type image/png") in both content and rawOutput with no ContentBlock::Image. As a result, ToolCall.image_reads stays empty and the timeline renders it as an ordinary text read instead of image tiles like Claude, Codex, OpenCode, and pi.

Likewise, Antigravity subagent steps tailed from transcript.jsonl record image results in each GENERIC step's media array ([{"mime_type": ..., "uri": "file://..."}]), which ChildStep ignored.

Changes

  • crates/agent/src/acp_session.rs: Add a default no-op Dialect::enrich_events(&self, cwd: &Path, events: &mut [AgentEvent]) async hook and State::cwd(), invoked after releasing the session state lock and before client.emit_all(events). This avoids blocking file I/O under the session lock while keeping other ACP dialects untouched.
  • crates/agent/src/antigravity.rs: Implement Antigravity::enrich_events to detect completed ToolFamily::Read calls with empty image_reads and "Showing binary file of type image/..." output, read the target file via process::unblock, and populate image_reads through tool_output::image. Non-image binaries (e.g. PDFs) and calls that already include an inline ContentBlock::Image are left untouched.
  • crates/agent/src/antigravity/subagents.rs: Parse media (mime_type, uri) on ChildStep and read local file:// image media into ToolCall.image_reads when completing GENERIC steps.

Tests

  • antigravity::tests::read_file_image_captures_bytes_from_disk_and_skips_non_images: verifies disk capture on the observed agy acp 1.5.23 tool_call -> tool_call_update sequence, no duplication when an inline ContentBlock::Image is present, and skipping non-image binaries (application/pdf).
  • antigravity::subagents::tests::subagent_media_steps_populate_image_reads: verifies transcript.jsonl media entries populate image_reads for image/* URIs (including percent-encoded paths) and skip non-image media.

Validation

  • mbx fmt --all --check: passed
  • cargo machete: passed
  • RUSTUP_TOOLCHAIN=1.100.1 mbx clippy --workspace --all-targets --locked -- -D warnings: passed
  • RUSTUP_TOOLCHAIN=1.100.1 mbx nextest run --workspace --locked --no-fail-fast -E 'not test(=claude::tests::a_session_previews_rewinds_and_reports_the_part_claude_refused)': 1544/1548 passed (agent 304/304 passed; the 4 local failures are environment-specific: 2 wayland-nest tests require sway, and 2 tcode-traverse tests fail with AddrNotAvailable without IPv6 loopback; the skipped Claude rewind test hangs locally)
  • Live probe: mbx run -p agent --example probe --locked -- antigravity ... reading a local PNG confirmed ItemCompleted(ToolCall) emits populated image_reads with media_type: "image/png" and the exact image base64

ClanEver and others added 2 commits December 4, 2026 11:56
opencode's prompt-attachment paths and Antigravity's subagent media both
turned a file:// URI into a path with the same copied percent decoder.
Url::to_file_path owns that, including localhost hosts and Windows drive
letters.
@Tryanks
Tryanks merged commit 18a3dd0 into Tryanks:main Dec 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants