hermes - ✅(Solved) Fix [Bug]: custom anthropic_messages providers can rewrite model names by replacing '.' with '-' [1 pull requests, 2 comments, 3 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#16417Fetched 2026-04-28 06:53:27
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

Error Message

Additional Logs / Traceback (optional) No traceback. This appears to be a model-name normalization behavior issue.

Fix Action

Fixed

PR fix notes

PR #16429: fix(agent): preserve dots in model names for custom providers

Description (problem / solution / changelog)

Problem

When using a custom provider with the anthropic_messages protocol, normalize_model_name() converts dots to hyphens in model names (e.g. claude-sonnet-4.6claude-sonnet-4-6). This is correct for the Anthropic API but wrong for custom endpoints that expect the model name unchanged.

_anthropic_preserve_dots() has an allowlist of providers that preserve dots, but "custom" is not included.

Fix

Add "custom" to the provider set in _anthropic_preserve_dots(). When the provider is "custom", the user has explicitly configured an external endpoint with a specific model name — dot-to-hyphen conversion is Anthropic-specific and must not be applied.

Affected model names: claude-sonnet-4.6, glm-4.7, qwen3.5-plus, MiniMax-M2.7, etc.

Tests

New regression test in tests/agent/test_custom_preserve_dots.py:

  • Custom provider preserves dots
  • Custom with base_url preserves dots
  • Anthropic provider still converts dots (no regression)
  • Known allowlist providers still work

Fixes #16417 Fixes #13061

Changed files

  • run_agent.py (modified, +9/-1)
  • tests/agent/test_custom_preserve_dots.py (added, +54/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

When using a custom provider with the anthropic_messages protocol, Hermes can rewrite the configured model name by replacing . with -.

This affects custom Anthropic-compatible endpoints that expect the model ID exactly as configured by the user.

Examples:

  • claude-sonnet-4.6claude-sonnet-4-6
  • glm-4.7glm-4-7
  • qwen3.5-plusqwen3-5-plus

Steps to Reproduce

  1. Configure a custom provider that uses an Anthropic-compatible endpoint.
  2. Set its API mode / transport to anthropic_messages.
  3. Configure a model name containing dots, such as claude-sonnet-4.6.
  4. Send a request through Hermes.
  5. Observe that the outgoing model name is rewritten with . replaced by -.

Expected Behavior

For custom providers, Hermes should send the configured model name unchanged.

If the configured model is claude-sonnet-4.6, the request should use claude-sonnet-4.6.

Actual Behavior

On the anthropic_messages path, Hermes can rewrite the model name before sending the request, replacing dots with hyphens.

As a result, custom endpoints may receive a different model ID than the one configured by the user.

Affected Component

  • Configuration (config.yaml, .env, hermes setup)
  • Agent Core (conversation loop, provider/runtime handling)

Messaging Platform (if gateway-related)

  • N/A (CLI only)

Debug Report

Not attached yet. This was identified from source analysis and behavior inspection rather than a runtime crash. I can provide a debug report if needed.

Operating System

  • macOS

Python Version

  • Python 3.12.12

Hermes Version

  • Hermes Agent v0.11.0 (2026.4.23)

Additional Logs / Traceback (optional)

No traceback. This appears to be a model-name normalization behavior issue.

extent analysis

TL;DR

The issue can be fixed by modifying the Hermes configuration or code to prevent model name rewriting for custom Anthropic-compatible endpoints.

Guidance

  • Review the config.yaml and .env files to ensure that the model name is correctly configured without any rewriting.
  • Inspect the Hermes source code to identify the exact location where the model name rewriting occurs and consider modifying it to exempt custom providers.
  • Test the custom provider with a model name containing dots to verify if the issue is resolved.
  • Consider adding a configuration option to disable model name rewriting for custom providers.

Example

No code snippet is provided as the issue requires modification of the Hermes source code or configuration, which is not explicitly stated.

Notes

The issue appears to be specific to the anthropic_messages protocol and custom Anthropic-compatible endpoints. The fix may require modifications to the Hermes source code or configuration.

Recommendation

Apply a workaround by modifying the Hermes configuration or code to prevent model name rewriting for custom Anthropic-compatible endpoints, as upgrading to a fixed version is not mentioned in 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

hermes - ✅(Solved) Fix [Bug]: custom anthropic_messages providers can rewrite model names by replacing '.' with '-' [1 pull requests, 2 comments, 3 participants]