Skip to content

fix: preserve dots in model names for opencode-zen provider - #7296

Closed
Esashiero wants to merge 1 commit into
NousResearch:mainfrom
Esashiero:fix/opencode-zen-model-normalization
Closed

fix: preserve dots in model names for opencode-zen provider#7296
Esashiero wants to merge 1 commit into
NousResearch:mainfrom
Esashiero:fix/opencode-zen-model-normalization

Conversation

@Esashiero

Copy link
Copy Markdown

Summary

Fix model normalization for opencode-zen provider to preserve dots in model names like minimax-m2.5-free instead of incorrectly converting them to hyphens (minimax-m2-5-free).

Changes

  • Remove opencode-zen from _DOT_TO_HYPHEN_PROVIDERS - it was incorrectly converting all dots to hyphens
  • Add opencode-zen to _AUTHORITATIVE_NATIVE_PROVIDERS - pass model names through unchanged

Testing

Verified the fix works:

  • minimax-m2.5-free + opencode-zen -> minimax-m2.5-free (preserved)
  • claude-sonnet-4.6 + anthropic -> claude-sonnet-4-6 (converted as expected)
  • claude-sonnet-4.6 + opencode-zen -> claude-sonnet-4.6 (preserved)

- Remove opencode-zen from _DOT_TO_HYPHEN_PROVIDERS (was incorrectly
  converting dots to hyphens for all models)
- Add opencode-zen to _AUTHORITATIVE_NATIVE_PROVIDERS to pass model
  names through unchanged

Fixes minimax-m2.5-free being normalized to minimax-m2-5-free which
causes API errors with OpenCode Zen.
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)
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #8794 which combines the best aspects of all open dot-preservation PRs onto current main. Your identification that opencode-zen needed to be removed from _DOT_TO_HYPHEN_PROVIDERS was part of the fix. Thanks for the contribution, @Esashiero!

@teknium1 teknium1 closed this Apr 13, 2026
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)
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.

2 participants