fix(bedrock): preserve dots in Bedrock inference profile model IDs - #12578
Closed
jessica025 wants to merge 1 commit into
Closed
fix(bedrock): preserve dots in Bedrock inference profile model IDs#12578jessica025 wants to merge 1 commit into
jessica025 wants to merge 1 commit into
Conversation
AIAgent._anthropic_preserve_dots() whitelist was missing 'bedrock'. The default normalize_model_name() converts dots to hyphens for OpenRouter compat (e.g. anthropic/claude-opus-4.6 -> claude-opus-4-6), which mangles Bedrock's cross-region inference profile IDs: us.anthropic.claude-sonnet-4-6 -> us-anthropic-claude-sonnet-4-6 Bedrock then rejects the mangled ID with: HTTP 400: The provided model identifier is invalid. This is a follow-up to PR NousResearch#10549 (native AWS Bedrock provider): the Bedrock path was wired up in runtime_provider.py and bedrock_adapter.py, but the dot-preservation whitelist missed it. Add 'bedrock' to the provider whitelist and 'bedrock-runtime' to the base_url match so Claude models on Bedrock work out of the box. Verified against us.anthropic.claude-sonnet-4-6, us.anthropic.claude-opus-4-7, and us.anthropic.claude-opus-4-6-v1.
jessica025
force-pushed
the
fix/bedrock-preserve-dots
branch
from
April 19, 2026 14:24
7177e25 to
cff3b3f
Compare
This was referenced Apr 22, 2026
Collaborator
Contributor
|
Thanks for the careful diagnosis and the clean reproduction steps, @jessica025! After reviewing current Evidence:
As @alt-glitch noted, this appears to be a duplicate of #12577 which addressed the same whitelist. Closing as already implemented on main. This is an automated hermes-sweeper review. |
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 Claude calls fail with
HTTP 400: The provided model identifier is invalidwhen using cross-region inference profile IDs such asus.anthropic.claude-sonnet-4-6.Root cause:
AIAgent._anthropic_preserve_dots()is missingbedrockfrom its whitelist. The defaultnormalize_model_name()converts dots → hyphens to normalize OpenRouter-style IDs (e.g.anthropic/claude-opus-4.6→claude-opus-4-6), which mangles Bedrock's inference profile IDs:Bedrock then rejects the mangled ID. This is a follow-up to #10549 (native AWS Bedrock provider) — the Bedrock path is wired up in
runtime_provider.py/bedrock_adapter.py, but this whitelist missed it, so Claude-on-Bedrock breaks end-to-end as soon as an inference-profile ID is needed.Reproduction
Configure Bedrock + any Claude model that requires a cross-region inference profile (Claude 4.6 / 4.7 family on-demand). Send any message →
HTTP 400: The provided model identifier is invalid.Confirmed the raw SDK call with the dotted ID works fine:
So it's purely a model-name normalization bug, not a credential / region / profile access issue.
Fix
run_agent.py::AIAgent._anthropic_preserve_dots()— addbedrockto the provider whitelist andbedrock-runtimeto the base_url match.Verification
Round-trip
AIAgent(...).chat(...)against Bedrock returns a proper response after the fix; before the fix it aborts onHTTP 400. Gateway end-to-end also works after restart.Verified with the following Bedrock inference profile IDs:
us.anthropic.claude-sonnet-4-6us.anthropic.claude-opus-4-7us.anthropic.claude-opus-4-6-v1All previously failed with the 400; all work after the fix.
Scope / side effects
provider == "bedrock"andbedrock-runtimeinbase_url).AnthropicBedrockSDK accepts dotted inference profile IDs natively — no further conversion needed downstream.