You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ttachment: true in custom provider model config has no effect - image upload blocked with 'does not support image input' #33542
When defining a custom provider with npm: "@ai-sdk/anthropic" and explicitly setting "attachment": true on a model, uploading an image still results in the error:
ERROR: Cannot read "<path>.jpg" (this model does not support image input). Inform the user.
The image is never sent to the provider — it is blocked at the frontend level before any API call is made.
Steps to Reproduce
Configure a custom provider in opencode.jsonc using npm: "@ai-sdk/anthropic" with a custom baseURL (Anthropic-compatible proxy):
Start opencode with this provider and model selected.
Try to attach an image (drag-and-drop or @ file reference).
Expected Behavior
The "attachment": true field declared in the model config should be respected, and the image should be passed to the model.
Actual Behavior
OpenCode blocks the image at the frontend with this model does not support image input, ignoring the attachment: true config.
Additional Context
The underlying API does support image input. Verified by calling the provider's /v1/messages endpoint directly with a base64-encoded image — the model correctly describes the image.
The attachment field is present in the OpenCode JSON schema (https://opencode.ai/config.json), so it appears to be an intentional config option.
The issue persists after a full restart of opencode.
Using @ file path reference also does not work — the file is read by the tool but image data is not passed to the model context.
Root cause hypothesis: The frontend checks model vision capability against the provider's models metadata (likely via /v1/models endpoint or hardcoded list), and attachment: true in opencode.json is not consulted. The check happens before the request is built, so the image is dropped client-side.
Suggestion: The frontend should check both:
Provider/model metadata for vision support, AND
"attachment": true in the model config as an override
Until fixed, the workaround is calling the vLLM API directly with base64 images. This is functional but breaks the opencode workflow — images cannot be part of the conversation context.
Activity
github-actions commentedon Jun 23, 2026
This issue might be a duplicate of existing issues. Please check:
attachment: trueconfig being ignored, image input blocked at the frontend level (workaround described there matches your config)cipherfoxie commentedon Jul 6, 2026
Update: Confirmed on local Qwen3.6-35B via vLLM —
attachment: truestill blocks images at frontend.Environment:
localhost:30001"attachment": trueset on model +"attachment.image"config at root levelTest results:
"attachment": truein model config → still blocked by frontend with "does not support image input""attachment.image"root config (auto_resize, max_width/height, max_base64_bytes) → applied but irrelevant since image never reaches APIwebfetchvia URL → works but I cannot "see" images (only metadata), not real visionWorkaround that works:
Root cause hypothesis: The frontend checks model vision capability against the provider's
modelsmetadata (likely via/v1/modelsendpoint or hardcoded list), andattachment: trueinopencode.jsonis not consulted. The check happens before the request is built, so the image is dropped client-side.Suggestion: The frontend should check both:
"attachment": truein the model config as an overrideUntil fixed, the workaround is calling the vLLM API directly with base64 images. This is functional but breaks the opencode workflow — images cannot be part of the conversation context.
github-actions commentedon Sep 5, 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.