[Bug/UX] Cannot add a new model to a multi-protocol catalog route (opencode) from the GUI — "needs an api" with no way to set it #3791
Replies: 1 comment
|
Same wall here, and worth noting it is not only a GUI gap: the profile schema itself cannot express a per-model protocol. const api = request.api ?? base?.api ?? routeApi; // lib/index.js:666where Declaring the protocol at the route level, as the error message suggests, is destructive on such a route: Declaring a second route (e.g. Proposal — add an optional per-model const api = entry.api ?? request.api ?? base?.api ?? routeApi;
const baseUrl = entry.baseURL ?? request.baseURL ?? base?.baseUrl ?? providerBaseUrl;
Concrete trigger, if a reproduction is useful: |
Uh oh!
There was an error while loading. Please reload this page.
[Bug/UX] Cannot add a new model to a multi-protocol catalog route (opencode) from the GUI — "needs an api" with no way to set it
Summary
On
opencode(a pi-ai installed-catalog provider), fetching the model list from the GUI returns only the models in pi-ai's static catalog snapshot, not the liveGET /modelsresult. New models opencode ships after the snapshot (e.g.x-preview-f-free,gemini-3.7-flash,grok-4.6,kimi-k3, …) never appear.Trying to add such a model by hand in the GUI fails with:
…but the GUI offers no way to set an
apifor that model: the add-provider form collects only the API key and a base URL (no protocol field), and on a catalog route there is no route-level protocol control either.apiis route-level only, not per-model. So the action the GUI exposes (add a model) is un-completable for any model outside the snapshot on a multi-protocol catalog route — the only workaround is hand-editingsettings.yaml.Repro
opencode(the form only asks for the API key and a base URL).curl https://opencode.ai/zen/v1/modelsreturns 64.gemini-3.7-flash,gpt-5.3-codex-spark,grok-4.6,hy3-free,kimi-k3,muse-spark-1.2,muse-spark-1.2-contributor-free,nemotron-3.5-lightning-free,x-preview-f-freex-preview-f-freein the GUI → theneeds an apierror above.Root cause (three layers)
Snapshot vs live:
llm-pi-aianswers a catalog route's model list from the installed pi-ai snapshot with no network call (by design — it carries contextWindow/price/thinking metadata the listing endpoint does not provide). The snapshot lags the live/models.apiis route-level, not model-level:PiAiModelProfilehas noapifield; onlyPiAiProviderProfile.apiexists. For a catalog route the GUI deliberately does not offer a route-level protocol ("a catalog route's models each carry theirs, so a route-level protocol there could only override every one of them").opencodeis exactly such a multi-protocol catalog — its snapshot spansanthropic-messages,google-generative-ai,openai-completions, andopenai-responses.The live endpoint does not disclose the protocol: opencode's
GET /modelsreturns only{id, object, created, owned_by}— no protocol/modality info. So even fetching the live list would not let the harness infer which wire protocolx-preview-f-freespeaks.Net effect: a new model on a multi-protocol catalog route is un-addable from the GUI and requires hand-editing
settings.yaml.Suggested fixes (any combination)
api(protocol) selector for a model the catalog does not describe — or let the add-model flow accept a protocol choice.apioverride on a model entry, or an explicit "hand-declared extra model" list on a catalog route that carries its own protocol./modelsreturn protocol/modality metadata per model, so a live fetch could route a new model correctly.Environment
@deepseek-ai/dsh0.1.0-rc.7,@deepseek-ai/dsh-llm-pi-ai0.1.0-rc.8@earendil-works/pi-ai0.82.1opencode, base URLhttps://opencode.ai/zen/v1(form collects key + base URL only, no per-model protocol)All reactions