fix: preserve dots in model IDs for OpenCode Zen provider - #7739
Closed
konsisumer wants to merge 2 commits into
Closed
fix: preserve dots in model IDs for OpenCode Zen provider#7739konsisumer wants to merge 2 commits into
konsisumer wants to merge 2 commits into
Conversation
…ch#7710) OpenCode Zen's MiniMax models (e.g. minimax-m2.5-free) require dots in model IDs, but _anthropic_preserve_dots() did not recognize the "opencode-zen" provider or its base URL pattern "opencode.ai/zen/v1". This caused normalize_model_name() to convert dots to hyphens (minimax-m2-5-free), resulting in HTTP 400 from the API. - Add "opencode-zen" to the provider allowlist in _anthropic_preserve_dots() - Broaden URL check from "opencode.ai/zen/go" to "opencode.ai/zen/" to cover both Go and Zen endpoints - Add tests for provider and URL-based dot preservation Closes NousResearch#7710
konsisumer
force-pushed
the
fix/opencode-zen-minimax-dot-preservation
branch
from
April 12, 2026 01:34
3336075 to
7b04864
Compare
The whatsapp-bridge package.json references @whiskeysockets/baileys via a GitHub branch URL, which requires git during npm install.
teknium1
added a commit
that referenced
this pull request
Apr 13, 2026
OpenCode Zen was in _DOT_TO_HYPHEN_PROVIDERS, causing all dotted model names (minimax-m2.5-free, gpt-5.4, glm-5.1) to be mangled. The fix: Layer 1 (model_normalize.py): Remove opencode-zen from the blanket dot-to-hyphen set. Add an explicit block that preserves dots for non-Claude models while keeping Claude hyphenated (Zen's Claude endpoint uses anthropic_messages mode which expects hyphens). Layer 2 (run_agent.py _anthropic_preserve_dots): Add opencode-zen and zai to the provider allowlist. Broaden URL check from opencode.ai/zen/go to opencode.ai/zen/ to cover both Go and Zen endpoints. Add bigmodel.cn for ZAI URL detection. Also adds glm-5.1 to ZAI model lists in models.py and setup.py. Closes #7710 Salvaged from contributions by: - konsisumer (PR #7739, #7719) - DomGrieco (PR #8708) - Esashiero (PR #7296) - sharziki (PR #7497) - XiaoYingGee (PR #8750) - APTX4869-maker (PR #8752) - kagura-agent (PR #7157)
teknium1
added a commit
that referenced
this pull request
Apr 13, 2026
…8794) OpenCode Zen was in _DOT_TO_HYPHEN_PROVIDERS, causing all dotted model names (minimax-m2.5-free, gpt-5.4, glm-5.1) to be mangled. The fix: Layer 1 (model_normalize.py): Remove opencode-zen from the blanket dot-to-hyphen set. Add an explicit block that preserves dots for non-Claude models while keeping Claude hyphenated (Zen's Claude endpoint uses anthropic_messages mode which expects hyphens). Layer 2 (run_agent.py _anthropic_preserve_dots): Add opencode-zen and zai to the provider allowlist. Broaden URL check from opencode.ai/zen/go to opencode.ai/zen/ to cover both Go and Zen endpoints. Add bigmodel.cn for ZAI URL detection. Also adds glm-5.1 to ZAI model lists in models.py and setup.py. Closes #7710 Salvaged from contributions by: - konsisumer (PR #7739, #7719) - DomGrieco (PR #8708) - Esashiero (PR #7296) - sharziki (PR #7497) - XiaoYingGee (PR #8750) - APTX4869-maker (PR #8752) - kagura-agent (PR #7157)
Contributor
|
Merged via PR #8794 which combines the best aspects of all open dot-preservation PRs onto current main. Your Layer 2 fix (adding opencode-zen to _anthropic_preserve_dots + URL broadening) was used directly. Your ZAI fix from #7719 was also included. Thanks for the contribution, @konsisumer! |
lawyerwenhan
pushed a commit
to lawyerwenhan/hermes-agent
that referenced
this pull request
Apr 13, 2026
…ousResearch#8794) OpenCode Zen was in _DOT_TO_HYPHEN_PROVIDERS, causing all dotted model names (minimax-m2.5-free, gpt-5.4, glm-5.1) to be mangled. The fix: Layer 1 (model_normalize.py): Remove opencode-zen from the blanket dot-to-hyphen set. Add an explicit block that preserves dots for non-Claude models while keeping Claude hyphenated (Zen's Claude endpoint uses anthropic_messages mode which expects hyphens). Layer 2 (run_agent.py _anthropic_preserve_dots): Add opencode-zen and zai to the provider allowlist. Broaden URL check from opencode.ai/zen/go to opencode.ai/zen/ to cover both Go and Zen endpoints. Add bigmodel.cn for ZAI URL detection. Also adds glm-5.1 to ZAI model lists in models.py and setup.py. Closes NousResearch#7710 Salvaged from contributions by: - konsisumer (PR NousResearch#7739, NousResearch#7719) - DomGrieco (PR NousResearch#8708) - Esashiero (PR NousResearch#7296) - sharziki (PR NousResearch#7497) - XiaoYingGee (PR NousResearch#8750) - APTX4869-maker (PR NousResearch#8752) - kagura-agent (PR NousResearch#7157)
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
…ousResearch#8794) OpenCode Zen was in _DOT_TO_HYPHEN_PROVIDERS, causing all dotted model names (minimax-m2.5-free, gpt-5.4, glm-5.1) to be mangled. The fix: Layer 1 (model_normalize.py): Remove opencode-zen from the blanket dot-to-hyphen set. Add an explicit block that preserves dots for non-Claude models while keeping Claude hyphenated (Zen's Claude endpoint uses anthropic_messages mode which expects hyphens). Layer 2 (run_agent.py _anthropic_preserve_dots): Add opencode-zen and zai to the provider allowlist. Broaden URL check from opencode.ai/zen/go to opencode.ai/zen/ to cover both Go and Zen endpoints. Add bigmodel.cn for ZAI URL detection. Also adds glm-5.1 to ZAI model lists in models.py and setup.py. Closes NousResearch#7710 Salvaged from contributions by: - konsisumer (PR NousResearch#7739, NousResearch#7719) - DomGrieco (PR NousResearch#8708) - Esashiero (PR NousResearch#7296) - sharziki (PR NousResearch#7497) - XiaoYingGee (PR NousResearch#8750) - APTX4869-maker (PR NousResearch#8752) - kagura-agent (PR NousResearch#7157)
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…ousResearch#8794) OpenCode Zen was in _DOT_TO_HYPHEN_PROVIDERS, causing all dotted model names (minimax-m2.5-free, gpt-5.4, glm-5.1) to be mangled. The fix: Layer 1 (model_normalize.py): Remove opencode-zen from the blanket dot-to-hyphen set. Add an explicit block that preserves dots for non-Claude models while keeping Claude hyphenated (Zen's Claude endpoint uses anthropic_messages mode which expects hyphens). Layer 2 (run_agent.py _anthropic_preserve_dots): Add opencode-zen and zai to the provider allowlist. Broaden URL check from opencode.ai/zen/go to opencode.ai/zen/ to cover both Go and Zen endpoints. Add bigmodel.cn for ZAI URL detection. Also adds glm-5.1 to ZAI model lists in models.py and setup.py. Closes NousResearch#7710 Salvaged from contributions by: - konsisumer (PR NousResearch#7739, NousResearch#7719) - DomGrieco (PR NousResearch#8708) - Esashiero (PR NousResearch#7296) - sharziki (PR NousResearch#7497) - XiaoYingGee (PR NousResearch#8750) - APTX4869-maker (PR NousResearch#8752) - kagura-agent (PR NousResearch#7157)
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…ousResearch#8794) OpenCode Zen was in _DOT_TO_HYPHEN_PROVIDERS, causing all dotted model names (minimax-m2.5-free, gpt-5.4, glm-5.1) to be mangled. The fix: Layer 1 (model_normalize.py): Remove opencode-zen from the blanket dot-to-hyphen set. Add an explicit block that preserves dots for non-Claude models while keeping Claude hyphenated (Zen's Claude endpoint uses anthropic_messages mode which expects hyphens). Layer 2 (run_agent.py _anthropic_preserve_dots): Add opencode-zen and zai to the provider allowlist. Broaden URL check from opencode.ai/zen/go to opencode.ai/zen/ to cover both Go and Zen endpoints. Add bigmodel.cn for ZAI URL detection. Also adds glm-5.1 to ZAI model lists in models.py and setup.py. Closes NousResearch#7710 Salvaged from contributions by: - konsisumer (PR NousResearch#7739, NousResearch#7719) - DomGrieco (PR NousResearch#8708) - Esashiero (PR NousResearch#7296) - sharziki (PR NousResearch#7497) - XiaoYingGee (PR NousResearch#8750) - APTX4869-maker (PR NousResearch#8752) - kagura-agent (PR NousResearch#7157)
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
minimax-m2.5-free)_anthropic_preserve_dots()didn't recognizeopencode-zenprovider or its URL pattern, causingnormalize_model_name()to convert dots to hyphens (minimax-m2-5-free), which the API rejects"opencode-zen"to the provider allowlist and broadens URL check from"opencode.ai/zen/go"to"opencode.ai/zen/"to cover both Go and Zen endpointsCloses #7710
Test plan
opencode-zenprovider detection (test_opencode_zen_provider_preserves_dots)test_opencode_zen_url_preserves_dots)minimax-m2.5-freemodel nametest_minimax_provider.pypass