From 276ef49c96107e3e3d42c304967a32c3343f7e4f Mon Sep 17 00:00:00 2001 From: wujhsu Date: Sat, 11 Apr 2026 23:20:53 +0800 Subject: [PATCH] fix(provider): recognize open.bigmodel.cn as Zhipu/ZAI provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zhipu AI (智谱) serves both international users via api.z.ai and China-based users via open.bigmodel.cn. The domestic endpoint was not mapped in _URL_TO_PROVIDER, causing Hermes to treat it as an unknown custom endpoint and fall back to the default 128K context length instead of resolving the correct 200K+ context via models.dev or the hardcoded GLM defaults. This affects users of both the standard API (https://open.bigmodel.cn/api/paas/v4) and the Coding Plan (https://open.bigmodel.cn/api/coding/paas/v4). --- agent/model_metadata.py | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/model_metadata.py b/agent/model_metadata.py index 11a998862..e3c07684c 100644 --- a/agent/model_metadata.py +++ b/agent/model_metadata.py @@ -247,6 +247,7 @@ _URL_TO_PROVIDER: Dict[str, str] = { "chatgpt.com": "openai", "api.anthropic.com": "anthropic", "api.z.ai": "zai", + "open.bigmodel.cn": "zai", "api.moonshot.ai": "kimi-coding", "api.moonshot.cn": "kimi-coding-cn", "api.kimi.com": "kimi-coding",