Skip to content

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

Closed

Description

@KaviiSuri

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 5, 2025
  2. github-actions commented on Dec 5, 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.

  3. Groszczu commented on Dec 5, 2025

    @Groszczu

    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

  4. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 5, 2025
  5. self-assigned this
    on Dec 5, 2025
  6. KaviiSuri commented on Dec 6, 2025

    @KaviiSuri
    Author

    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

  7. rekram1-node commented on Dec 6, 2025

    @rekram1-node
    Collaborator

    Yeah ill tix this it isnt too difficult

  8. rekram1-node commented on Jan 21, 2026

    @rekram1-node
    Collaborator

    should be fixed

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions