Switching from an image supported model to a non-image model breaks the thread #3322

Closed
opened 2026-02-16 17:39:39 -05:00 by yindo · 5 comments
Owner

Originally created by @KaviiSuri on GitHub (Dec 5, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When i plan out a project with something like Gemini 3.0 Pro or Opus 4.5, i send images to provide context around the UI or the wireframes. To 'build', i often switch to a cheaper model like GLM 4.6 or Kimi K2, which doesn't support image inputs.

OpenCode just throws 'Invalid API parameter, please check the documentation.' Error instead of ignoring images with a warning or generating a text description for those images and putting them in the context.

This makes the thread unusable with non-image models, and requires me to:

  1. do an /export
  2. copy paste the context into a new thread (that won't include images)
  3. start building with the lighter models

Would be amazing if we could handle this difference in modalities. would be happy to contribute/help out on this :).

Thank you so much for the work on OpencCode, it's my daily driver at this point.

OpenCode version

1.0.132

Steps to reproduce

  1. Use an image capable model like 'Gemini 3.0 Pro' or 'Claude Opus 4.5' in plan mode
  2. send images (wireframes/designs or just screenshot for inspirations) while planning
  3. switch to 'build' mode and select 'GLM 4.6' or any other non-image support model
  4. send any message
  5. observe that it throws 'Invalid API parameter, please check the documentation.'

Screenshot and/or share link

Image

Operating System

macOS 15.3.1

Terminal

Wezterm

Originally created by @KaviiSuri on GitHub (Dec 5, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When i plan out a project with something like Gemini 3.0 Pro or Opus 4.5, i send images to provide context around the UI or the wireframes. To 'build', i often switch to a cheaper model like GLM 4.6 or Kimi K2, which doesn't support image inputs. OpenCode just throws 'Invalid API parameter, please check the documentation.' Error instead of ignoring images with a warning or generating a text description for those images and putting them in the context. This makes the thread unusable with non-image models, and requires me to: 1. do an /export 2. copy paste the context into a new thread (that won't include images) 3. start building with the lighter models Would be amazing if we could handle this difference in modalities. would be happy to contribute/help out on this :). Thank you so much for the work on OpencCode, it's my daily driver at this point. ### OpenCode version 1.0.132 ### Steps to reproduce 1. Use an image capable model like 'Gemini 3.0 Pro' or 'Claude Opus 4.5' in plan mode 2. send images (wireframes/designs or just screenshot for inspirations) while planning 3. switch to 'build' mode and select 'GLM 4.6' or any other non-image support model 4. send any message 5. observe that it throws 'Invalid API parameter, please check the documentation.' ### Screenshot and/or share link <img width="1486" height="608" alt="Image" src="https://github.com/user-attachments/assets/688855d3-a5df-459d-9484-c5ce19f23913" /> ### Operating System macOS 15.3.1 ### Terminal Wezterm
yindo added the bug label 2026-02-16 17:39:39 -05:00
yindo closed this issue 2026-02-16 17:39:39 -05:00
Author
Owner

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

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

  • #4699: 'INVALID_PARAMETER_VALUE: Gemini models only support one system prompt' when using Databricks/OpenAI-compatible providers (same pattern of API parameter validation failures when switching between models with different capabilities)
  • #4573: '[FEATURE]: A config file parameter needs to be added to toggle whether image files should be processed when pasting file paths' (similar request to handle model capability differences, specifically for image handling)
  • #5012: 'DeepSeek model on Azure: "This model is not supported by Responses API" error' (related model incompatibility issue)

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

@github-actions[bot] commented on GitHub (Dec 5, 2025): This issue might be a duplicate of existing issues. Please check: - #4699: 'INVALID_PARAMETER_VALUE: Gemini models only support one system prompt' when using Databricks/OpenAI-compatible providers (same pattern of API parameter validation failures when switching between models with different capabilities) - #4573: '[FEATURE]: A config file parameter needs to be added to toggle whether image files should be processed when pasting file paths' (similar request to handle model capability differences, specifically for image handling) - #5012: 'DeepSeek model on Azure: "This model is not supported by Responses API" error' (related model incompatibility issue) Feel free to ignore if none of these address your specific case.
Author
Owner

@Groszczu commented on GitHub (Dec 5, 2025):

I'm also facing the same issue.
@KaviiSuri As a workaround, instead of the /export workflow, you can try /compact while still on an image-capable model. This summarizes the history, and truncates old messages, letting you continue your session with lighter models without API errors

@Groszczu commented on GitHub (Dec 5, 2025): I'm also facing the same issue. @KaviiSuri As a workaround, instead of the `/export` workflow, you can try `/compact` while still on an image-capable model. This summarizes the history, and truncates old messages, letting you continue your session with lighter models without API errors
Author
Owner

@KaviiSuri commented on GitHub (Dec 6, 2025):

I'm also facing the same issue. @KaviiSuri As a workaround, instead of the /export workflow, you can try /compact while still on an image-capable model. This summarizes the history, and truncates old messages, letting you continue your session with lighter models without API errors

Hey @Groszczu , nice workaround, but i'd still like this to not be a hassle tbh, compacting on every mode switch kinda degrades quality.

i'm not sure how issues get assigned here, but i might come up with a PR this weekend if i have some time to help out, would really love to have this work seemlessly

@KaviiSuri commented on GitHub (Dec 6, 2025): > I'm also facing the same issue. [@KaviiSuri](https://github.com/KaviiSuri) As a workaround, instead of the `/export` workflow, you can try `/compact` while still on an image-capable model. This summarizes the history, and truncates old messages, letting you continue your session with lighter models without API errors Hey @Groszczu , nice workaround, but i'd still like this to not be a hassle tbh, compacting on every mode switch kinda degrades quality. i'm not sure how issues get assigned here, but i might come up with a PR this weekend if i have some time to help out, would really love to have this work seemlessly
Author
Owner

@rekram1-node commented on GitHub (Dec 6, 2025):

Yeah ill tix this it isnt too difficult

@rekram1-node commented on GitHub (Dec 6, 2025): Yeah ill tix this it isnt too difficult
Author
Owner

@rekram1-node commented on GitHub (Jan 21, 2026):

should be fixed

@rekram1-node commented on GitHub (Jan 21, 2026): should be fixed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3322