Skip to content

fix(bedrock): preserve dots in model names for Bedrock inference profiles - #12577

Closed
superyhee wants to merge 1 commit into
NousResearch:mainfrom
superyhee:fix/bedrock-preserve-dots
Closed

superyhee wants to merge 1 commit into
NousResearch:mainfrom
superyhee:fix/bedrock-preserve-dots

Conversation

@superyhee

Copy link
Copy Markdown

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:

HTTP 400: The provided model identifier is invalid.

This fix adds "bedrock" to the _anthropic_preserve_dots() provider set so that dots are preserved when using the Bedrock provider.

Reproduce

  1. Set provider to bedrock with model global.anthropic.claude-opus-4-7
  2. Run hermes and send any message
  3. Get 400 error: "The provided model identifier is invalid"

Root Cause

_anthropic_preserve_dots() returns False for the bedrock provider, causing normalize_model_name() to transform:

  • global.anthropic.claude-opus-4-7global-anthropic-claude-opus-4-7

The Bedrock API rejects the hyphenated form.

Test plan

  • Verified aws bedrock-runtime converse works with global.anthropic.claude-opus-4-7
  • Verified AnthropicBedrock SDK works with the same model ID
  • Confirmed hermes conversation works after applying this patch

🤖 Generated with Claude Code

…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>
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Apr 23, 2026
@teknium1

Copy link
Copy Markdown
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.

@teknium1 teknium1 closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants