Skip to content

The agent that grows with you

fix(providers): surface Alibaba China in desktop parity

Ayush Nangia94aad6dcd212
diff --git a/plugins/model-providers/alibaba/__init__.py b/plugins/model-providers/alibaba/__init__.py
index f471650edb4..6135945d508 100644
--- a/plugins/model-providers/alibaba/__init__.py
+++ b/plugins/model-providers/alibaba/__init__.py
@@ -31,7 +31,7 @@ alibaba_cn = ProviderProfile(
aliases=("dashscope-cn", "alibaba-cloud-cn"),
display_name="Alibaba Cloud DashScope (China)",
description="Alibaba Cloud DashScope, mainland-China endpoint",
- env_vars=("DASHSCOPE_API_KEY",),
+ env_vars=("DASHSCOPE_API_KEY", "DASHSCOPE_CN_BASE_URL"),
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
)
diff --git a/tests/providers/test_provider_profiles.py b/tests/providers/test_provider_profiles.py
index 6fbba7d5202..9785ff9e648 100644
--- a/tests/providers/test_provider_profiles.py
+++ b/tests/providers/test_provider_profiles.py
@@ -273,6 +273,7 @@ class TestAlibabaRegionalAndTokenPlanProfiles:
assert p is not None and p.name == "alibaba-cn"
assert p.base_url == "https://dashscope.aliyuncs.com/compatible-mode/v1"
assert "DASHSCOPE_API_KEY" in p.env_vars
+ assert "DASHSCOPE_CN_BASE_URL" in p.env_vars
def test_alibaba_coding_plan_cn_registered(self):
p = get_provider_profile("alibaba-coding-plan-cn")
diff --git a/website/docs/reference/environment-variables.md b/website/docs/reference/environment-variables.md
index 6ece971ab74..11eaa30a155 100644
--- a/website/docs/reference/environment-variables.md
+++ b/website/docs/reference/environment-variables.md
@@ -82,6 +82,7 @@ Hermes reads environment variables from the process environment and, for user-ma
| `ANTHROPIC_TOKEN` | Manual or legacy Anthropic OAuth/setup-token override |
| `DASHSCOPE_API_KEY` | Qwen Cloud (Alibaba DashScope) API key for Qwen models ([modelstudio.console.alibabacloud.com](https://modelstudio.console.alibabacloud.com/)) |
| `DASHSCOPE_BASE_URL` | Custom DashScope base URL (default: `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`; use `https://dashscope.aliyuncs.com/compatible-mode/v1` for mainland-China region) |
+| `DASHSCOPE_CN_BASE_URL` | Override the `alibaba-cn` mainland-China DashScope base URL |
| `ALIBABA_CODING_PLAN_API_KEY` | Qwen Coding Plan API key (`alibaba-coding-plan` / `alibaba-coding-plan-cn` providers) |
| `ALIBABA_CODING_PLAN_BASE_URL` | Override the Qwen Coding Plan base URL (international) |
| `ALIBABA_CODING_PLAN_CN_BASE_URL` | Override the Qwen Coding Plan base URL (mainland China) |