Image Clipboard Paste Not Working in OpenCode #7276

Open
opened 2026-02-16 18:06:40 -05:00 by yindo · 4 comments
Owner

Originally created by @programmingehablinux-nix on GitHub (Jan 23, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Problem Description

When attempting to paste images from clipboard into OpenCode TUI, the system fails to recognize/process the image input. The error message shows: "I cannot see the image. It appears there was an error reading from the clipboard, and this model does not support direct image input via that method."

However, the same models (Gemini Flash/Pro Preview) work perfectly with image input when tested through other tools (goose CLI via Ollama), confirming that the underlying models and Ollama infrastructure DO support image processing.

Environment Details

  • OpenCode Version: 1.1.25
  • Terminal: Alacritty 0.16.1
  • OS: Linux "nixos" (Wayland session)
  • Clipboard Tool: wl-copy (Wayland clipboard)
  • Provider: Ollama with cloud models as local models
  • Model Tested: gemini-3-flash-preview:latest and gemini-3-pro-preview:latest
  • Screenshots Location: ~/Pictures/Screenshots/ (contains PNG files)

Configuration

// ~/.config/opencode/opencode.json
{
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "gemini-3-flash-preview:latest": {
          "name": "Gemini 3 Flash Preview",
          "options": {
            "capabilities": {
              "input": ["text", "image"],
              "output": ["text"]
            }
          }
        },
        // ... other models configured similarly
      }
    }
  }
}

Things I tried to resolve this issue

  1. Added explicit capabilities: Configured "input": ["text", "image"] for vision-capable models
  2. Qwen3 VL model: Vision-specific model also doesn't work with clipboard paste
  3. File path reference via @ syntax: Attempted @Pictures/Screenshots/ reference method - also does not work

Findings

  1. Error suggests clipboard read failure, not model capability issue
  2. File path reference via @ syntax does not work for images, despite being attempted

Reproduction Steps

  1. Configure OpenCode with Ollama provider running cloud models as local models
  2. Copy any image to clipboard (e.g., screenshot)
  3. Paste into OpenCode TUI conversation
  4. Ask "Can you see [Image 1]?"
  5. Observe the error about clipboard read failure

Additional Testing Results

  1. @ file path syntax also fails: Attempted @Pictures/Screenshots/ and @2026-01-09_10-59-43.png references do not work

Additional Context

Tested with Goose CLI using same Ollama models - images work perfectly there, confirming the issue is with OpenCode's clipboard/image input handling, not with Ollama or the models themselves.

Plugins

No response

Screenshot and/or share link

Image Image Image

Operating System

nixos 'unstable'

Terminal

Alacritty

Originally created by @programmingehablinux-nix on GitHub (Jan 23, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ## Problem Description When attempting to paste images from clipboard into OpenCode TUI, the system fails to recognize/process the image input. The error message shows: "I cannot see the image. It appears there was an error reading from the clipboard, and this model does not support direct image input via that method." However, the same models (Gemini Flash/Pro Preview) work perfectly with image input when tested through other tools (goose CLI via Ollama), confirming that the underlying models and Ollama infrastructure DO support image processing. ## Environment Details - **OpenCode Version**: 1.1.25 - **Terminal**: Alacritty 0.16.1 - **OS**: Linux "nixos" (Wayland session) - **Clipboard Tool**: `wl-copy` (Wayland clipboard) - **Provider**: Ollama with cloud models as local models - **Model Tested**: `gemini-3-flash-preview:latest` and `gemini-3-pro-preview:latest` - **Screenshots Location**: `~/Pictures/Screenshots/` (contains PNG files) ## Configuration ```json // ~/.config/opencode/opencode.json { "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "gemini-3-flash-preview:latest": { "name": "Gemini 3 Flash Preview", "options": { "capabilities": { "input": ["text", "image"], "output": ["text"] } } }, // ... other models configured similarly } } } } ``` ## Things I tried to resolve this issue 1. **Added explicit capabilities**: Configured `"input": ["text", "image"]` for vision-capable models 3. **Qwen3 VL model**: Vision-specific model also doesn't work with clipboard paste 4. **File path reference via @ syntax**: Attempted `@Pictures/Screenshots/` reference method - also does not work ## Findings 5. **Error suggests clipboard read failure**, not model capability issue 6. **File path reference via @ syntax does not work** for images, despite being attempted ## Reproduction Steps 1. Configure OpenCode with Ollama provider running cloud models as local models 2. Copy any image to clipboard (e.g., screenshot) 3. Paste into OpenCode TUI conversation 4. Ask "Can you see [Image 1]?" 5. Observe the error about clipboard read failure ## Additional Testing Results 1. **@ file path syntax also fails**: Attempted `@Pictures/Screenshots/` and `@2026-01-09_10-59-43.png` references do not work ## Additional Context Tested with Goose CLI using same Ollama models - images work perfectly there, confirming the issue is with OpenCode's clipboard/image input handling, not with Ollama or the models themselves. ### Plugins _No response_ ### Screenshot and/or share link <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/5db90f17-bacb-4a93-a0e5-9f67872c82ba" /> <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/56098565-7198-44bd-9f24-84938d5fe5a2" /> <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/f319cdc1-3136-4b7c-a09d-df935f9175dd" /> ### Operating System nixos 'unstable' ### Terminal Alacritty
yindo added the bugnix labels 2026-02-16 18:06:40 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 23, 2026):

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

  • #9375: Image paste fails only on Azure GPT-5.2-Codex with similar symptoms (File not found error / [Image 1] not processed)
  • #10150: Azure gpt-5.2-codex (vision-capable) is unable to read screenshots - model only receives textual placeholder
  • #6331: pasting images doesn't work on konsole, linux - clipboard paste not working on specific terminal/OS
  • #9868: ubuntu 25.10 cant paste image on desktop app - possible Wayland-related clipboard issue
  • #7341: Clipboard image pasting not supported with GLM-4.7 model + ZAI MCP - clipboard paste issue with specific model/provider

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 23, 2026): This issue might be a duplicate of existing issues. Please check: - #9375: Image paste fails only on Azure GPT-5.2-Codex with similar symptoms (File not found error / [Image 1] not processed) - #10150: Azure gpt-5.2-codex (vision-capable) is unable to read screenshots - model only receives textual placeholder - #6331: pasting images doesn't work on konsole, linux - clipboard paste not working on specific terminal/OS - #9868: ubuntu 25.10 cant paste image on desktop app - possible Wayland-related clipboard issue - #7341: Clipboard image pasting not supported with GLM-4.7 model + ZAI MCP - clipboard paste issue with specific model/provider Feel free to ignore if none of these address your specific case.
Author
Owner

@programmingehablinux-nix commented on GitHub (Jan 24, 2026):

I'm aware of the 'ollama launch' command, though I haven't tested it so far.

@programmingehablinux-nix commented on GitHub (Jan 24, 2026): I'm aware of the 'ollama launch' command, though I haven't tested it so far.
Author
Owner

@Raw1mage commented on GitHub (Jan 26, 2026):

I was using Antigravity in windows, and connecting to the wsl environment for dev.

In wsl terminal, when the opencode reads "ctrl-v", it obtains the clipboard image by powershell. So it is essential to make sure that the powershell path is configured in .bashrc before the opencode cli is exectued.

PATH=$PATH:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:

@Raw1mage commented on GitHub (Jan 26, 2026): I was using Antigravity in windows, and connecting to the wsl environment for dev. In wsl terminal, when the opencode reads "ctrl-v", it obtains the clipboard image by powershell. So it is essential to make sure that the powershell path is configured in .bashrc before the opencode cli is exectued. PATH=$PATH:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:
Author
Owner

@372572571 commented on GitHub (Feb 9, 2026):

look_at(file_path="/home/xx/bell-notification.png")
You can only force it to look at the picture in this way

@372572571 commented on GitHub (Feb 9, 2026): look_at(file_path="/home/xx/bell-notification.png") You can only force it to look at the picture in this way
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7276