From aa7e82f3c5d29efe53dc10370bf2db4f63e838fe Mon Sep 17 00:00:00 2001 From: Aleks Clark Date: Fri, 13 Mar 2026 12:37:31 -0500 Subject: [PATCH] fix(bedrock): don't default baseURL to anthropic API when using bedrock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When useBedrock is true, the DefaultURL ("https://api.anthropic.com") was being set on providerOptions.baseURL in New(). This caused LanguageModel() to append option.WithBaseURL("https://api.anthropic.com") after bedrock.WithConfig had already set the correct bedrock-runtime URL, overwriting it. Only set the default base URL for non-bedrock providers. Bedrock gets its URL from bedrock.WithConfig() in the SDK. 🐙 Generated with Crush Assisted-by: AWS Claude Opus 4.6 via Crush --- providers/anthropic/anthropic.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/anthropic/anthropic.go b/providers/anthropic/anthropic.go index d4f6d1e50cd78118e7547e9181c4aaabb651ddc5..330c1ac5fbd67daa694899f048f0d88ef77d63de 100644 --- a/providers/anthropic/anthropic.go +++ b/providers/anthropic/anthropic.go @@ -68,7 +68,9 @@ func New(opts ...Option) (fantasy.Provider, error) { o(&providerOptions) } - providerOptions.baseURL = cmp.Or(providerOptions.baseURL, DefaultURL) + if !providerOptions.useBedrock { + providerOptions.baseURL = cmp.Or(providerOptions.baseURL, DefaultURL) + } providerOptions.name = cmp.Or(providerOptions.name, Name) return &provider{options: providerOptions}, nil }