fix(agent): preserve dots in custom provider model IDs (#13061)#13068
Open
EurFelux wants to merge 2 commits into
Open
fix(agent): preserve dots in custom provider model IDs (#13061)#13068EurFelux wants to merge 2 commits into
EurFelux wants to merge 2 commits into
Conversation
…arch#13061) Custom providers (`custom` / `custom:<name>`) now bypass the dots-to-hyphens rewrite in `normalize_model_name()`. The user has already configured the exact model ID the upstream expects, and Hermes cannot second-guess an arbitrary third-party API. Fixes zenmux's `z-ai/glm-5.1` being mangled to `z-ai/glm-5-1` and rejected with HTTP 404.
Collaborator
This was referenced Apr 23, 2026
…ider-preserve-dots
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.
Summary
normalize_model_name()rewrote dots to hyphens for custom providers, breaking upstreams whose model IDs legitimately contain dots (e.g. zenmux'sz-ai/glm-5.1→z-ai/glm-5-1→ HTTP 404)._anthropic_preserve_dots()now returnsTruewhenever the provider iscustomorcustom:<name>. The user has already configured the exact model ID the upstream expects, and Hermes cannot second-guess an arbitrary third-party API.Test plan
TestCustomProviderPreserveDotsintests/agent/test_minimax_provider.pycovers barecustom, namedcustom:zenmux, and unknown URLs.test_non_bedrock_aws_url_does_not_preserve_dotsto use an empty provider so it continues to test URL-heuristic scoping in isolation.uv run python -m pytest tests/agent/test_anthropic_adapter.py tests/agent/test_bedrock_integration.py tests/agent/test_minimax_provider.py tests/test_ctx_halving_fix.py— 232 passed.🤖 Generated with Claude Code