From 48b14add01cb106217832e036e3569e494f1d65c Mon Sep 17 00:00:00 2001 From: t Date: Fri, 4 Dec 2026 15:30:05 -0700 Subject: Send dropped images as native ACP prompt content blocks Panto expands a pasted image into a multi-block user message (text, [Image-N] path text, base64 media). The adapter only accepted a single text block, so any image drop failed with 'No matching Antigravity tool handoff or text prompt'. Translate text and image/* media blocks into ACP ContentBlocks for new turns, warm follow-ups, boundary steering and transcript reseeds, gated on the agent's advertised promptCapabilities.image. Image data rides outside agy's ~191 KB user-text cap, so only text bytes count toward message_bytes; reseeds prefix the leading text block and reserve room for the path context block. Non-image attachments (PDFs) are refused before launch because agy's ACP inlineMedia accepts image/* only. The offline check now drops a real PNG via bracketed paste across a warm turn, /tree reseed and cold resume, and asserts PDF rejection. --- tests/tui.exp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/tui.exp') diff --git a/tests/tui.exp b/tests/tui.exp index fdbad27..efa4cda 100644 --- a/tests/tui.exp +++ b/tests/tui.exp @@ -22,6 +22,7 @@ foreach {prompt answer} {hello primary-tool-ok again same-session-ok} { } send -- "late-tool"; see {late-tool}; send -- "\r"; see {timeout-handled-ok} send -- "/fixture-notice "; see {/fixture-notice }; send -- "\r"; see {workflow-notice-ok} +send -- "\033\[200~$env(HOME)/drop.png\033\[201~ image-probe"; see {\[Image-1\] image-probe}; send -- "\r"; see {image-drop-ok} send -- "\003"; expect eof; wait set flag [open "$env(HOME)/.local/share/panto-antigravity/google/usage-failure" w]; close $flag spawn -noecho $env(PANTO) resume -m antigravity:fast -r high @@ -33,9 +34,8 @@ send -- "\003"; expect eof; wait spawn -noecho $env(PANTO) resume -m antigravity:fast -r low see {antigravity:}; send -- "/tree "; see {/tree }; send -- "\r"; see {session tree} send -- "primary-tool-ok"; after 150; send -- "\r"; see {branched from} -foreach {query answer} {branch-probe branch-seed-ok warm-probe warm-after-seed-ok} { - send -- $query; see $query; send -- "\r"; see $answer -} +send -- "\033\[200~$env(HOME)/drop.png\033\[201~ branch-probe"; see {\[Image-2\] branch-probe}; send -- "\r"; see {branch-seed-ok} +send -- "warm-probe"; see {warm-probe}; send -- "\r"; see {warm-after-seed-ok} send -- "esc-probe"; see {esc-probe}; send -- "\r"; see {esc-window-open} send -- "\033"; see {\[interrupted\]} send -- "after-esc-probe"; see {after-esc-probe}; send -- "\r"; see {after-esc-ok} @@ -75,8 +75,10 @@ see {requires direct TUI input}; send -- "\003"; expect eof; wait spawn -noecho $env(PANTO) --incognito -m antigravity:fast -r low -- no-tools see {no-tools-ok} send -- "\003"; expect eof; wait -# xhigh exists before switching models, but not on gemini-test. +# xhigh exists before switching models, but not on gemini-test; PDFs are rejected before ACP launch. spawn -noecho $env(PANTO) --incognito -m antigravity:fast -r xhigh -see {antigravity:}; send -- "unsupported"; see {unsupported}; send -- "\r" +see {antigravity:}; send -- "\033\[200~$env(HOME)/drop.pdf\033\[201~"; see {\[Attachment-1\]}; send -- "\r" +see {only text and image} +send -- "unsupported"; see {unsupported}; send -- "\r" see {reasoning level xhigh} send -- "\003"; expect eof; wait -- cgit v1.3