From 8924b0162bf2e2a2b0665a98df0759786f4a011f Mon Sep 17 00:00:00 2001 From: Aleks Clark Date: Thu, 12 Mar 2026 08:52:10 -0500 Subject: [PATCH] fix(bedrock): apply base URL override after bedrock.WithConfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bedrock.WithConfig internally calls option.WithBaseURL with the default regional endpoint, clobbering any user-provided base_url. Move the custom base URL append to after the bedrock config block so last-write wins. 🐨 Generated with Crush Assisted-by: AWS Claude Opus 4.6 via Crush --- providers/anthropic/anthropic.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/providers/anthropic/anthropic.go b/providers/anthropic/anthropic.go index 5c7b1d4ed3123bbd5c0fad46f3d5b5e9383ab9ac..d4f6d1e50cd78118e7547e9181c4aaabb651ddc5 100644 --- a/providers/anthropic/anthropic.go +++ b/providers/anthropic/anthropic.go @@ -156,7 +156,7 @@ func (a *provider) LanguageModel(ctx context.Context, modelID string) (fantasy.L if a.options.apiKey != "" && !a.options.useBedrock { clientOptions = append(clientOptions, option.WithAPIKey(a.options.apiKey)) } - if a.options.baseURL != "" { + if !a.options.useBedrock && a.options.baseURL != "" { clientOptions = append(clientOptions, option.WithBaseURL(a.options.baseURL)) } defaultUA := httpheaders.DefaultUserAgent(fantasy.Version) @@ -205,6 +205,9 @@ func (a *provider) LanguageModel(ctx context.Context, modelID string) (fantasy.L ) } } + if a.options.baseURL != "" { + clientOptions = append(clientOptions, option.WithBaseURL(a.options.baseURL)) + } } return languageModel{ modelID: modelID,