Skip to content

read tool returns metadata-only for image files, breaks multimodal model image input #146

Description

@yyk9137

What happened?

Problem

When the AFT plugin is active, the read tool returns only a metadata string for image files (e.g., Image read successfully (PNG, 59KB). File: /path/to/image.png). The actual image content is never returned to the model.

Expected behavior

For models configured with attachment: true and modalities: { input: ["text", "image"] }, the read tool should return image content so the model can process it with its vision capabilities — matching the behavior of OpenCode's native read tool.

Observed behavior

AFT's read tool detects image file extensions and returns a metadata-only string, regardless of whether the calling model supports image input. The model receives only the string Image read successfully (PNG, 59KB). File: ... and cannot see the actual image.

Steps to reproduce

  1. Install AFT plugin (@cortexkit/aft-opencode@latest)
  2. Configure a model with attachment: true and modalities: { input: ["text", "image"] }
  3. Have the model call read on any .png or .jpg file
  4. Observe: only metadata string is returned, no image content

Impact

Any workflow that uses read to load image files for multimodal models is broken. For example, OMOslim's observer agent (using a multimodal model) cannot read images when delegated via task() — the observer calls read on the image file but only receives metadata, so it cannot perform visual analysis.

Diagnostics

AFT binary version: 0.39.4
AFT plugin version: 0.39.4
Platform: Windows 11 (win32-x64)
OpenCode version: 1.17.11

Plugin version

0.39.4

AFT binary version

0.39.4

Platform

Windows 11 (win32-x64)

Log output (optional)

N/A — relevant logs are in OpenCode's main log, not in `/tmp/aft-plugin.log`. The OMOslim image-hook log shows the flow: image is saved to disk, observer session is created, `read` tool is called on the saved image, but only metadata is returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions