Skip to content

[BUG]: Pasting an image file path is auto-detected as image input instead of text #32014

Closed as duplicate

Description

@RyanChen1997

Description

When pasting an image file path (e.g., /path/to/screenshot.png) into opencode CLI, it is automatically captured as an image input rather than treated as plain text. This makes it impossible to reference image file paths as text.

Expected Behavior

There should be a way to paste an image file path as plain text without it being interpreted as an image attachment — for example, wrapping in backticks, or a toggle to disable image detection.

Actual Behavior

The content is captured as an image message, and the model receives: ERROR: Cannot read "filename.png" (this model does not support image input). The textual path is never accessible to the model.

Steps to Reproduce

  1. Copy a local image file path string (e.g., ~/Downloads/screenshot.png)
  2. Paste it into opencode CLI
  3. The path is recognized as an image reference instead of text

Environment

  • opencode CLI (latest)
  • macOS 15

Additional Context

This was encountered while trying to ask the model to copy an image to a specific directory and embed it in a markdown file. The file path could not be communicated because it was always intercepted as an image.

Image

Activity

  1. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

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

    • Can not paste image path as text #19892: Same bug — pasting an image file path into the TUI is auto-parsed as an image reference instead of plain text, making it impossible to use the path as text input.
  2. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  3. thanh-abaii commented on Aug 14, 2026

    @thanh-abaii

    Same issue here.

    Environment: Windows 11, opencode 1.18.18 (VS Code extension + Windows Terminal).
    I use "Copy as path" then paste into the prompt, and it's immediately converted to [image 1] instead of the text path. My model doesn't support image input, so I have no way to reference the file path as text.

    Please add an option to paste a file path as plain text.

  4. qiqingli commented on Aug 14, 2026

    @qiqingli

    Same issue here (text-only model, pasting /Volumes/RamDisk/chart_actual.png in the TUI gets auto-converted to an [Image 1] attachment, then errors with ERROR: Cannot read "chart_actual.png" (this model does not support image input)).

    Workarounds tried — all imperfect: trailing space, backticks, text prefix (e.g. image: /path.png) are still intercepted when the line ends with an image extension; only a Markdown link [/path/image.png]() bypasses it.

    Suggestion: before auto-detecting a path as an image attachment, check whether the current model's modalities include image; if not, keep it as plain text.

    Related: #42544

  5. neriousy commented on Oct 1, 2026

    @neriousy
    Member

    Closing as a duplicate of #19892, which tracks pasted image file paths always becoming attachments instead of plain text. Please add your use case and 👍 there.

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