Repository navigation
Image Clipboard Paste Not Working in OpenCode #10154
Description
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:latestandgemini-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
- Added explicit capabilities: Configured
"input": ["text", "image"]for vision-capable models - Qwen3 VL model: Vision-specific model also doesn't work with clipboard paste
- File path reference via @ syntax: Attempted
@Pictures/Screenshots/reference method - also does not work
Findings
- Error suggests clipboard read failure, not model capability issue
- File path reference via @ syntax does not work for images, despite being attempted
Reproduction Steps
- Configure OpenCode with Ollama provider running cloud models as local models
- Copy any image to clipboard (e.g., screenshot)
- Paste into OpenCode TUI conversation
- Ask "Can you see [Image 1]?"
- Observe the error about clipboard read failure
Additional Testing Results
- @ file path syntax also fails: Attempted
@Pictures/Screenshots/and@2026-01-09_10-59-43.pngreferences 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
Operating System
nixos 'unstable'
Terminal
Alacritty
Activity
github-actions commentedon Jan 23, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
ehab-oss commentedon Jan 25, 2026
I'm aware of the 'ollama launch' command, though I haven't tested it so far.
Raw1mage commentedon 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:
372572571 commentedon 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
github-actions commentedon Apr 11, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
0xAlcibiades commentedon Apr 21, 2026
This is still an issue.
aacassandra commentedon May 2, 2026
This is still an issue, but it's not a limitation of OpenCode — it's a terminal limitation.
Terminal Compatibility
✅ Works:
❌ Doesn't work:
Workaround for macOS Terminal Users
If you're using a standalone terminal on macOS, you can use this workaround:
1. Install pngpaste
2. Add helper function to your shell config
For zsh (default on macOS), add to
~/.zshrc:For bash, use
~/.bashrcinstead.3. Reload your shell config
4. Usage
clipimgin terminalCmd+V) into OpenCode promptRecommended Solution
For the best experience on macOS, use VSCode's integrated terminal — it has native clipboard image support and works perfectly with OpenCode.
0xAlcibiades commentedon May 2, 2026
I was using Alacritty which falls under "standalone terminal" but this sort of thing works fine in claude code in the same. What I'm seeing is that it's getting an internal error even though opencode shows "Image" in the input box. Exactly the error above. I don't think "use vscode" is a valid solution to the issue here.
guiorioli commentedon May 14, 2026
Running ollama launch opencode with kimi-k2.6 here. Same paste I can do on ollama launch claude without problems, fails on opencode.
MfCrizz commentedon May 15, 2026
Same for me. Opencode 1.14.35 with llama-cpp and qwen 3.6 27B
guiorioli commentedon May 15, 2026
Ok, I figured out, I had to add 'modalities' 'input' 'image' to my model in opencode.json
"modalities": {
"input": [
"text",
"image"
],
"output": [
"text"
]
}
MfCrizz commentedon May 16, 2026
Can confirm this, thank you!