Repository navigation
[FEATURE]: Auto Image Read - Automatic image preprocessing with dedicated image model #26160
Description
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
OpenCode is a harness on top of AI models that performs local operations to modify code. Most open-weight models don't support image input — they simply cannot process images at all.
When a user sends an image with a message using a model that doesn't support image input, the system either:
- Falls back to an error message: "This model doesn't support image input - I cannot view or analyze images."
- Completely replaces the image with an error token
This creates a significant limitation: as a full-stack or frontend developer, you can't pass any image to analyze and perform tasks based on that analysis. For example:
- Paste a screenshot of a UI and ask "which file controls this component?"
- Share a design mock and ask "update the logo to match this"
- Send a screenshot of an error and ask "what's causing this?"
There's no way to automatically route image analysis to a dedicated image-capable model while keeping the main task on the user's chosen model.
Proposed Solution
Implement an "Auto Image Read" feature that:
-
Automatic Image Detection & Preprocessing — When the current model doesn't support image input but the user sends an image, automatically use a dedicated image model to analyze it first. The analysis context (as text) is injected into the current session while the image data is removed to avoid input type conflicts.
-
Two Ways to Switch Image Model —
- Command Palette — Press
Ctrl+P(Mac) and typeSwitch Image Modelor shortsimto open the image model selection UI - Slash Command — Use
/image-modelsto switch the image model - Both allow users to view all connected providers' image-capable models, persist their preferred selection, and quickly switch between models
- Command Palette — Press
-
Visual Feedback — Show status indicator when the image model is processing, so users know something is happening
-
Seamless Integration — After the image model analyzes the image:
- Generate a detailed text description relevant to the user's query
- Replace the image in the message with a text description
- Remove the image from chat history entirely (to comply with non-image model constraints)
- Continue the conversation with the original model
- The main intelligent task remains on the user's chosen model — the image model only analyzes the image, keeping token cost minimal
Implementation Flow
User sends message with image attachment
│
▼
┌──────────────────────────────────────┐
│ Does current model support images? │
└──────────────────────────────────────┘
│
┌───────┴───────┐
▼ ▼
YES NO
│ │
▼ ▼
Continue Resolve Image Model
normally (local → config →
(skip) provider default)
│ │
│ ▼
│ ┌───────────────────┐
│ │ Call image model │
│ │ with describe │
│ │ prompt │
│ └───────────────────┘
│ │
│ ▼
│ ┌───────────────────┐
│ │ Generate text │
│ │ description │
│ └───────────────────┘
│ │
│ ▼
│ ┌───────────────────┐
│ │ Remove image │
│ │ parts, add │
│ │ synthetic text │
│ │ part │
│ └───────────────────┘
│ │
▼ ▼
Original model Continue with
sees image original model
(text only)
Image Model Resolution Chain
The image model is resolved in the following priority order:
- Explicit — Passed directly
- Config —
config.image_modelsetting (e.g.,openai/gpt-4o) - Fallback — First available image-capable model from any connected provider
Edge Cases
- No image model available — Fall through to existing error behavior
- Image model call fails — Log error, keep original error message, don't block conversation
- Multiple images — Send all images in a single batch call
- Mixed content — Include user's text as context for image description
- Subsequent turns — After preprocessing, no images persist in history
- Current model supports images — Skip preprocessing entirely
Benefits
- User Experience: Seamless image handling regardless of model capabilities
- Flexibility: Users can mix any text model with any image model — the image model doesn't need to be highly intelligent, it just analyzes the image while the main task is handled by the current model
- Cost-Effective: Minimal token cost since the image model only performs image analysis, not the main intelligent task
- Transparency: Images converted to text descriptions are marked as synthetic
- Extensibility: Can be extended to support other modalities (audio, video) in the future
- TUI only for now: Web support can follow after initial implementation
Activity
github-actions commentedon May 7, 2026
This issue might be a duplicate of existing issues. Please check:
vision_modelconfig field.image_transcription_model).Please review those issues and consider adding your input there rather than opening a new one.
github-actions commentedon Jul 8, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.