Skip to content

[FEATURE]:do not auto-convert image paths to attachments when the model does not support image input #42544

Closed

Description

@qiqingli

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

When typing a path ending with an image extension (e.g. /path/to/chart_actual.png) in the TUI, opencode automatically recognizes it and attaches it as an image attachment (shown as [Image 1] in the message).

If the current model does not support multimodal/image input, the model errors out:

ERROR: Cannot read "chart_actual.png" (this model does not support image input).

Steps to reproduce

  1. Start the opencode TUI with a text-only model (one that does not support image input).
  2. Paste a full path ending with .png (or .jpg/.jpeg, etc.), e.g. /Volumes/RamDisk/chart_actual.png.
  3. Send the message.
  4. Observe: the path is auto-converted to an [Image 1] attachment, and the model errors out with "image input not supported".

Workarounds tried (all imperfect)

  • Adding a trailing space / wrapping in backticks / adding a text prefix (e.g. image: /path.png): still intercepted as an attachment whenever a cmd+V paste triggers.
  • Using a Markdown link [/path/image.png](): bypasses it, but is unintuitive and not applicable to every paste scenario.

Suggestion

Before auto-detecting a path as an image attachment, opencode should check whether the current model supports image input (i.e. whether the model's modalities include image):

  • Supports images: keep the current auto-attach behavior (convenient for multimodal models).
  • Does not support images: keep the text as-is (plain path), do not convert it to an attachment.

Environment

  • opencode version: latest
  • Platform: macOS
  • Interface: TUI

Activity

  1. github-actions commented on Aug 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your request is specifically about suppressing auto-attachment at the input stage based on model capability (rather than a general plain-text paste option), it may be distinct enough to remain open, but please review those issues first and consider whether a comment there would be more appropriate.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions