Skip to content

feat(core,cli): images on any turn, ACP image blocks, and a decision on an image-reading tool #559

Closed

Description

@ajianaz

What problem does this solve?

Image input (#212) is narrower than the core supports:

  • --image attaches to the first message only of run|chat|mission. tole-core's run_turn_with_images takes 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

  1. 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.

  2. 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.

  3. Decision needed before any code: a model-callable image tool. Tool results in the OpenAI-compatible format are text, so a read_image tool 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.md and the README image section updated in the same change.

Part of #523. Related: #212, #558.

Activity

  1. added
    enhancement
    on Nov 11, 2026
  2. ajianaz commented on Nov 11, 2026

    @ajianaz
    ContributorAuthor

    Decision (owner): no model-callable image tool for now. Images stay user-supplied (--image, /image in chat, the TUI host's pending images, ACP image blocks, and serve uploads in #558).

    Rationale:

    • Tool results are text in the OpenAI-compatible format, so a read_image tool 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.
    • That is a new input path the user did not choose: a model-chosen workspace path and an injection channel (text inside an image can carry instructions, like a fetched web page). It needs its own threat-model entry before it ships.
    • Today's user-supplied path already covers the reported gaps (images on any turn, ACP image blocks) without new risk.

    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.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions