Repository navigation
Description
What problem does this solve?
Image input (#212) is narrower than the core supports:
--imageattaches to the first message only ofrun|chat|mission.tole-core'srun_turn_with_imagestakes images per turn, so the limit is in the hosts, not the core. In a long chat or the TUI you cannot show the model a screenshot halfway through.- ACP drops non-text blocks, and a prompt that carries only image blocks is rejected as "missing prompt" (
crates/tole-cli/src/acp.rs). An editor that sends a pasted image gets nothing. - There is no way for the model to look at an image file in the workspace on its own (for example a screenshot path the user mentions).
Proposed solution
-
Any turn: let chat, the TUI and serve (feat(serve): image input and an image read route for graphical clients #558) attach images to any user message, not just the first. No core change expected; verify first.
-
ACP image blocks: map ACP image content blocks (base64 data plus a MIME type) onto the existing spill-and-reference path, and stop rejecting an image-only prompt. Check the ACP spec for how the prompt capability for images is advertised and honour it.
-
Decision needed before any code: a model-callable image tool. Tool results in the OpenAI-compatible format are text, so a
read_imagetool cannot just return pixels. Options to compare:- Do not add one; images stay user-supplied (current behavior, simplest, no new risk).
- The tool records a reference and the harness commits an attributed user message carrying the image at the next safe point (the same mechanism the steering/interrupt path uses), so the model sees it on the following provider call.
- A provider-specific image tool result where the provider supports it.
Whichever is chosen: files only from inside the workspace jail, size and type limits as today, the content treated as untrusted (text inside an image can carry instructions, like a fetched web page), and a threat-model entry.
Alternatives considered
- Leave first-message-only: cheap, but the TUI and GUI clients would feel broken the first time someone pastes an image in a running conversation.
- Always allow the model to read any image path: rejected, it needs the jail and a trust decision first.
Acceptance criteria
- Images attach to any turn in chat and the TUI host path, with a test that the second turn's message records its own references.
- ACP: an image block is accepted, spilled and recorded; an image-only prompt runs; a non-image block is still ignored; tests over the real ACP loop.
- A recorded decision on the image tool (a comment here is enough); a follow-up issue with its threat-model delta if the answer is yes.
-
docs/threat-model.mdand the README image section updated in the same change.
Activity
ajianaz commentedon Nov 11, 2026
Decision (owner): no model-callable image tool for now. Images stay user-supplied (
--image,/imageinchat, the TUI host's pending images, ACPimageblocks, and serve uploads in #558).Rationale:
read_imagetool cannot return pixels. Doing it properly needs an attributed-message mechanism: the tool records a reference and the harness commits an attributed user message carrying the image at the next safe point.The decision is recorded in
docs/threat-model.md(Image input, #212/#559). If a concrete need comes up, it will be revisited in a follow-up issue that carries the threat-model delta.feat(cli): images on any turn and ACP image blocks (#559) (#563)
feat(tui): bracketed paste and image attach (#560)
feat(tui): bracketed paste and image attach (#560) (#564)