Skip to content

[FEATURE]: Transcribe images to text when the selected model has no vision support #48332

Open

Description

@savasturkoglu1

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

When the selected model does not support image input and I paste a screenshot, the request fails with:

ERROR: Cannot read "<file>" (this model does not support image input). Inform the user.

I then have to retype the screenshot contents by hand.

Proposal: if the prompt contains an image and the selected model cannot read images, transcribe the image to text with a vision-capable model and inject that text into the request. The selected model stays unchanged, and the image stays visible in the UI. No error is shown to the user.

Fallback order:

  1. experimental.vision_model config override, if set.
  2. A vision-capable model from the same provider as the selected model.

The image must never be sent to a different provider than the selected one. A fully local OCR fallback for providers with no vision model at all is tracked separately in #48333.

Related work: this is narrower than #46794 (which proposes switching the active model) and complements #42758 (images degrade to a placeholder).

Out of scope for the first PR: PDF/audio/video, media inside tool results, and the V2 session runner (V1 is the live path today).

I have a working prototype of the V1 path with tests and can open a PR after a design review.

Activity

  1. github-actions commented on Sep 10, 2026

    @github-actions
    Contributor

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

    Your issue is distinct in proposing a provider-constrained vision-model transcription step (same provider first, then local OCR), which is a more complete fallback strategy than either of the above individually. Linking these so the maintainers can decide whether to consolidate or treat yours as a separate proposal.

  2. savasturkoglu1 commented on Sep 10, 2026

    @savasturkoglu1
    Author

    Thanks for linking these.

  3. morpheus9393 commented on Oct 10, 2026

    @morpheus9393

    Big +1 from us — we run text-only coding models (GLM-5.x / DeepSeek tiers) as daily drivers in production and this is the single biggest quality-of-life gap in OpenCode for that setup.

    Right now the practical workaround is an external plugin that proxies pasted images through a vision-capable model and swaps in the description. It works, but it has to be maintained against every plugin-API change, and the capability (knowing which models see images, and rewriting the message) is something the host already has all the information for — model capabilities are already tracked, the image pipeline is already normalized/hosted. Having this as a first-class option (e.g. a \�isionFallbackModel\ config, or a per-session toggle that keeps the selected model and only transcribes attachments) would remove an entire class of third-party plugin churn for us and, judging by the cluster of related issues here, for a lot of other developers running text-only models on coding plans too.

    For us this is not a nice-to-have: teammates regularly paste screenshots, mockups and error photos into chat, and the model just gets [Attached image/png: ...]. Anything the team can prioritize here would be genuinely appreciated — happy to test an implementation on real workloads.

  4. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed proposal, @savasturkoglu1!

    To restate it: when the selected model can't read images, OpenCode would transcribe a pasted image to text with a vision-capable model and add that text to the request. That model would be experimental.vision_model if set, otherwise a vision model from the same provider, so the image never goes to a different provider. The selected model stays the same and no error is shown. Maintainers will look at it and decide.

    One note on scope: the error you quote (Cannot read "<file>" (this model does not support image input)) comes from the v2 session code (unsupportedParts() in packages/core/src/session/model-request.ts), and v2 is where new features are built now. A design or PR would need to target that path, not v1.

    It might also work as a plugin in v2. The session context hook lets plugins change the outgoing messages before unsupported images are replaced, so a plugin could swap image parts for transcribed text. That only works if the plugin can call a vision model itself.

    Related issues:

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