hermes - ✅(Solved) Fix Custom provider model names with dots are incorrectly converted to hyphens [1 pull requests, 2 comments, 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#14575Fetched 2026-04-24 06:16:27
View on GitHub
Comments
2
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×2closed ×1cross-referenced ×1

Error Message

  1. Observe HTTP 503 No available accounts error

Root Cause

The normalize_model_name() function in agent/anthropic_adapter.py unconditionally replaces dots with hyphens:

def normalize_model_name(model: str, preserve_dots: bool = False) -> str:
    if not preserve_dots:
        model = model.replace(".", "-")
    return model

The _anthropic_preserve_dots() method in run_agent.py only returns True for a hardcoded list of providers and base URLs:

  • alibaba, minimax, minimax-cn
  • opencode-go, opencode-zen
  • zai, bedrock
  • Specific base URLs like dashscope, aliyuncs, etc.

Custom providers are not included, so any model name with dots gets mangled.

Fix Action

Fixed

PR fix notes

PR #14576: fix: preserve dots in model names for custom providers with anthropic_messages

Description (problem / solution / changelog)

Summary

Fixes model name dot-to-hyphen conversion for custom providers using api_mode: anthropic_messages.

Problem

When using a custom provider (e.g., a proxy service) with api_mode: anthropic_messages, model names containing dots (e.g., kimi-k2.6) are converted to hyphens (kimi-k2-6). This causes the proxy provider to return HTTP 503 because it does not recognize the transformed model name.

Root Cause

The _anthropic_preserve_dots() method used a hardcoded allowlist of providers and base URLs that should preserve dots. This approach doesn't scale — every new third-party proxy needs an upstream code change.

Solution

Reversed the logic: Instead of maintaining an allowlist of providers that preserve dots, we now only normalize dots for the native Anthropic API (provider="anthropic" or base_url=api.anthropic.com). All other providers receive the model name exactly as configured by the user.

This is a breaking change in behavior for the allowlist, but it's the correct long-term approach:

  • Users configure kimi-k2.6 → hermes sends kimi-k2.6 (not kimi-k2-6)
  • Users configure anthropic.claude-opus-4-7 → hermes sends anthropic.claude-opus-4-7
  • Only provider="anthropic" gets claude-sonnet-4.6claude-sonnet-4-6

Changes

  • run_agent.py: Replaced allowlist with denylist — only native Anthropic normalizes dots
  • tests/agent/test_minimax_provider.py: Added 2 unit tests for custom provider behavior

Testing

  • All TestMinimaxPreserveDots tests pass (14/14)
  • Full test_minimax_provider.py suite: 42/43 pass (1 pre-existing failure unrelated to this change)

Related Issues

  • Closes #14575 (duplicate of #13953)
  • Supersedes the allowlist approach discussed in #13953

Notes

This PR takes a different approach than #13953 (which proposed a model.preserve_dots config option). Instead of adding configuration complexity, we default to preserving the user's model name and only normalize for the one provider that explicitly requires it (native Anthropic). This is simpler and more intuitive.

Changed files

  • run_agent.py (modified, +20/-27)
  • tests/agent/test_minimax_provider.py (modified, +12/-0)

Code Example

No available accounts: no available accounts

---

def normalize_model_name(model: str, preserve_dots: bool = False) -> str:
    if not preserve_dots:
        model = model.replace(".", "-")
    return model

---

model:
  default: kimi-k2.6
  provider: custom
  base_url: https://proxy_provider.io/
  api_key: sk-xxx
  api_mode: anthropic_messages
RAW_BUFFERClick to expand / collapse

Bug Description

When using a custom provider with api_mode: anthropic_messages, model names containing dots (e.g., kimi-k2.6) are incorrectly converted to hyphens (kimi-k2-6) before being sent to the API endpoint.

This causes third-party proxy providers that expect the original dotted model name to return HTTP 503 errors like:

No available accounts: no available accounts

Root Cause

The normalize_model_name() function in agent/anthropic_adapter.py unconditionally replaces dots with hyphens:

def normalize_model_name(model: str, preserve_dots: bool = False) -> str:
    if not preserve_dots:
        model = model.replace(".", "-")
    return model

The _anthropic_preserve_dots() method in run_agent.py only returns True for a hardcoded list of providers and base URLs:

  • alibaba, minimax, minimax-cn
  • opencode-go, opencode-zen
  • zai, bedrock
  • Specific base URLs like dashscope, aliyuncs, etc.

Custom providers are not included, so any model name with dots gets mangled.

Steps to Reproduce

  1. Configure a custom provider in config.yaml:
model:
  default: kimi-k2.6
  provider: custom
  base_url: https://proxy_provider.io/
  api_key: sk-xxx
  api_mode: anthropic_messages
  1. Start hermes gateway with this profile
  2. Send any message
  3. Observe HTTP 503 No available accounts error

Expected Behavior

Custom providers should preserve dots in model names by default, OR there should be a configuration option to enable preserve_dots for custom endpoints.

Actual Behavior

Model kimi-k2.6 is sent as kimi-k2-6 to the API, which the proxy provider does not recognize.

Environment

  • Hermes Agent version: latest main
  • Provider: custom (anthropic_messages compatible proxy)
  • Model: kimi-k2.6

Suggested Fix

Option 1: Add "custom" to the provider allowlist in _anthropic_preserve_dots().

Option 2: Add a config option model.preserve_dots: true that users can set for custom endpoints.

Option 3: Make preserve_dots the default for all non-Anthropic providers when api_mode: anthropic_messages is used with a custom base_url.

extent analysis

TL;DR

To fix the issue, update the _anthropic_preserve_dots() method to include custom providers or add a configuration option to preserve dots in model names for custom endpoints.

Guidance

  • Review the _anthropic_preserve_dots() method in run_agent.py to understand the current logic for preserving dots in model names.
  • Consider adding "custom" to the provider allowlist in _anthropic_preserve_dots() as a temporary fix.
  • Evaluate the feasibility of adding a model.preserve_dots configuration option for custom endpoints as a more flexible solution.
  • If updating the code, verify that the fix works by testing with a custom provider and a model name containing dots.

Example

def _anthropic_preserve_dots(provider, base_url):
    # Add "custom" to the allowlist
    allowlist = ["alibaba", "minimax", "minimax-cn", "custom"]
    # ... rest of the method remains the same

Notes

The suggested fix assumes that the issue is solely due to the normalize_model_name() function replacing dots with hyphens. However, other factors might influence the behavior, and thorough testing is necessary to ensure the fix works as expected.

Recommendation

Apply workaround: Add a configuration option model.preserve_dots: true that users can set for custom endpoints, as this provides more flexibility and control over the behavior.

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