Skip to content

fix(core): let configured provider baseURL override catalog model endpoints - #57810

Merged
Tarquinen merged 2 commits into
devfrom
provider-baseurl-override
Oct 21, 2026
Merged

Tarquinen merged 2 commits into
devfrom
provider-baseurl-override

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A provider-level settings.baseURL in config no longer reached most catalog models. models.dev v2 now gives every opencode / opencode-go model its own provider.api, which core materializes as model.settings.baseURL; model settings overlay provider settings, so the catalog endpoint won and gateway users had to repeat baseURL for every model.

Configured provider baseURL now strips the catalog per-model baseURL from every model of that provider, not only models redefined in config. Each request format still appends its own path (/chat/completions, /responses, /messages, /models/<id>:streamGenerateContent), so a gateway can route on the suffix, matching the earlier provider-override behavior. A per-model settings.baseURL in config is applied later and still wins.

Fixes #56064

Testing

  • bun test test/config/provider.test.ts (new test fails without the change)
  • bun test test/config test/plugin test/provider* test/model*
  • bun run typecheck in packages/core

Requested by: @Tarquinen (dan via Slack)

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct. I ran the PR's new test against the base code: the catalog models you didn't list in config kept their catalog baseURL. With the change they use the configured provider baseURL, and a per-model baseURL set in config still wins. I also resolved the PR's test model that uses the Anthropic SDK through ModelResolver, and its request goes to the configured gateway. In packages/core, the related config, plugin, provider and model tests (762) and typecheck pass. I couldn't send a real request from the running app to a local server: the CLI from source didn't start in this environment, and the test driver forces its simulated model.

Public API: no keys are added or removed. The existing providers.<id>.settings.baseURL setting now also replaces the catalog's per-model endpoints for that provider's models, not just the models listed in config. This is backwards compatible for gateway users. One setup changes: anyone who sets a provider baseURL and relied on catalog models keeping their own endpoints will now send every model to that one base address. That's what the docs describe.

Also note: #56069, an open community PR, makes the same fix for the same issue, so one of the two should be closed.

Fixes #56064

@opencode-agent opencode-agent Bot closed this Oct 21, 2026
@opencode-agent
opencode-agent Bot deleted the provider-baseurl-override branch October 21, 2026 14:42
@Tarquinen
Tarquinen restored the provider-baseurl-override branch October 21, 2026 15:12
@Tarquinen Tarquinen reopened this Oct 21, 2026
@Tarquinen
Tarquinen enabled auto-merge (squash) October 21, 2026 15:17
@anomalyco anomalyco deleted a comment from opencode-agent Bot Oct 21, 2026
@Tarquinen
Tarquinen merged commit 870ab9d into dev Oct 21, 2026
21 of 22 checks passed
@Tarquinen
Tarquinen deleted the provider-baseurl-override branch October 21, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

baseURL ignored in recent versions

1 participant