hermes - ✅(Solved) Fix [Bug]: custom anthropic proxy rewrites z-ai/glm-5.1 to z-ai/glm-5-1 [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#11464Fetched 2026-04-18 06:00:57
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

Error Message

The upstream proxy then rejects the request. Example provider error:

Additional Logs / Traceback

Root Cause

The current dot-preservation guard only preserves dotted model ids when Hermes can infer the upstream provider from:

  • provider being a known built-in provider such as zai, or
  • base_url containing provider-specific markers such as bigmodel.cn, dashscope, minimax, etc.

For opaque custom proxy domains, neither condition is true. As a result, the Anthropic model normalization path still converts dots to hyphens.

This is especially visible for GLM model ids like:

  • glm-4.7
  • glm-5.1
  • z-ai/glm-5.1

The bug is reproducible even after updating the local install to the latest origin/main on April 17, 2026.

Fix Action

Fixed

PR fix notes

PR #11480: fix(agent): preserve dotted ZAI models on custom anthropic proxies

Description (problem / solution / changelog)

Fixes #11464.

Summary

  • preserve dotted ZAI/GLM model ids for opaque custom anthropic-compatible proxies by inferring dot-preserving vendors from the configured model when provider/base_url do not reveal the upstream
  • keep Claude hyphenation unchanged on the same custom-proxy path
  • add regression tests for both behaviors

Testing

  • pytest -q -o addopts= tests/agent/test_minimax_provider.py

Changed files

  • run_agent.py (modified, +22/-2)
  • tests/agent/test_minimax_provider.py (modified, +20/-0)

Code Example

model:
  provider: custom
  default: z-ai/glm-5.1
  base_url: https://<custom-proxy>/anthropic
  api_mode: anthropic_messages

---

No available channel for model z-ai/glm-5-1 under group Other (distributor)

---

No available channel for model z-ai/glm-5-1 under group Other (distributor)
RAW_BUFFERClick to expand / collapse

Bug Description

When Hermes is configured to use a custom Anthropic-compatible endpoint with api_mode: anthropic_messages, dotted GLM model ids can be rewritten incorrectly.

Example:

  • configured model: z-ai/glm-5.1
  • actual model sent upstream: z-ai/glm-5-1

This breaks providers/proxies that require the original dotted model id.

Steps to Reproduce

  1. Configure Hermes with a custom Anthropic-compatible proxy:
model:
  provider: custom
  default: z-ai/glm-5.1
  base_url: https://<custom-proxy>/anthropic
  api_mode: anthropic_messages
  1. Start Hermes gateway or CLI.
  2. Send a normal message.
  3. Inspect the upstream request / request dump.

Expected Behavior

Hermes should preserve the configured model id exactly as z-ai/glm-5.1 for this custom Anthropic-compatible proxy.

Actual Behavior

Hermes rewrites the model to z-ai/glm-5-1.

The upstream proxy then rejects the request. Example provider error:

No available channel for model z-ai/glm-5-1 under group Other (distributor)

A nearby model without a dotted version suffix works fine:

  • z-ai/glm-5-turbo works
  • z-ai/glm-5.1 fails because it is rewritten

Affected Component

  • Agent Core (conversation loop, model routing)
  • Configuration (config.yaml, custom providers)
  • Gateway (reproduced through gateway)

Debug Report

Report https://paste.rs/zsEZJ agent.log https://paste.rs/3WZ9B gateway.log https://paste.rs/boVOE

Operating System

Ubuntu 24.04

Python Version

3.11.15

Hermes Version

Hermes Agent v0.10.0 (2026.4.16)

Additional Logs / Traceback

Relevant request-dump symptom from local reproduction:

No available channel for model z-ai/glm-5-1 under group Other (distributor)

Root Cause Analysis

The current dot-preservation guard only preserves dotted model ids when Hermes can infer the upstream provider from:

  • provider being a known built-in provider such as zai, or
  • base_url containing provider-specific markers such as bigmodel.cn, dashscope, minimax, etc.

For opaque custom proxy domains, neither condition is true. As a result, the Anthropic model normalization path still converts dots to hyphens.

This is especially visible for GLM model ids like:

  • glm-4.7
  • glm-5.1
  • z-ai/glm-5.1

The bug is reproducible even after updating the local install to the latest origin/main on April 17, 2026.

extent analysis

TL;DR

The issue can be fixed by modifying the dot-preservation guard to handle custom Anthropic-compatible endpoints correctly.

Guidance

  • Review the config.yaml file to ensure the base_url for the custom proxy is correctly configured and does not contain any provider-specific markers that might interfere with the dot-preservation guard.
  • Consider adding a custom logic to preserve dotted model ids for opaque custom proxy domains, potentially by adding a new condition to the dot-preservation guard that checks for the presence of api_mode: anthropic_messages.
  • Inspect the request-dump to verify that the model id is being sent correctly to the upstream proxy.
  • Test the fix by sending a normal message and checking the upstream request to ensure the model id is preserved.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a modification to the existing dot-preservation guard logic.

Notes

The fix may require modifications to the Hermes Agent Core and Configuration components. Additionally, the solution may not be applicable to all custom proxy domains, and further testing may be required to ensure compatibility.

Recommendation

Apply a workaround by modifying the dot-preservation guard to handle custom Anthropic-compatible endpoints correctly, as the issue is specific to the current implementation and a straightforward fix is not available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: custom anthropic proxy rewrites z-ai/glm-5.1 to z-ai/glm-5-1 [1 pull requests, 1 participants]