hermes - ✅(Solved) Fix Bedrock Mantle proxy: model name dots mangled to dashes (404) [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#13816Fetched 2026-04-23 07:48:48
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×3

Error Message

  1. Observe 404 error: The model 'anthropic-claude-opus-4-7' does not exist

Root Cause

_anthropic_preserve_dots() in run_agent.py checks for bedrock-runtime. in the base URL but Bedrock Mantle uses a different hostname pattern (bedrock-mantle.{region}.api.aws).

Fix Action

Fixed

PR fix notes

PR #13818: fix(agent): preserve dots in model names for Bedrock Mantle endpoints

Description (problem / solution / changelog)

What does this PR do?

Fixes _anthropic_preserve_dots() to recognize Bedrock Mantle (bedrock-mantle.{region}.api.aws) URLs, preserving dots in model IDs instead of converting them to dashes.

Related Issue

Fixes #13816

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Changes Made

  • run_agent.py (_anthropic_preserve_dots): Added "bedrock-mantle." to the base-URL heuristic alongside the existing "bedrock-runtime." check.
  • tests/agent/test_bedrock_integration.py (TestBedrockPreserveDotsFlag): Added two tests for Bedrock Mantle URLs (us-east-1, eu-west-1) and updated the negative test docstring.

How to Test

  1. Configure config.yaml with a Bedrock Mantle endpoint:
model:
  default: anthropic.claude-opus-4-7
  provider: custom
  base_url: https://bedrock-mantle.us-east-1.api.aws/anthropic
  api_mode: anthropic_messages
  1. Start a chat session -- the model name should be sent as anthropic.claude-opus-4-7 (dots preserved), not anthropic-claude-opus-4-7 (dots mangled to dashes).

Or run the tests:

scripts/run_tests.sh tests/agent/test_bedrock_integration.py -v

Checklist

Code

  • I have read the Contributing Guide
  • My commits follow Conventional Commits format
  • I have searched for existing PRs to avoid duplicates
  • This PR contains only related changes
  • pytest tests/ -q passes (42/42 in test_bedrock_integration.py; 1 pre-existing failure in test_minimax_provider.py unrelated to this change)
  • I have added tests that prove my fix is effective
  • I have tested on: Linux

Documentation & Housekeeping

  • Considered cross-platform impact (URL string matching only -- no platform-specific behavior)

Changed files

  • run_agent.py (modified, +1/-0)
  • tests/agent/test_bedrock_integration.py (modified, +26/-2)

PR #13821: fix(bedrock): preserve dots in model names for Bedrock Mantle proxy

Description (problem / solution / changelog)

What does this PR do?

Adds "bedrock-mantle." to the base-URL heuristic in _anthropic_preserve_dots(), alongside the existing "bedrock-runtime." check.

Related Issue

Fixes #13816

Root Cause

Bedrock Mantle (bedrock-mantle.{region}.api.aws) is an alternative Anthropic-compatible proxy for AWS Bedrock. It uses the same dotted model IDs as standard Bedrock (e.g. anthropic.claude-opus-4-7), but the URL heuristic in _anthropic_preserve_dots() only checks for bedrock-runtime. — missing the Mantle hostname pattern entirely.

Result: normalize_model_name() converts dots to dashes → anthropic-claude-opus-4-7 → HTTP 404.

Fix

One-line addition: or "bedrock-mantle." in base in the URL heuristic, consistent with the existing bedrock-runtime. check.

Type of Change

  • Bug fix (non-breaking change)

Tests

4 regression tests added in TestBedrockMantlePreserveDots:

  1. Reporter's exact URL pattern (bedrock-mantle.us-east-1.api.aws/anthropic)
  2. Different region (bedrock-mantle.eu-west-1.api.aws)
  3. End-to-end model name normalization with preserve_dots=True
  4. Negative test: unrelated AWS URLs don't trigger preservation

All 44 tests pass (40 existing + 4 new).

Changed files

  • run_agent.py (modified, +4/-1)
  • tests/agent/test_bedrock_integration.py (modified, +44/-0)

Code Example

model:
  default: anthropic.claude-opus-4-7
  provider: custom
  base_url: https://bedrock-mantle.us-east-1.api.aws/anthropic
  api_mode: anthropic_messages
RAW_BUFFERClick to expand / collapse

Bug Description

When using Amazon Bedrock Mantle (bedrock-mantle.{region}.api.aws) as a custom Anthropic-compatible endpoint, model names with dots (e.g. anthropic.claude-opus-4-7) are incorrectly converted to dashes (anthropic-claude-opus-4-7), causing HTTP 404 errors.

Steps to Reproduce

  1. Configure config.yaml:
model:
  default: anthropic.claude-opus-4-7
  provider: custom
  base_url: https://bedrock-mantle.us-east-1.api.aws/anthropic
  api_mode: anthropic_messages
  1. Start a chat session
  2. Observe 404 error: The model 'anthropic-claude-opus-4-7' does not exist

Expected Behavior

anthropic.claude-opus-4-7 should be sent as-is to the endpoint, preserving dots.

Actual Behavior

Dots are converted to dashes by _anthropic_preserve_dots() returning False, because the URL heuristic only checks for bedrock-runtime. but not bedrock-mantle..

Root Cause

_anthropic_preserve_dots() in run_agent.py checks for bedrock-runtime. in the base URL but Bedrock Mantle uses a different hostname pattern (bedrock-mantle.{region}.api.aws).

Proposed Fix

Add bedrock-mantle. to the URL pattern check in _anthropic_preserve_dots(), alongside the existing bedrock-runtime. check.

Environment

  • Hermes version: latest main
  • OS: Linux
  • Python: 3.11+

extent analysis

TL;DR

Update the _anthropic_preserve_dots() function in run_agent.py to include bedrock-mantle. in its URL pattern check to prevent dots in model names from being converted to dashes.

Guidance

  • Verify that the issue is indeed caused by the _anthropic_preserve_dots() function by checking the run_agent.py file and confirming the URL pattern check only includes bedrock-runtime.
  • Update the _anthropic_preserve_dots() function to include bedrock-mantle. in the URL pattern check, as proposed in the issue description
  • Test the updated function with a model name containing dots (e.g., anthropic.claude-opus-4-7) to ensure the dots are preserved and the 404 error is resolved
  • Consider adding additional logging or error handling to the _anthropic_preserve_dots() function to help diagnose any future issues

Example

def _anthropic_preserve_dots(base_url):
    # Update the URL pattern check to include bedrock-mantle.
    if 'bedrock-runtime.' in base_url or 'bedrock-mantle.' in base_url:
        return True
    return False

Notes

This fix assumes that the issue is solely caused by the _anthropic_preserve_dots() function and that updating the URL pattern check will resolve the problem. Additional testing and verification may be necessary to ensure the fix works as expected.

Recommendation

Apply the proposed workaround by updating the _anthropic_preserve_dots() function to include bedrock-mantle. in the URL pattern check, as this is a targeted fix that addresses the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING