fix(bedrock): don't default baseURL to anthropic API when using bedrock

Aleks Clark created

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 <crush@charm.land>

Change summary

providers/anthropic/anthropic.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Detailed changes

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
 }