Skip to content

Feature Request: Automatic Image Vision Processing for Non-Vision Models #21004

Closed as not planned

Description

@3964tian

Feature Request: Automatic Image Vision Processing for Non-Vision Models

Problem

When users paste images directly into the OpenCode input field, OpenCode sends the image data to the AI model. However, many models (like MiniMax via API) don't support image input, resulting in errors like:

ERROR: Cannot read "image.png" (this model does not support image input)

This creates a poor user experience where:

  1. User pastes an image
  2. OpenCode sends it to the model
  3. Model rejects it with an error
  4. User has no way to analyze the image

Proposed Solution

Add an automatic image processing feature that:

  1. Detects when a user pastes an image (vs. text)
  2. Checks if the target model supports vision (via model capabilities config)
  3. If model doesn't support vision:
    • Automatically call a local vision API (e.g., Ollama with vision model, or local Qwen2.5-Vision)
    • Get the image description
    • Send the description as text to the target model

Alternative: Vision API Integration

Allow users to configure a fallback vision provider in their OpenCode config:

{
  "vision": {
    "provider": "ollama",  // or "openai", "anthropic", etc.
    "model": "qwen2.5-vision",
    "endpoint": "http://localhost:11434"
  },
  "visionFallback": true  // auto-use vision provider for image analysis
}

Benefits

  1. Better UX - Images just work, even with non-vision models
  2. Privacy - Keep image processing local (using Ollama)
  3. Flexibility - Users can choose their preferred vision provider
  4. Backward compatible - Only activates when vision fallback is enabled

Implementation Hints

  • Hook into the message composition/pre-send phase
  • Check userMessage.content for image data (base64 or file reference)
  • If settings.visionFallback === true, intercept and process images
  • Call configured vision API and replace image content with description

Environment

  • OpenCode version: 1.1.61
  • OS: macOS
  • Model: MiniMax (via API, no vision support)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 4, 2026
  2. github-actions commented on Apr 4, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature request titles must start with [FEATURE]: (current title uses "Feature Request:" instead)
    • Feature requests require the verification checkbox confirming the feature hasn't been suggested before

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. jensenojs commented on Apr 4, 2026

    @jensenojs
    Contributor

    This isn't a new issue, although I do really want to move forward with solving it. Mimo v2 Pro (which doesn't support image recognition) should be able to invoke Mimo Omni when it detects an image.

    Actually, Minimax has an MCP for image recognition that follows exactly this approach, but it seems that due to Opencode limitations, the image path must be explicitly specified for it to call the corresponding tool. Also, does Opencode currently have some automatic image translation logic? When I try to paste a path, it pastes the file itself.

  4. github-actions commented on Apr 4, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions