Files
yetone 48f9764027 plugins: a model served on more APIs keeps the client's (gaubeebangeel on X)
gaubeebangeel on X: OpenDesign's Anthropic requests to an Open Design
Cloud account were all sent upstream as chat completions. The Open
Design plugin declares each model on one AI SDK package (chat
completions for most, Responses for deepseek-v4-pro and claude-haiku-5.5,
plugins#141), and pluginAPIs gave a plugin model that one API alone, so
attempt never relayed a /v1/messages request and translated it, though
amr-link serves every model on all three (plugins#888). A DeepSeek
API-key provider, the case first suspected, relays to /anthropic/v1/messages
as sent: tried with OpenCode's, node's and no User-Agent, bare and
prefixed ids, and web search.

A plugin model can now list the other APIs its vendor serves it on, as
their AI SDK packages (m.also; plugin.Model.Also through host.js, config
model and models hook). pluginProtocols gives the model's own API first,
then those; ListedAPIs, the catalog's APIs and the provider's bases come
from it, so a client's request on any of them is relayed as sent. usable
puts a plugin model's own API first, so a request on an API it isn't
served on is still translated to the declared one. A model with no also
is unchanged. opendesign 0.1.13 (plugins 397da020) sets also on every model.

Test: TestPluginModelServedOnMoreAPIsKeepsTheClientAPI (fake plugin,
FAKE_ALSO): Anthropic, Responses and Chat requests to the also model
reach the upstream on their own path; fake-1 (no also) is still
translated to /chat/completions. Red on HEAD's plugins.go: Anthropic and
Responses reached /v1/chat/completions, ListedAPIs and usable were [chat].

Run (mote unless said): go test ./internal/provider ./internal/plugin
./internal/catalog ok; go test ./internal/gateway ok (972s);
GOOS=linux/windows go vet of the three packages ok; gofmt clean.
Not run: the full ./... suite (mote and mica each had full suites
queued under suite.lock); not tried against a real amr-link account
(keyblues's plugins#888 measurements are the evidence it serves
/v1/messages for every model).
2026-11-14 02:14:31 +08:00
..