feat(models): enable vision for Kimi K3 - #34
Merged
Conversation
Kimi K3 supports image input but was missing from VISION_MODELS, so the plugin did not set attachment/modalities and OpenCode treated it as text-only. Add moonshotai/Kimi-K3 so image attachments work, matching Kimi K2.6.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
moonshotai/Kimi-K3toVISION_MODELSso OpenCode enables image attachments for it.Why
The plugin fetches chat models from
/v1/models/chatand enables vision (attachment: true+modalities.input: ['text','image']) only for IDs listed in the hardcodedVISION_MODELSset. Kimi K3 is a multimodal model (vision: truein the inference-api catalog) and is now live in prod, but it was missing from this set — so OpenCode treated it as text-only and rejected image input.Change
One line: add
"moonshotai/Kimi-K3"alongside"moonshotai/Kimi-K2.6".Test
tsc --noEmit✅vitest run→ 57 passed ✅Note
VISION_MODELSis a hardcoded allowlist that doesn't reflect thevisionflag already returned by/v1/models. A future improvement could make this data-driven (readcapabilities.visionfrom the API) so new vision models don't need a plugin release. Out of scope here.