Repository navigation
Agents can show local images in chat: show_image, and Markdown images in replies - #1036
Open
alexandre-vl wants to merge 3 commits into
Open
alexandre-vl wants to merge 3 commits into
alexandre-vl wants to merge 3 commits into
Conversation
… in replies
show_image {path} (Zeron MCP) copies a PNG/JPEG/WebP/GIF into uploads and
publishes the image part Codex's generated images use, so every client
already renders it and it outlives the file.
An agent reply's  now draws the image in place, read live by the
chat's host through ReadChatImageChunk: strictly inside that chat's folder,
no link followed, no URL fetched, extension and bytes checked, decoded within
the shared raster limits. Anything refused keeps today's link.
On Windows `/` isn't absolute, so it was refused as "not an absolute path" instead of as the root. Test the root of the temp dir's own path (`/`, or a drive like `C:\`) instead.
This branch has not been deployed
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.
Fixes #1035. Refs #631 on desktop: its
/tmp/…screenshot is outside the chat's folder, so it still shows as a link.Two native ways for an agent to show a local image, both drawn as the image row Codex's generated images use.
show_image {path}in a replyshow_image(Zeron MCP) copies the file into uploads and publishes animagepart, so desktop and iOS already render it and it outlives the file. PNG/JPEG/WebP/GIF by their bytes, ≤ 10 MB, ≤ 4096 px a side; a refusal says why. With real harnesses, Claude Code and OpenCode used it unprompted (4/4 and 6/6 images byte-identical); Codex defers MCP tools behind its tool search and writes Markdown instead.Markdown images in an agent's reply are drawn in place, read live by the chat's host, never copied. No prompt or instruction mentions them. Refused paths keep today's rendering, a link:
http:,file:,data:…),~, UNC and device paths are dropped before any request.ReadChatImageChunk {chatId, path}is answered only by the chat's host (relayed withtargetDeviceId), strictly inside that chat's folder. A chat working in home or above,/, or around Zeron's data has none.lstated and a symlink or junction refuses unfollowed (a planted junction to\\host\sharewould send NTLM credentials). Windows device names are refused.Limits: the image follows the file (
show_imagecopies); images outside the chat's folder (/tmp) or behind a symlink stay links; iOS still shows links.cargo test -p zeron-ui --lib: 1897 passed, incl.reply_markdown_images_draw_only_from_their_own_chat.cargo test -p zeron-engine --lib -- uploads:: rpc::tests::: 35 passed.cargo test -p zeron-engine --test e2e --test device_routing: 31 + 11 passed, incl.publish_image_lands_in_the_live_turnandchat_images_come_only_from_their_chats_own_folder.cargo test -p zeron-mcp: 36 passed.reply-images-fixtureexample +docs/screenshots/agent-images/reproduce the captures.Need help on this PR? Tag
@codesmith-botwith what you need.