fix(agent-core-v2): fall back to protocol default base URL when unconfigured - #1632
Merged
Merged
Conversation
…figured - drop the "missing a base URL" rejection in ModelResolverService so a structured provider without base_url resolves to undefined and the wire provider applies its protocol default endpoint, matching v1 - relax baseUrl to optional across Model, ModelImplInit, and ProtocolAdapterConfig; guard the anthropic /v1 strip against undefined
🦋 Changeset detectedLatest commit: ba87e6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Merged
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.
Related Issue
No linked issue — the problem is explained below.
Problem
In agent-core-v2, a structured model whose provider has no
base_urlconfigured (neither in config, provider, nor env) was rejected withCONFIG_INVALID("missing a base URL"). This is a regression from v1, whereprovider-managerlet providers without a configuredbase_urlfall back to their protocol's official default endpoint (e.g. the official Anthropic / OpenAI endpoints). Users migrating such configs to v2 hit a hard config error instead of the previous working behavior.What changed
ModelResolverService: removed theCONFIG_INVALIDthrow when a structured provider resolves no base URL;resolvedBaseUrlis nowstring | undefinedand the wire provider applies its protocol default endpoint, matching v1'sprovider-manager./v1stripping so it only runs when a base URL actually exists.baseUrlthrough theModel,ModelImpl,ProtocolAdapterConfig, andbuildProtocolProviderOptionstypes.anthropic,openai,openai_responses,kimi,google-genai) withoutbase_urlresolves toundefined; an anthropic-protocol override withoutbase_urlis left untouched; and flat models with neitherproviderIdnorbaseUrlare still rejected as before.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.