Skip to content

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
NousResearch:mainfrom
ClintonEmok:fix/issue-5211-opencode-go-dot-preservation
Closed

Fix #5211: Preserve dots in OpenCode Go model names (minimax-m2.7, glm-4.5, kimi-k2.5)#5491
ClintonEmok wants to merge 1 commit into
NousResearch:mainfrom
ClintonEmok:fix/issue-5211-opencode-go-dot-preservation

Conversation

@ClintonEmok

Copy link
Copy Markdown
Contributor

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-go the same as Anthropic:

  1. hermes_cli/model_normalize.py: opencode-go was in _DOT_TO_HYPHEN_PROVIDERS, causing normalize_model_for_provider() to convert dots→hyphens. OpenCode Go uses dots in its model identifiers, not hyphens.

  2. run_agent.py: _anthropic_preserve_dots() only checked for Alibaba/DashScope — it did not include opencode-go. So even the Anthropic adapter path (which MiniMax models use) was mangling model names.

Changes

hermes_cli/model_normalize.py

  • Removed "opencode-go" from _DOT_TO_HYPHEN_PROVIDERS
  • Updated module docstring to clarify OpenCode Go preserves dots while OpenCode Zen converts them

run_agent.py

  • Added "opencode-go" to the provider check in _anthropic_preserve_dots()
  • Added "opencode.ai/zen/go" to the base_url fallback check
  • Updated docstring

tests/test_model_normalize.py (new)

  • 22 regression tests covering:
    • OpenCode Go dot preservation (5 parametrized cases + set membership check)
    • Anthropic dot→hyphen conversion (regression safety)
    • OpenCode Zen dot→hyphen conversion (regression safety)
    • Copilot dot preservation (regression safety)
    • Aggregator vendor prefix prepending (regression safety)
    • detect_vendor() for known models

Test Results

  • 22/22 new tests in test_model_normalize.py pass
  • 194/194 existing model-related tests pass (test_codex_models.py, test_models.py, test_model_validation.py, test_model_metadata.py, test_smart_model_routing.py, test_models_dev.py)
  • 3143/3145 full suite (2 pre-existing failures in Matrix media encryption and session race guard — unrelated to this change)

Verification

# Before fix:
normalize_model_for_provider("minimax-m2.7", "opencode-go") → "minimax-m2-7"# After fix:
normalize_model_for_provider("minimax-m2.7", "opencode-go") → "minimax-m2.7" ✅
normalize_model_for_provider("claude-sonnet-4.6", "anthropic") → "claude-sonnet-4-6" ✅ (regression safe)

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>
@teknium1

teknium1 commented Apr 6, 2026

Copy link
Copy Markdown
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: OpenCode Go model names with dots get hyphenated, causing HTTP 401 (minimax-m2.7, glm-4.5, kimi-k2.5)

2 participants