Conversation
…iles Bedrock cross-region inference profiles use dots in model IDs (e.g. global.anthropic.claude-opus-4-7, us.anthropic.claude-sonnet-4-6). normalize_model_name() converts dots to hyphens by default, which breaks Bedrock API calls with HTTP 400: "The provided model identifier is invalid." Add "bedrock" to the _anthropic_preserve_dots() provider set so that dots are preserved when using the Bedrock provider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Thanks for the thorough write-up and the well-scoped fix, @superyhee! This one was already landed on the same day you opened the PR. This is an automated hermes-sweeper review.
The bug you caught and diagnosed is real and was P1-worthy — it just happened to be fixed concurrently. Closing as implemented on main. |
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.
Summary
Bedrock cross-region inference profiles use dots in model IDs (e.g.
global.anthropic.claude-opus-4-7,us.anthropic.claude-sonnet-4-6).normalize_model_name()converts dots to hyphens by default, which breaks Bedrock API calls with:This fix adds
"bedrock"to the_anthropic_preserve_dots()provider set so that dots are preserved when using the Bedrock provider.Reproduce
bedrockwith modelglobal.anthropic.claude-opus-4-7hermesand send any messageRoot Cause
_anthropic_preserve_dots()returnsFalsefor thebedrockprovider, causingnormalize_model_name()to transform:global.anthropic.claude-opus-4-7→global-anthropic-claude-opus-4-7The Bedrock API rejects the hyphenated form.
Test plan
aws bedrock-runtime converseworks withglobal.anthropic.claude-opus-4-7AnthropicBedrockSDK works with the same model IDhermesconversation works after applying this patch🤖 Generated with Claude Code