Skip to content

First message with image doesn't use MCP vision tool even when available #6149

Closed as not planned

Description

@piliplaker

Bug Description

When sending the first message with an image in opencode, the system defaults to using the model's native vision capabilities even when MCP vision tools are available. If the model doesn't have vision capabilities, it will fail to see the image and report that it cannot view images. However, starting from the second message onwards, it correctly uses the MCP vision tool to process images.

Steps to Reproduce

  1. Configure opencode with an MCP vision server (e.g., vision-mcp-server)
  2. Use a model without native vision capabilities (e.g., non-vision model)
  3. Send the first message with an image attachment
  4. Observe the error message saying the model cannot see images
  5. Send a second message with the same image
  6. Observe that the MCP vision tool is correctly used this time

Expected Behavior

The system should consistently use MCP vision tools for image processing, regardless of whether it's the first message or subsequent messages. If MCP vision tools are available, they should be used even for the first image in a conversation.

Actual Behavior

  • First message with image: Attempts to use model's native vision → fails
  • Second message with image: Uses MCP vision tool → works correctly

Environment

  • opencode version: [Please specify]
  • MCP server: vision-mcp-server
  • Model: [Non-vision model]

Related Issues

Additional Context

This creates a poor user experience because users need to send two messages to get image analysis working. The inconsistency between first and subsequent messages suggests there's a state or initialization issue with how MCP tools are prioritized for the first message.

Activity

  1. github-actions commented on Dec 25, 2025

    @github-actions
    Contributor

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

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

  2. piliplaker commented on Dec 25, 2025

    @piliplaker
    Author

    opencode version is 1.0.200

  3. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions