Repository navigation
Route models the catalog does not list yet, and serve OpenCode the hub's catalog - #6
Merged
Merged
Conversation
…b's catalog Claude Code started offering Mythos 5.2 before the hub's catalog listed it, so every request failed with "unknown provider for model claude-mythos-5-2". - A request for a model no credential lists is adopted on the provider it belongs to instead of failing: the request's /provider/<name> scope, a credential prefix or ID namespace (vibe/..., devin/...), or the provider serving the most models of its family (claude, gpt, gemini, grok, mistral, ...). Every registration path takes part, so it covers the built-in providers, Antigravity, plugins and OpenAI-compatible upstreams. Adopted models copy the capabilities of their closest sibling, survive catalog and token refreshes, reach credentials added later and honor excluded-models. There is no cap; the upstream's own error answers names it does not know. - Claude Mythos 5.1 and 5.2 are built-in Claude models. - GET /opencode/<access key>/api.json serves the hub's models as a models.dev catalog for OpenCode's OPENCODE_MODELS_URL. OpenCode cannot send headers on that fetch, so the key is in the path and masked in the request logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenCode 1.18 fails to load its providers when a saved login names a
provider the models catalog lacks, which is every login once the catalog
is the hub's. OPENCODE_AUTH_CONTENT={} keeps them out of that instance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Claude Code started offering Mythos 5.2 before the hub's catalog listed it, so every request failed with
API Error: 400 unknown provider for model claude-mythos-5-2. The remote models.json the hub refreshes from does not list it either.Models the catalog does not list yet
A request for a model no credential lists is now adopted on the provider it belongs to, then routed as usual. The provider comes from, in order:
/provider/<name>/scope;vibe/...→ the Vibe key,devin/...→ Devin);claude,gpt,gemini,grok,mistral,devstral, …): the provider serving the most models of that family, with a built-in table for families no account serves yet.Every registration path appends adopted models (static catalogs, Antigravity's live catalog, plugins, OpenAI-compatible upstreams), so adopted models survive catalog and token refreshes, reach credentials added later, and still honor excluded-models settings. They copy the capabilities (thinking levels, context, modalities) of their closest sibling. There is no cap. A name the upstream does not serve fails there, with the provider's own error. Home mode is unchanged: the control plane routes there.
Claude Mythos 5.1 and 5.2 are also built-in Claude models.
OpenCode catalog
GET /opencode/<access key>/api.jsonserves every hub model in the models.dev format OpenCode reads fromOPENCODE_MODELS_URL, under onet3code-proxyprovider: Claude models over the Anthropic Messages API, Codex models over Responses, the rest over chat completions. OpenCode sends no headers on that fetch, so the key is in the path; the request logs mask it.docs/t3code.mdhas the T3 Code setup.Tests
go test ./...andmake lintpass. New tests cover adoption by family, scope, prefix and namespace, OpenAI-compatible upstreams, excluded models, no cap, the handler path, and the catalog's format, auth and log masking.🤖 Generated with Claude Code