feat: display inline images from tool results in chat buffer - #221
Conversation
3174ef2 to
fb9aa34
Compare
5c62560 to
bb62753
Compare
Render completed tool-result image blocks inline in graphical Emacs and as type-and-size placeholders in terminals. Bound each returned source and the number shown per tool, and preserve rendered previews through toggling and cooling.
bb62753 to
5a12525
Compare
|
Thanks @conornash for the original #221 work, and @bobrowadam for the #211 implementation consolidated here. I’ve refreshed this PR onto current master and kept it focused on displaying image results:
The branch also keeps test dependencies project-local and passes the selected Emacs/package directory to child batch, GUI, and benchmark processes. This fixes the package lookup mismatch behind the old CI failures without changing normal compile behavior. Verification is green: full A few limits are intentional:
This remains display-only. Pasting an image or typing its path does not attach image data to an outgoing prompt; prompt image attachments remain separate #261 work. |
Keep dependency installs project-local per Emacs major and pass the selected Emacs and package directory to child batch, GUI, and benchmark processes. Preserve the existing in-tree compile behavior. Co-authored-by: Daniel Nouri <daniel.nouri@gmail.com>
Render completed tool-result image blocks inline in graphical Emacs and as type-and-size placeholders in terminals. Bound each returned source and the number shown per tool, and preserve rendered previews through toggling and cooling.
5a12525 to
bec5ecf
Compare
Preview complete standalone SVG text returned by read without reopening the tool argument path. Leave text with obvious scripts or external resources undecoded, and keep previews display-only. Co-authored-by: Adam Bobrow <adam@bradwell.ai>
bec5ecf to
c81812f
Compare
|
A final protocol-shaped review caught one small mismatch before merge: ordinary That is now corrected. Nil/JSON-null means the returned SVG is complete, while non-null truncation metadata still leaves it as text. Regression coverage exercises both cases, and all 11 replacement CI checks pass. |
When a tool (e.g. read) returns image content blocks alongside text, the images are now rendered inline inside the tool block overlay.
In GUI Emacs: decoded and displayed via create-image/insert-image with max-width/max-height scaling to fit the window.
In terminal Emacs: a text placeholder showing MIME type and size.
Implementation:
Handles: corrupt base64, unknown MIME types, empty data, vectors and lists, multiple image blocks, image-only results (no text).
12 new tests covering all paths. 942/942 full suite passes.