Repository navigation
Antigravity: capture image reads from disk so images render in the timeline - #1225
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When Antigravity (
agy1.5.23) reads an image withread_fileover ACP, thetool_call/tool_call_updateframes carry only a text placeholder ("Showing binary file of type image/png") in bothcontentandrawOutputwith noContentBlock::Image. As a result,ToolCall.image_readsstays 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.jsonlrecord image results in eachGENERICstep'smediaarray ([{"mime_type": ..., "uri": "file://..."}]), whichChildStepignored.Changes
crates/agent/src/acp_session.rs: Add a default no-opDialect::enrich_events(&self, cwd: &Path, events: &mut [AgentEvent])async hook andState::cwd(), invoked after releasing the session state lock and beforeclient.emit_all(events). This avoids blocking file I/O under the session lock while keeping other ACP dialects untouched.crates/agent/src/antigravity.rs: ImplementAntigravity::enrich_eventsto detect completedToolFamily::Readcalls with emptyimage_readsand"Showing binary file of type image/..."output, read the target file viaprocess::unblock, and populateimage_readsthroughtool_output::image. Non-image binaries (e.g. PDFs) and calls that already include an inlineContentBlock::Imageare left untouched.crates/agent/src/antigravity/subagents.rs: Parsemedia(mime_type,uri) onChildStepand read localfile://image media intoToolCall.image_readswhen completingGENERICsteps.Tests
antigravity::tests::read_file_image_captures_bytes_from_disk_and_skips_non_images: verifies disk capture on the observedagy acp1.5.23tool_call->tool_call_updatesequence, no duplication when an inlineContentBlock::Imageis present, and skipping non-image binaries (application/pdf).antigravity::subagents::tests::subagent_media_steps_populate_image_reads: verifiestranscript.jsonlmediaentries populateimage_readsforimage/*URIs (including percent-encoded paths) and skip non-image media.Validation
mbx fmt --all --check: passedcargo machete: passedRUSTUP_TOOLCHAIN=1.100.1 mbx clippy --workspace --all-targets --locked -- -D warnings: passedRUSTUP_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 (agent304/304 passed; the 4 local failures are environment-specific: 2wayland-nesttests requiresway, and 2tcode-traversetests fail withAddrNotAvailablewithout IPv6 loopback; the skipped Claude rewind test hangs locally)mbx run -p agent --example probe --locked -- antigravity ...reading a local PNG confirmedItemCompleted(ToolCall)emits populatedimage_readswithmedia_type: "image/png"and the exact image base64