On macOS, copying an image file from Finder results in pasting a generic image icon, instead of the image data #2642

Open
opened 2026-02-16 17:36:35 -05:00 by yindo · 3 comments
Owner

Originally created by @jdanbrown on GitHub (Nov 6, 2025).

Originally assigned to: @thdxr on GitHub.

Description

On macOS:

  1. Good: When I copy (cmd+c) raw image data (like taking a screenshot to the clipboard, or open an image file in Preview and cmd+a, cmd+c to copy the image content), then pasting it into opencode using ctrl+v/cmd+v works correctly
  2. Bug: When I copy (cmd+c) an image file from Finder (i.e. select a file in Finder, press cmd+c), then pasting it into opencode using ctrl+v doesn't work correctly — the llm says it sees a generic image icon instead of the image data
    • Another bug: cmd+v does nothing when an image file is on the clipboard, whereas cmd+v works when image data is on the clipboard
  3. Good: When I drag-drop an image file from Finder into opencode (cli in VS Code terminal), then the llm (Haiku 4.5) decides to read the path, and opencode read's the path, and then the llm gets the image data

Tested using this image of a big inflatable duck:

Chat session:

  ┃
  ┃  what's in this image? [Image 1]
  ┃
  ┃   img  clipboard
  ┃
  ┃  danb (2:47:21 PM)
  ┃

     This image shows a massive inflatable rubber duck in a parking lot. The giant yellow duck has a bright orange bill and a dark eye, and it dwarfs
     the surrounding area—you can see cars, buildings, and trees in the background that are tiny in comparison. There are people standing near it for
     scale, and the parking lot has blue and yellow barrier markers around it. The sky is partly cloudy and blue, making for a striking backdrop. This
     appears to be some kind of public art installation or promotional event.

     Build anthropic/claude-haiku-4.5

  ┃
  ┃  what's in this image? [Image 1]
  ┃
  ┃   img  clipboard
  ┃
  ┃  danb (2:48:01 PM)
  ┃

     This is a file icon representing a JPG image file. The icon shows a white document with a folded corner, and features a magnifying glass over a
     preview of a coastal landscape photo (showing ocean, rocks, and sky). Below the icon is the text "JPG" indicating the file format. This is a
     typical macOS or generic desktop icon used to represent JPEG image files.

     Build anthropic/claude-haiku-4.5

  ┃
  ┃  what's in this image? '/Users/danb/Desktop/image.jpg'
  ┃  danb (2:49:47 PM)
  ┃

     I'll read that image file for you.

     → Read ../Desktop/image.jpg

     This is the same giant inflatable rubber duck image from earlier. It shows a massive yellow duck with an orange bill and dark eye in a parking lot.
      The duck is surrounded by blue and yellow parking barriers, with small groups of people standing nearby for scale. In the background, you can see
     parked cars, buildings, and trees under a partly cloudy blue sky. It's clearly a large public art installation or promotional event.

     Build anthropic/claude-haiku-4.5

OpenCode version

1.0.36

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 15.5

Terminal

VS Code terminal

Originally created by @jdanbrown on GitHub (Nov 6, 2025). Originally assigned to: @thdxr on GitHub. ### Description On macOS: 1. Good: When I copy (`cmd+c`) raw image data (like taking a screenshot to the clipboard, or open an image file in Preview and `cmd+a, cmd+c` to copy the image content), then pasting it into opencode using `ctrl+v`/`cmd+v` works correctly 2. Bug: When I copy (`cmd+c`) an image _file_ from Finder (i.e. select a file in Finder, press `cmd+c`), then pasting it into opencode using `ctrl+v` doesn't work correctly — the llm says it sees a generic image icon instead of the image data - Another bug: `cmd+v` does nothing when an image file is on the clipboard, whereas `cmd+v` works when image data is on the clipboard 4. Good: When I drag-drop an image file from Finder into opencode (cli in VS Code terminal), then the llm (Haiku 4.5) decides to `read` the path, and opencode `read`'s the path, and then the llm gets the image data Tested using this image of a big inflatable duck: - https://github.com/user-attachments/assets/20cb66c6-e7e3-448c-8c9f-2a4dc13f6089 Chat session: - https://opencode.ai/s/gO6L5byt ``` ┃ ┃ what's in this image? [Image 1] ┃ ┃ img clipboard ┃ ┃ danb (2:47:21 PM) ┃ This image shows a massive inflatable rubber duck in a parking lot. The giant yellow duck has a bright orange bill and a dark eye, and it dwarfs the surrounding area—you can see cars, buildings, and trees in the background that are tiny in comparison. There are people standing near it for scale, and the parking lot has blue and yellow barrier markers around it. The sky is partly cloudy and blue, making for a striking backdrop. This appears to be some kind of public art installation or promotional event. Build anthropic/claude-haiku-4.5 ┃ ┃ what's in this image? [Image 1] ┃ ┃ img clipboard ┃ ┃ danb (2:48:01 PM) ┃ This is a file icon representing a JPG image file. The icon shows a white document with a folded corner, and features a magnifying glass over a preview of a coastal landscape photo (showing ocean, rocks, and sky). Below the icon is the text "JPG" indicating the file format. This is a typical macOS or generic desktop icon used to represent JPEG image files. Build anthropic/claude-haiku-4.5 ┃ ┃ what's in this image? '/Users/danb/Desktop/image.jpg' ┃ danb (2:49:47 PM) ┃ I'll read that image file for you. → Read ../Desktop/image.jpg This is the same giant inflatable rubber duck image from earlier. It shows a massive yellow duck with an orange bill and dark eye in a parking lot. The duck is surrounded by blue and yellow parking barriers, with small groups of people standing nearby for scale. In the background, you can see parked cars, buildings, and trees under a partly cloudy blue sky. It's clearly a large public art installation or promotional event. Build anthropic/claude-haiku-4.5 ``` ### OpenCode version 1.0.36 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System macOS 15.5 ### Terminal VS Code terminal
yindo added the opentuibug labels 2026-02-16 17:36:35 -05:00
Author
Owner

@thdxr commented on GitHub (Nov 6, 2025):

i laughed so hard at the response. i'll fix

@thdxr commented on GitHub (Nov 6, 2025): i laughed so hard at the response. i'll fix
Author
Owner

@jdanbrown commented on GitHub (Nov 22, 2025):

In 1.0.104, copy/pasting an image file from Finder now results in pasting just the filename (e.g. duck) instead of any kind of image data. Copy/pasting the raw image data still works correctly (like screenshot to clipboard, or cmd+a, cmd+c in Preview).

@jdanbrown commented on GitHub (Nov 22, 2025): In 1.0.104, copy/pasting an image file from Finder now results in pasting just the filename (e.g. `duck`) instead of any kind of image data. Copy/pasting the raw image data still works correctly (like screenshot to clipboard, or `cmd+a, cmd+c` in Preview).
Author
Owner

@connorads commented on GitHub (Jan 6, 2026):

Hey @jdanbrown I had the same issue with VS Code on macOS with copying image files.
I made a fix https://github.com/anomalyco/opencode/pull/6127, but it's not merged yet.

If you want to test it yourself you can try checking out the PR/branch and running bun dev and then pasting your image.

Feel free to thumbs it up etc. and hopefully we can get it merged

@connorads commented on GitHub (Jan 6, 2026): Hey @jdanbrown I had the same issue with VS Code on macOS with copying image files. I made a fix https://github.com/anomalyco/opencode/pull/6127, but it's not merged yet. If you want to test it yourself you can try checking out the PR/branch and running `bun dev` and then pasting your image. Feel free to thumbs it up etc. and hopefully we can get it merged
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2642