Skip to content

fix: preserve dots in Bedrock inference-profile IDs (#12295) - #12336

Closed
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix/12295-bedrock-dots
Closed

fix: preserve dots in Bedrock inference-profile IDs (#12295)#12336
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix/12295-bedrock-dots

Conversation

@vominh1919

Copy link
Copy Markdown
Contributor

Fixes #12295

_anthropic_preserve_dots() didn't include 'bedrock' in the providers that preserve dots. AWS Bedrock inference-profile IDs like us.anthropic.claude-sonnet-4-5-20250929-v1:0 were mangled to us-anthropic-claude-sonnet-4-5-20250929-v1:0, causing HTTP 400.

Changes:

  • Added "bedrock" to provider set in _anthropic_preserve_dots()
  • Added "bedrock-runtime" to base_url fallback check
  • Added 4 unit tests for Bedrock dot preservation

…ch#12295)

AWS Bedrock inference-profile IDs like us.anthropic.claude-sonnet-4-5-20250929-v1:0
contain dots that must not be collapsed to hyphens. Without preserve_dots=True,
normalize_model_name() was mangling these IDs, causing HTTP 400 errors from Bedrock.

- Add 'bedrock' to the provider set in _anthropic_preserve_dots()
- Add 'bedrock-runtime' to the base_url URL check
- Add 4 new tests covering provider, URL, and normalize_model_name behavior
@mxnstrexgl

Copy link
Copy Markdown

✓ Automated scan: no security concerns. Bedrock profile ID fix.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/bedrock AWS Bedrock (boto3, IAM) labels Apr 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix alongside #12577, #12578, and #13112 — all address dots-to-hyphens mangling in Bedrock inference profile IDs. Closed #12297 was the same fix.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the fix, @vominh1919! This bug was real and the approach here is correct.

This is an automated hermes-sweeper review. After inspecting main, the exact changes proposed in this PR are already present:

  • "bedrock" in _anthropic_preserve_dots() provider set and "bedrock-runtime." in the base_url check were merged via commit 1cf1016e7 (fix(run_agent): preserve dotted Bedrock inference-profile model IDs (#11976)).
  • A broader follow-up, commit f2fba4f9a (fix(anthropic): auto-detect Bedrock model IDs in normalize_model_name (#12295)), extended the fix to cover auxiliary client calls that bypass preserve_dots entirely.

Both commits are confirmed ancestors of the current main HEAD. As @alt-glitch noted, this was addressed alongside competing PRs #12577, #12578, and #13112. 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 P2 Medium — degraded but workaround exists provider/bedrock AWS Bedrock (boto3, IAM) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bedrock Claude inference-profile IDs get dot-collapsed to hyphens -> BadRequestError 400

4 participants