A plugin provider's list counted every model it named as a chat model.
XYenon's Google AI Studio plugin put gemini-embedding-001 and its TTS
models in the chat chips, the agents' lists and /v1/models. The plugin
does declare them: the embedding's capabilities.output is
{"text": false} and the TTS's says audio only. But the host's kinds()
kept only the true keys. That made "said it gives nothing" look the same
as "said nothing", and pluginCatalog never read Outputs.
- host.js passes outputsSaid, which is whether capabilities.output says
yes or no to any kind (kindsSaid). It goes into plugin.Model.OutputsSaid.
- pluginCatalog leaves out a model whose outputs were declared and name
no text, image or video (pluginTalks). Every chat list is built from
that list: /v1/models, provider.Catalog (the agents' lists and routing),
and Available (the editor's chips).
- A plugin that says nothing about outputs keeps every model, whatever
the id. Image-only and video-only models stay where they are; #2792
decides where they go.
Ported from ggbdpq's hunt65-c-3279-kinds (7391b0df2), with changes
after review. That patch found the right place (pluginCatalog) and
wrote the provider tests kept here. It judged an embedding by "embed" in
its id, because the host drops the declaration. So an embedding named
otherwise (bge-m3, text:false) stayed in the list. A plugin that says
nothing about outputs lost any model whose id held "embed" or "-tts",
which changes today's behaviour. An image-only model (outputs ["image"])
was dropped, though the patch said it left #2792's models alone. This
version fixes the declaration in the host instead and guesses nothing
from ids. catalog.textModel is unchanged.
Docs: docs/subsystems/provider-plugins.md, "A model that gives no text".
Run (mote, at base 96a703a59; then rebased onto 9f25de56c, which
changed only two mover mins, and ./internal/provider plus the e2e test
run again there: ok):
- TestPluginModelGivingNoTextLeavesTheChatLists (gateway, a real Bun
host with the fake plugin under FAKE_KINDS, using XYenon's literal
capabilities) is red on main: the embedding and the TTS are in
/v1/models, the agents' catalog and Available. It is green with this
change.
- go test -count=1 -timeout 45m ./internal/plugin ./internal/provider
./internal/gateway: ok (plugin 165s, provider
121s, gateway 759s).
- GOOS=linux and GOOS=windows go vet of the three packages: clean.
gofmt -l: clean.
Broken by hand:
- host.js without outputsSaid: the e2e test is red (embedding, bge-m3
and TTS listed; rerun at this base).
- pluginTalks always true: the e2e test and both provider tests are red
(rerun at this base: embedding, bge-m3 and TTS listed in each).
- ggbdpq's original product change with these tests: the e2e test is red
on bge-m3. The unit test is red on bge-m3 kept, imagen-4 lost and
embedder-chat lost.
Not tried: the reporter's real plugin with a Google AI Studio account.
The fixture is the plugin's parseModels output and the report's own
row. A TTS or embedding model still has no route of its own here.
Not run: the full ./... suite, and the GUI suite (no GUI file changed).
Co-authored-by: ggbdpq <ggbdpq@gmail.com>