Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Put these local files in the workspace (synthetic fixtures, generated on macOS; each hides a word or number that can only be found by actually seeing or hearing the file):
imagem.pngandimagem.jpg(800×500): a word, a number and a red triangledocumento.pdf: page 1 has a selectable text layer; page 2 is a raster image onlyaudio.wavandaudio.mp3: a short pt-BR spoken sentencevideo.mp4: H.264 + AAC, 6 s, two colored scenes with a word each, plus spoken audio
- Start an Antigravity thread (tested with
gemini-4-argon-mediumandgemini-3.8-flash-medium). - Ask the agent to open each file with its native file tool, with shell/ffmpeg/OCR forbidden, and report what it perceives.
Expected behavior
Images (and ideally PDFs, audio and video, which the Gemini models support) reach the model as media, as they do for the other providers in the same T3 install. At minimum, a binary file should fail with a clear error instead of being returned as corrupted text.
Actual behavior
Both view_file and client_view_file return every file as a string like {"result": "�PNG\n\u001a\n\u0000\u0000..."}: the raw bytes decoded as UTF-8 with replacement characters. Nothing visual or audible reaches the model, and it reports "nothing perceived".
Same files, same machine and same T3 build, other providers:
| Provider (model) | Native tool | PNG/JPG | PDF p1 (text) | PDF p2 (image only) | WAV/MP3 | MP4 |
|---|---|---|---|---|---|---|
| Claude (Haiku 5.5) | Read |
✅ seen | ✅ | ✅ | clean error | clean error |
| Grok (4.7) | read_file |
✅ seen | ✅ (rendered) | ✅ (rendered) | clean error | clean error |
| Codex (GPT-6 Luna) | view_image |
✅ seen | no tool | no tool | no tool | no tool |
| Cursor (Composer 2.5) | Read |
✅ described | ✅ (text) | ❌ (text only) | clean error | clean error |
| OpenCode (Beam Free, no vision) | read |
clean "model does not support image input" error | clean error | clean error | clean error | clean error |
| OpenCode (Kimi K3.1 Pro) | read |
✅ seen | clean "model does not support pdf input" error | same | clean error | clean error |
| Muse Code (Spark 1.3 / Wonder 1.0 / Wonder Full 1.0) | read_file |
✅ seen | clean "file is not valid UTF-8; binary tool-output refs are not implemented" error | same | same clean error | clean refusal ("video was not attached… extract frames with ffmpeg") |
| Antigravity (Argon / 3.8 Flash) | view_file, client_view_file |
❌ bytes as text | ❌ bytes as text | ❌ bytes as text | ❌ bytes as text | ❌ bytes as text |
The other providers either see the media or refuse it cleanly. Antigravity is the only one that silently returns corrupted text.
Root cause (read from the installed code; the fix itself is not tested)
There are two layers, and fixing only the T3 side does not restore vision.
T3 side. AntigravityAdapterV2.ts:128 enables clientFileSystem: true, and AntigravityAcpSupport.ts:60 advertises fs.readTextFile. AntigravityClientFiles.ts:55 then does:
const text = yield* input.fileSystem.readFileString(filePath);
return { content: text };It checks workspace containment, symlinks, file type and the 8 MiB cap, but not MIME, NUL bytes or strict UTF-8. readFileString uses new TextDecoder(encoding) without fatal: true, so invalid bytes become �. fs/read_text_file is a text API (per the ACP spec), so returning binary as text is silent corruption. Note that AntigravityAcpSupport.ts:343–349 already has strict-UTF-8 and NUL checks for text attachments, which could be reused here.
Upstream (Google ACP runtime 1.3.0, agy_acp_server.par).
server.py:3852disables the built-inVIEW_FILEand installstools.make_safe_view_file(...).- That replacement opens every file with
open(path, "r", encoding="utf-8", errors="replace")and returnsstr(tools.py:136–140), whether or not the client advertisesreadTextFile. client_view_file(tools.py:205–211) forwards every path toclient.read_text_file.- The SDK in the same package already has
Image,Document,AudioandVideotypes, plus asupplemental_mediapath (event_processor.py:69–87,965–988). The two readers never use it because they only return strings.
Suggested fix
- T3: reject non-text content in the
fs/read_text_filehandler with a clear ACP error (strict UTF-8 plus a NUL check, reusing the attachment logic). This gives an honest "can't read binary" error, the same behavior as the other providers, instead of garbage that the model may hallucinate over. - Upstream: have the replacement
view_filereturnImage,Document,AudioorVideoobjects for supported MIME types (thesupplemental_mediaroute already exists), and keepclient_view_filefor text only. If there's a channel to forward this to Google, it would be appreciated (similar to [Bug]: Antigravity ACP marks successful file reads as failed #20095).
Impact
Major degradation or frequent failure: the Gemini models are among the strongest multimodal models, but inside T3 they cannot look at a screenshot, PDF, audio or video file from the workspace, and they get no error that explains why.
Version or commit
T3 Code Nightly 0.1.3-nightly.20261025.3682 (commit 1eb4071a497c); managed Antigravity ACP runtime 1.3.0
Environment
macOS 27 (Apple Silicon), T3 Code Nightly desktop; Antigravity ACP provider; models gemini-4-argon-medium and gemini-3.8-flash-medium.
Workaround
For images, use another provider, or extract frames with ffmpeg and have a provider whose read tool returns images (Claude, Grok or Codex) look at them. For video, frames plus subtitles via yt-dlp work, but that loses motion and audio.
Related
- [Feature]: Native MP4 video understanding for Antigravity ACP (not file-path fallback) #17066: native MP4 understanding for Antigravity attachments (closed). This report is about the file-read tools, not prompt attachments.
- [Bug]: Antigravity ACP marks successful file reads as failed #20095: another ACP 1.3.0 runtime issue (closed,
upstream).
Activity
rohitsabu commentedon Oct 29, 2026
Note
🤖 Codex responding on behalf of rohitsabu
We reproduced the PNG file-reader behavior on macOS (Apple silicon), T3 Code Nightly
0.1.5-nightly.20261029.3867, managed Antigravity runtime1.4.3, provider instanceantigravity, modelgemini-4-argon. In a disposable task, bothclient_view_fileandview_filereturned PNG bytes decoded as text; the agent reported that it could not see the image.A separate blind prompt-attachment test on the same route passed: a fresh synthetic PNG had random text and independently chosen shape colors encoded only in pixels. The agent, instructed not to use tools, correctly reported all three. In a subsequent turn it identified visible clipping and a faint subtitle in an attached synthetic browser screenshot. This establishes an attachment workaround for that tested session, not support for reading workspace images or MCP tool-result images.
We also observed a related but distinct tool-result path:
preview_snapshotwithincludeImage: trueandsave: trueproduced an image result that Antigravity saved as amedia_0.pngstep artifact, while the model-facing result was a large-output text-file pointer. The saved text output contained screenshot metadata, not an image block, andview_filethen returned the PNG as text. T3's preview handler in the inspected build emits an MCP image block; we have not independently captured the final model input or established which upstream component controls the offload. A prompt attachment and an MCP result are therefore different tests. No blanket conclusion about Gemini's vision capability is warranted.Could maintainers advise whether the MCP image offload/reader interaction should be tracked separately and whether there is a supported way for an orchestrator to promote a captured image into a later prompt attachment? The proposed binary-read rejection in #25292 would improve the error but would not itself deliver pixels.
juliusmarminge commentedon Nov 12, 2026
This is the same problem as #25292, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.