Skip to content

fix: Anthropic AWS models are named anthropic-aws.messages - #314

Closed
cunninghamcard-bit wants to merge 1 commit into
masterfrom
fix/anthropic-aws-models-are-named-anthropic-aws-messages
Closed

cunninghamcard-bit wants to merge 1 commit into
masterfrom
fix/anthropic-aws-models-are-named-anthropic-aws-messages

Conversation

@cunninghamcard-bit

Copy link
Copy Markdown
Contributor

Summary

Before: an Anthropic AWS model created without a name setting reported provider() == "anthropic-aws".

After: as in @ai-sdk/anthropic-aws 2.0.63, it reports "anthropic-aws.messages". A name setting still replaces it, and the providerOptions key stays anthropic.

Found while porting the upstream Anthropic AWS tests (case anthropicAws provider - model identity › sets the provider name to anthropic-aws.messages on the model). Part of the #276 list.

How it works today

create_anthropic_aws(settings)                         aimux-providers/src/anthropic_aws/mod.rs:139
├─ provider_options_name = CANONICAL ("anthropic") unless named
└─ name = settings.name.unwrap_or(DEFAULT_NAME)       :162   DEFAULT_NAME = "anthropic-aws"   :49
AnthropicAwsProvider::messages → AnthropicMessagesModel { config.provider = name }   :236
  └─ LanguageModel::provider() → "anthropic-aws"       ← upstream: createChatModel → provider: 'anthropic-aws.messages'
                                                         (anthropic-aws-provider.ts:246)

What this PR changes

const DEFAULT_NAME: &str = "anthropic-aws.messages";  mod.rs:50   (docs on the name setting and messages() follow)

Tests (tests/anthropic_aws_settings_test.rs): the_default_provider_name_is_anthropic_aws_messages checks the default and a named provider; on master it fails with left: "anthropic-aws", right: "anthropic-aws.messages". The upstream case is ported in the Anthropic AWS test PR.

Docs: CHANGELOG Fixed.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • New provider
  • New / updated binding
  • Docs / RFC

Checklist

  • cargo +1.99 fmt -p aimux-providers -- --check passes
  • cargo +1.99 clippy -p aimux-providers --lib --tests -- -D warnings passes
  • cargo +1.99 test -p aimux-providers --test anthropic_aws_settings_test passes (5)
  • scripts/check_provider_boundaries.sh passes
  • Updated relevant docs (CHANGELOG)
  • Commit messages follow Conventional Commits

Notes for reviewers

First of five Anthropic AWS fixes, stacked in this order (each on the previous one's branch): this PR ← image/PDF URLs ← missing SigV4 credentials ← credential producer failures ← default transport per request ← the test PR. Nothing else in the repository reads the default name.


Generated by Claude Code

@ai-sdk/anthropic-aws 2.0.63 gives its chat model the provider name
`anthropic-aws.messages` (anthropic-aws-provider.ts:246); aimux used
`anthropic-aws`. A `name` setting still replaces it, and the providerOptions
key stays `anthropic`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5

Copy link
Copy Markdown
Contributor Author

Folded into #318 together with the other Anthropic AWS fixes, so each vendor has one fix PR. This change is commit 77933f11 there. Closing this one; the branch stays as it is.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant