Skip to content

fix: preserve dotted non-Claude model ids on Anthropic wire#15087

Open
ReginaldasR wants to merge 1 commit into
NousResearch:mainfrom
ReginaldasR:fix/routermint-user-agent
Open

fix: preserve dotted non-Claude model ids on Anthropic wire#15087
ReginaldasR wants to merge 1 commit into
NousResearch:mainfrom
ReginaldasR:fix/routermint-user-agent

Conversation

@ReginaldasR

Copy link
Copy Markdown
Contributor

Closes #15072

Summary

Fix Anthropic model normalization so Hermes only converts dots to hyphens for Claude model IDs.

Before this change, Anthropic wire normalization rewrote any dotted model ID, which broke Anthropic-compatible custom endpoints serving non-Claude models such as:

  • qwen3.6-35B
  • qwen3.5-plus
  • MiniMax-M2.7

That produced requests like qwen3-6-35B, which the upstream endpoint rejected as model_not_found.

Root cause

agent.anthropic_adapter.normalize_model_name() applied this rule globally:

  • strip anthropic/
  • replace . with -

That is correct for Claude IDs like claude-sonnet-4.6 -> claude-sonnet-4-6, but incorrect for non-Claude IDs on Anthropic-compatible APIs.

Fix

Change Anthropic normalization to:

  • keep stripping anthropic/
  • only replace . with - when the bare model ID starts with claude-
  • keep dotted non-Claude IDs unchanged by default

Examples after this patch:

  • anthropic/claude-sonnet-4.6 -> claude-sonnet-4-6
  • qwen3.6-35B -> qwen3.6-35B
  • anthropic/qwen3.6-35B -> qwen3.6-35B
  • MiniMax-M2.7 -> MiniMax-M2.7

Tests

Added/updated regression coverage for:

  • Qwen-style dotted model IDs staying intact on the Anthropic path
  • existing Claude dot-to-hyphen behavior remaining unchanged
  • MiniMax normalization expectation aligned with the new non-Claude behavior

Validation

Passed locally:

  • pytest -o addopts='' tests/agent/test_anthropic_adapter.py
  • pytest -o addopts='' tests/agent/test_minimax_provider.py -k 'normalize_'

I did not run the full test_minimax_provider.py file in this environment because it imports run_agent and the local env is missing the fire dependency, which is unrelated to this fix.

@ReginaldasR ReginaldasR force-pushed the fix/routermint-user-agent branch from 19737c5 to 03001a9 Compare April 24, 2026 11:06
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder provider/anthropic Anthropic native Messages API labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists provider/anthropic Anthropic native Messages API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: The missing "." in the model name was automatically switched to "-"

2 participants