Fix #5211: Preserve dots in OpenCode Go model names (minimax-m2.7, glm-4.5, kimi-k2.5)#5491
Closed
ClintonEmok wants to merge 1 commit into
Closed
Conversation
OpenCode Go model names with dots (minimax-m2.7, glm-4.5, kimi-k2.5) were being mangled to hyphens (minimax-m2-7), causing HTTP 401 errors. Two code paths were affected: 1. model_normalize.py: opencode-go was incorrectly in DOT_TO_HYPHEN_PROVIDERS 2. run_agent.py: _anthropic_preserve_dots() did not check for opencode-go Fix: - Remove opencode-go from _DOT_TO_HYPHEN_PROVIDERS (dots are correct for Go) - Add opencode-go to _anthropic_preserve_dots() provider check - Add opencode.ai/zen/go to base_url fallback check - Add regression tests in tests/test_model_normalize.py Co-authored-by: jacob3712 <jacob3712@users.noreply.github.com>
Contributor
|
Merged via PR #5597 onto current main. Your commit was cherry-picked with authorship preserved in git log. Thanks for the clean fix, @ClintonEmok! |
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
Fixes #5211 — OpenCode Go model names with dots (e.g.
minimax-m2.7,glm-4.5,kimi-k2.5) were being silently mangled to hyphens (minimax-m2-7), causing HTTP 401 "Model not supported" errors from the OpenCode Go API.Root Cause
Two separate code paths were incorrectly treating
opencode-gothe same as Anthropic:hermes_cli/model_normalize.py:opencode-gowas in_DOT_TO_HYPHEN_PROVIDERS, causingnormalize_model_for_provider()to convert dots→hyphens. OpenCode Go uses dots in its model identifiers, not hyphens.run_agent.py:_anthropic_preserve_dots()only checked for Alibaba/DashScope — it did not includeopencode-go. So even the Anthropic adapter path (which MiniMax models use) was mangling model names.Changes
hermes_cli/model_normalize.py"opencode-go"from_DOT_TO_HYPHEN_PROVIDERSrun_agent.py"opencode-go"to the provider check in_anthropic_preserve_dots()"opencode.ai/zen/go"to the base_url fallback checktests/test_model_normalize.py(new)detect_vendor()for known modelsTest Results
test_model_normalize.pypasstest_codex_models.py,test_models.py,test_model_validation.py,test_model_metadata.py,test_smart_model_routing.py,test_models_dev.py)Verification