Harness Notes

Image input

Updated 2026-11-22,

On this page

How to give each harness a screenshot, mockup or diagram from its terminal, what it accepts, and whether the image survives in the saved session.

Getting an image in

QuestionOpenCodechecked at 2.0.29
Paste from the clipboard

Press Ctrl+V (prompt.paste) to paste a clipboard image as an [Image N] chip. OpenTUI's host clipboard is asked for image/png first, then text. An empty bracketed paste from the terminal also triggers an image read. Press <leader>i (default leader ctrl+x) to preview the attached images.

Attach an image file

Paste or drag image paths into the prompt: one path, or up to 32 space-separated paths totalling 20 MiB, using the extensions .png, .jpg, .jpeg, .gif, .webp, .avif and .pdf (.svg goes in as text). @-mentioning a file attaches it by file:// URI, and the server detects images from their bytes. For scripted runs, use opencode run -f.

Images in scripted runs

opencode run -f shot.png "describe this" sends up to 100 files of 10 MiB each, inlined as data: URLs. A text message is required, and stdin only adds to the message text.

Images through the SDK or API

POST /api/session/{sessionID}/prompt (SDK session.prompt) takes { text, files: [{ uri, name?, description? }] } with uri set to an absolute file: URL or a data: URL. http(s) is rejected. ACP advertises image: true: image blocks with base64 data become attachments, while an image block that has only an http(s) URI is passed as a text link.

What is accepted

QuestionOpenCodechecked at 2.0.29
Formats, limits and resizing

Partly

Only PNG, JPEG, GIF and WebP reach the model. AVIF, BMP and other binaries are accepted but left out of the request, and SVG is sent as text. Each attachment can be up to 20 MiB decoded. Images over 2000x2000 px or 5 MiB of base64 are scaled down and re-encoded as PNG or JPEG; set this under media.image (auto_resize, max_width, max_height, max_base64_bytes). If a request holds more than 25 MiB of images, the oldest are replaced with a placeholder until it is under 15 MiB.

v1's attachment.image config key is media.image in v2.

The media type is detected from the file bytes, so renaming a file does not change it.

An image with no text

In the TUI, yes: the [Image N] label counts as prompt text, so paste and press Enter. A truly blank prompt is refused in a new session. opencode run needs a message, and the API's text field is required.

Models that can't see images

The image is replaced by ERROR: Cannot read "<file>" (this model does not support image input). Inform the user., so the turn still runs and the model says it can't see it. The docs warn to pick a model with image input first.

Afterwards

QuestionOpenCodechecked at 2.0.29
Kept in the saved session

Partly

Attachments are stored as base64 in the session message, so resuming or forking keeps the pixels. After summary compaction, the kept recent conversation is converted to text and images become [image/png omitted], so the model can't see older images any more. Native (OpenAI Responses) compaction keeps recent attachments alongside an encrypted checkpoint.

The agent opening images itself

Yes. read detects PNG, JPEG, GIF, WebP and PDF from file contents, reads up to 20 MiB, and passes them to the model after the same resize step. Images that can't be decoded or resized are left out with a note. There is no built-in screenshot tool, though the browser tool can capture pages.

Notes and sources

OpenCode, 20 sources
Paste from the clipboard, 3
Attach an image file, 4
Images in scripted runs, 3
Images through the SDK or API, 5
Formats, limits and resizing, 4
An image with no text, 2
Models that can't see images, 2
Kept in the saved session, 2
The agent opening images itself, 3