fix: preserve dotted non-Claude model ids on Anthropic wire#15087
Open
ReginaldasR wants to merge 1 commit into
Open
fix: preserve dotted non-Claude model ids on Anthropic wire#15087ReginaldasR wants to merge 1 commit into
ReginaldasR wants to merge 1 commit into
Conversation
19737c5 to
03001a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-35Bqwen3.5-plusMiniMax-M2.7That produced requests like
qwen3-6-35B, which the upstream endpoint rejected asmodel_not_found.Root cause
agent.anthropic_adapter.normalize_model_name()applied this rule globally:anthropic/.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:
anthropic/.with-when the bare model ID starts withclaude-Examples after this patch:
anthropic/claude-sonnet-4.6->claude-sonnet-4-6qwen3.6-35B->qwen3.6-35Banthropic/qwen3.6-35B->qwen3.6-35BMiniMax-M2.7->MiniMax-M2.7Tests
Added/updated regression coverage for:
Validation
Passed locally:
pytest -o addopts='' tests/agent/test_anthropic_adapter.pypytest -o addopts='' tests/agent/test_minimax_provider.py -k 'normalize_'I did not run the full
test_minimax_provider.pyfile in this environment because it importsrun_agentand the local env is missing thefiredependency, which is unrelated to this fix.