What
A user provider block can override options.baseURL but not npm. The catalog's npm wins while the user's baseURL wins, so the two get combined into a request that cannot succeed anywhere.
Reproduction, from a real session
Config in ~/.config/redcode/opencode.jsonc:
models.dev catalog for the same provider:
npm: @ai-sdk/anthropic
api: https://api.minimax.io/anthropic/v1
What actually went out, from the durable error record (metadata.url):
https://api.minimax.chat/v1/messages → 404 page not found
/v1/messages is the Anthropic path, so the SDK came from the catalog; the host came from the user config. Neither source describes that combination.
Probed each candidate directly — 401 means the route exists and only auth was missing, 404 means it does not exist:
401 https://api.minimax.io/anthropic/v1/messages ← catalog pair, valid
401 https://api.minimax.chat/v1/chat/completions ← user pair, valid
404 https://api.minimax.chat/v1/messages ← what Redcode requested
Both coherent pairs work. Only the mixture fails.
Why it matters
The failure is silent and misattributed. Nothing reports that the npm override was dropped, so the user reasonably concludes their endpoint is wrong — it is not. Both halves of their intent were individually reasonable.
Possible directions, not a decision
- Honour
npm from user config the way options already is, or
- Reject the config with a clear error when
npm is supplied and cannot be applied, or
- Validate coherence between the resolved
npm and baseURL and fail loudly at resolution rather than at request time.
Whichever way, the asymmetry should stop being silent.
What
A user provider block can override
options.baseURLbut notnpm. The catalog'snpmwins while the user'sbaseURLwins, so the two get combined into a request that cannot succeed anywhere.Reproduction, from a real session
Config in
~/.config/redcode/opencode.jsonc:models.dev catalog for the same provider:
What actually went out, from the durable error record (
metadata.url):/v1/messagesis the Anthropic path, so the SDK came from the catalog; the host came from the user config. Neither source describes that combination.Probed each candidate directly — 401 means the route exists and only auth was missing, 404 means it does not exist:
Both coherent pairs work. Only the mixture fails.
Why it matters
The failure is silent and misattributed. Nothing reports that the
npmoverride was dropped, so the user reasonably concludes their endpoint is wrong — it is not. Both halves of their intent were individually reasonable.Possible directions, not a decision
npmfrom user config the wayoptionsalready is, ornpmis supplied and cannot be applied, ornpmandbaseURLand fail loudly at resolution rather than at request time.Whichever way, the asymmetry should stop being silent.