fix(grok): send images as native ACP blocks - #462
Conversation
|
Thanks for this one — I went through it carefully and it holds up really well. Rather than take the capability claim on faith I re-verified the premise live against the grok CLI on my machine, and everything you describe reproduces exactly. What I measured (grok 1.0.0 — the version
|
Review follow-ups to 13aa5df. Advertising `image: true` made the composer send EVERY `image/*` attachment as a native ACP image block, but grok's validator decodes only a raster set: `image/svg+xml` is rejected outright ("unsupported or unrecognised image format") and the model then answers from nothing at all. The same file as a resource blob lands in the session's assets, where the model reads the source and gets it right — so the override regressed those formats. The composer sees one capability bit and cannot decide per mime, so `promote_grok_image_resources` becomes `normalize_grok_image_blocks` and sorts both ways at the dispatch choke point: promote what grok decodes, demote what it does not. The allow-list is grok's own raster set; png, webp, bmp and tiff were each verified live through the describe sidecar, svg verified rejected. Also from review: - Show grok's `image_dropped` note verbatim. It already opens with "Image 1 was dropped before send", so the prefix stuttered it back at the user. Only the shapeless `reason`/`message` fallbacks are prefixed now, and a blank one no longer renders as a bare "Image dropped: ". - Skip alerting ext notifications during the `session/load` historical replay. A past session's dropped image or failed compaction was re-raised as a live status-bar alert plus an OS notification just for opening the session; the typed replay closure beside it already draws that line. - Name the version the behaviour was measured against — the registry pins 1.0.0 and 0.2.112 behaves identically, so the override stays deliberately un-gated — and drop the comments still claiming grok receives images as embedded resources.
|
Pushed The SVG note was an actual regressionI flagged
Grok's validator rejects svg outright ( The composer only sees one The other four
Four new tests cover the demotion (including an upper-cased mime, since the two guards have to read the same string the same way), the allow-list boundary, the note-less drop, and the alert predicate. Checks
Thanks again for the original find — the |
#462 cited 1.0.0 as "the version registry.rs pins", but 543cff8 moved the pin to 1.0.3, so the claim landed already stale. Re-measured against 1.0.3 before rewording: it still advertises `image: false`, still accepts a native image block and answers correctly from the pixels, still rejects `image/svg+xml` with the same `image_dropped` notes shape, and still echoes the native image chunk the history parser reads. The behaviour holds across 0.2.112, 1.0.0 and 1.0.3, which is what the docs now say — with no pinned version named anywhere, since that claim rots at every bump.
What changed
imageblocks.image_droppednotifications as non-terminal errors.Why
Grok 1.0.2 still advertises
image: false, so Codeg encoded images as embedded resources. Grok treats that shape as a binary file attachment and does not invoke its image-description sidecar, leaving the model unable to inspect the pixels. Native ACP image blocks do invoke the sidecar.Impact
Grok can now inspect pasted or attached images in Codeg. Existing queued drafts and older transcripts remain compatible, and users receive a visible warning when Grok rejects an image before sending it to the model.
Validation
cargo test --features test-utils promote_grok_image_resources_lifts_image_blobs_onlycargo test --features test-utils map_grok_ext_notification_image_dropped_surfaces_errorcargo test --features test-utils merges_prompt_text_and_native_image_into_one_user_turncargo test --features test-utils merges_prompt_text_and_image_resource_into_one_user_turngit diff --checkAll targeted tests passed.