Commit Graph
1 Commits
Author SHA1 Message Date
yetone 2df2e0886d plugin, provider, gateway: a plugin's model is listed with every kind it takes and gives (audio, video, pdf), not image alone (#1595, tkhs101)
The plugin host read a model's capabilities.input only for "image", and
fromModelsDev hard-coded output to text, so /v1/models listed
opencode-zen-free's muse-spark-1.3-contributor-free (models.opencode.ai:
input text/image/audio/video/pdf) as ["text","image"] with no output.

- host.js: fromModelsDev and the config merge keep modalities.input and
  .output whole; the listing sends inputs/outputs, the kinds the
  capabilities object marks true, in OpenCode's order.
- plugin.Model gets Inputs/Outputs; pluginCatalog puts them on
  catalog.Model's new InputModalities/OutputModalities (input only where
  the plugin said what it takes, as ImageInput already is).
- catalog: models.dev entries and a vendor's live list (now reading
  modalities.output) fill the same fields; Decorate carries the catalog's
  when the live list says nothing, beside ImageInput.
- provider.Entry.Modalities() is what the gateway lists: the source's
  kinds, with "image" still decided by Images, so the user's own
  "takes images" override still wins and the other kinds stay.

Not changed: the 7 models the report lists as having lost their levels
have reasoning_options [] upstream (models.opencode.ai), so "reasoning,
no levels" is what they are; mimo-v2.6-flash turns away levels (#214).
DSH's model kinds and Muse's list still say text/image only.

Tests: TestPluginModelModalities (gateway) with the reporter's literal
metadata: muse-spark's config as opencode-zen-free 0.1.3's configModels
writes it, and mimo-v2.6-flash-free's capabilities as its models hook
lists them; a model said nothing of stays unlisted, and the image
override drops image only. TestFetchedModalitiesKeepEveryKind (catalog).
Broken by hand: host.js without inputs gives the report's [text image]
(red); Entry.Modalities without the Inputs branch (red); Decorate
without the fill (red). Run: go test catalog, plugin, provider, gateway;
gofmt -l; GOOS=linux and windows go vet on the four; go test ./...
green on 76db4c6c2+this; after rebasing on e9b16ca18 the four packages
again: catalog, plugin and gateway green; provider red once in a run of
all four together (the failing test's name was cut off by a tail), then
green 3 runs of 3, two of them concurrent.
2026-10-11 20:56:21 +08:00