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

Open
opened 2026-02-16 17:41:42 -05:00 by yindo · 2 comments
Owner

Originally created by @piliplaker on GitHub (Dec 25, 2025).

Originally assigned to: @thdxr on GitHub.

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

  • #3084: Read tool incorrectly detects model as non-image-capable
  • #2657: Reading images

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.

Originally created by @piliplaker on GitHub (Dec 25, 2025). Originally assigned to: @thdxr on GitHub. ## 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 - #3084: Read tool incorrectly detects model as non-image-capable - #2657: Reading images ## 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.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 25, 2025):

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

  • #5359: Unable to read images for some models
  • #5101: Switching from an image supported model to a non-image model breaks the thread
  • #3084: Read tool incorrectly detects model as non-image-capable

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

@github-actions[bot] commented on GitHub (Dec 25, 2025): This issue might be a duplicate of existing issues. Please check: - #5359: Unable to read images for some models - #5101: Switching from an image supported model to a non-image model breaks the thread - #3084: Read tool incorrectly detects model as non-image-capable Feel free to ignore if none of these address your specific case.
Author
Owner

@piliplaker commented on GitHub (Dec 25, 2025):

opencode version is 1.0.200

@piliplaker commented on GitHub (Dec 25, 2025): opencode version is 1.0.200
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3858