Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(model-providers): 区分百炼 Coding Plan 与 Token Plan (#1128)

VIBES75823fed97ae
diff --git a/i18n/GLOSSARY.md b/i18n/GLOSSARY.md
index 7f308858a5..686326689c 100644
--- a/i18n/GLOSSARY.md
+++ b/i18n/GLOSSARY.md
@@ -222,6 +222,10 @@ macOS TCC 的 kTCCServiceListenEvent(系统设置里叫「输入监控」)在 Ci
登录页免账号入口的动作名(面板内文字按钮 + 登录服务不可用时的 error 步逃生按钮,#697 起取代原游客圆钮)。与 not-signed-in 成对:动作叫「跳过登录」,进入后的状态叫「未登录」。历史说法「本地模式」「游客登录」已废弃——前者暗示另一种服务端连接方式,后者在本产品里没有对应的 guest 账号概念(代码里 GuestRoute 等内部标识不受本条约束)。先登记 proposed:en 的 Title Case 形态(Skip Sign-In)与本仓其它按钮的句首大写风格不一致,待随登录页文案统一时裁决。
+### Token Plan
+
+阿里云百炼与小米 MiMo 的外部订阅产品名称,四语统一保留官方英文写法;与 Coding Plan 是不同套餐和凭证类型,先登记为 proposed,避免供应商预设中混用产品名。
+
### Voice dictionary
语音输入的用户自定义术语表(人名、产品名、代号与其常见误识别写法),在同账号的电脑之间自动同步、手机只读查看。当前先采用四语直译并登记为待讨论术语,避免与「自定义词典」「术语表」「用户词库」等说法混用。
diff --git a/i18n/glossary.json b/i18n/glossary.json
index 7fc4d4ee86..a6493c93bc 100644
--- a/i18n/glossary.json
+++ b/i18n/glossary.json
@@ -1017,6 +1017,17 @@
"desktop:sessionShare.import.useWorktreeHint"
]
},
+ {
+ "id": "token-plan",
+ "status": "proposed",
+ "en": "Token Plan",
+ "translations": {
+ "zh-CN": "Token Plan",
+ "ja": "Token Plan",
+ "ko": "Token Plan"
+ },
+ "note": "阿里云百炼与小米 MiMo 的外部订阅产品名称,四语统一保留官方英文写法;与 Coding Plan 是不同套餐和凭证类型,先登记为 proposed,避免供应商预设中混用产品名。"
+ },
{
"id": "model-category-tts",
"status": "proposed",
diff --git a/packages/model-providers/catalog/providers.json b/packages/model-providers/catalog/providers.json
index 4d9aa09f23..296da969be 100644
--- a/packages/model-providers/catalog/providers.json
+++ b/packages/model-providers/catalog/providers.json
@@ -556,7 +556,7 @@
"models": [
{
"id": "qwen3.7-plus",
- "name": "Qwen3.7 Plus"
+ "name": "Qwen 3.7 Plus"
},
{
"id": "qwen3-coder-next",
@@ -574,7 +574,7 @@
"models": [
{
"id": "qwen3.7-plus",
- "name": "Qwen3.7 Plus"
+ "name": "Qwen 3.7 Plus"
},
{
"id": "qwen3-coder-next",
@@ -588,6 +588,260 @@
}
}
},
+ {
+ "id": "aliyun-bailian-token-plan-cn",
+ "name": "阿里云百炼 Token Plan(个人版)",
+ "nameEn": "Alibaba Cloud Bailian Token Plan (Personal)",
+ "docsUrl": "https://help.aliyun.com/zh/model-studio/token-plan-personal-overview",
+ "regionHint": "cn",
+ "runtimes": {
+ "claude-code": {
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "modelsUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/models",
+ "models": [
+ {
+ "id": "qwen3.8-max-preview",
+ "name": "Qwen 3.8 Max Preview",
+ "contextWindow": 983616
+ },
+ {
+ "id": "qwen3.7-max",
+ "name": "Qwen 3.7 Max",
+ "contextWindow": 992000
+ },
+ {
+ "id": "qwen3.7-plus",
+ "name": "Qwen 3.7 Plus",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "qwen3.6-flash",
+ "name": "Qwen 3.6 Flash",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "glm-5.2",
+ "name": "GLM-5.2",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "deepseek-v4-pro",
+ "name": "DeepSeek V4 Pro",
+ "contextWindow": 1048576
+ }
+ ]
+ },
+ "codex": {
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
+ "wireProtocol": "openai-chat",
+ "modelsUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/models",
+ "models": [
+ {
+ "id": "qwen3.8-max-preview",
+ "name": "Qwen 3.8 Max Preview",
+ "contextWindow": 983616
+ },
+ {
+ "id": "qwen3.7-max",
+ "name": "Qwen 3.7 Max",
+ "contextWindow": 992000
+ },
+ {
+ "id": "qwen3.7-plus",
+ "name": "Qwen 3.7 Plus",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "qwen3.6-flash",
+ "name": "Qwen 3.6 Flash",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "glm-5.2",
+ "name": "GLM-5.2",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "deepseek-v4-pro",
+ "name": "DeepSeek V4 Pro",
+ "contextWindow": 1048576
+ }
+ ]
+ }
+ }
+ },
+ {
+ "id": "aliyun-bailian-token-plan-team-cn",
+ "name": "阿里云百炼 Token Plan(团队版)",
+ "nameEn": "Alibaba Cloud Bailian Token Plan (Team)",
+ "docsUrl": "https://help.aliyun.com/zh/model-studio/token-plan-team-overview",
+ "regionHint": "cn",
+ "runtimes": {
+ "claude-code": {
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "modelsUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/models",
+ "models": [
+ {
+ "id": "qwen3.8-max-preview",
+ "name": "Qwen 3.8 Max Preview",
+ "contextWindow": 983616
+ },
+ {
+ "id": "qwen3.7-max",
+ "name": "Qwen 3.7 Max",
+ "contextWindow": 992000
+ },
+ {
+ "id": "qwen3.7-plus",
+ "name": "Qwen 3.7 Plus",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "qwen3.6-plus",
+ "name": "Qwen 3.6 Plus",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "qwen3.6-flash",
+ "name": "Qwen 3.6 Flash",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "deepseek-v4-pro",
+ "name": "DeepSeek V4 Pro",
+ "contextWindow": 1048576
+ },
+ {
+ "id": "deepseek-v4-flash",
+ "name": "DeepSeek V4 Flash",
+ "contextWindow": 1048576
+ },
+ {
+ "id": "deepseek-v3.2",
+ "name": "DeepSeek V3.2",
+ "contextWindow": 131072
+ },
+ {
+ "id": "kimi-k2.7-code",
+ "name": "Kimi K2.7 Code",
+ "contextWindow": 262144
+ },
+ {
+ "id": "kimi-k2.6",
+ "name": "Kimi K2.6",
+ "contextWindow": 262144
+ },
+ {
+ "id": "kimi-k2.5",
+ "name": "Kimi K2.5",
+ "contextWindow": 262144
+ },
+ {
+ "id": "glm-5.2",
+ "name": "GLM-5.2",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "glm-5.1",
+ "name": "GLM-5.1",
+ "contextWindow": 202752
+ },
+ {
+ "id": "glm-5",
+ "name": "GLM-5",
+ "contextWindow": 202752
+ },
+ {
+ "id": "MiniMax-M2.5",
+ "name": "MiniMax M2.5",
+ "contextWindow": 196608
+ }
+ ]
+ },
+ "codex": {
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
+ "wireProtocol": "openai-chat",
+ "modelsUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/models",
+ "models": [
+ {
+ "id": "qwen3.8-max-preview",
+ "name": "Qwen 3.8 Max Preview",
+ "contextWindow": 983616
+ },
+ {
+ "id": "qwen3.7-max",
+ "name": "Qwen 3.7 Max",
+ "contextWindow": 992000
+ },
+ {
+ "id": "qwen3.7-plus",
+ "name": "Qwen 3.7 Plus",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "qwen3.6-plus",
+ "name": "Qwen 3.6 Plus",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "qwen3.6-flash",
+ "name": "Qwen 3.6 Flash",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "deepseek-v4-pro",
+ "name": "DeepSeek V4 Pro",
+ "contextWindow": 1048576
+ },
+ {
+ "id": "deepseek-v4-flash",
+ "name": "DeepSeek V4 Flash",
+ "contextWindow": 1048576
+ },
+ {
+ "id": "deepseek-v3.2",
+ "name": "DeepSeek V3.2",
+ "contextWindow": 131072
+ },
+ {
+ "id": "kimi-k2.7-code",
+ "name": "Kimi K2.7 Code",
+ "contextWindow": 262144
+ },
+ {
+ "id": "kimi-k2.6",
+ "name": "Kimi K2.6",
+ "contextWindow": 262144
+ },
+ {
+ "id": "kimi-k2.5",
+ "name": "Kimi K2.5",
+ "contextWindow": 262144
+ },
+ {
+ "id": "glm-5.2",
+ "name": "GLM-5.2",
+ "contextWindow": 1000000
+ },
+ {
+ "id": "glm-5.1",
+ "name": "GLM-5.1",
+ "contextWindow": 202752
+ },
+ {
+ "id": "glm-5",
+ "name": "GLM-5",
+ "contextWindow": 202752
+ },
+ {
+ "id": "MiniMax-M2.5",
+ "name": "MiniMax M2.5",
+ "contextWindow": 196608
+ }
+ ]
+ }
+ }
+ },
{
"id": "google-gemini-api",
"name": "Google Gemini API",
diff --git a/packages/model-providers/src/__tests__/presets.test.ts b/packages/model-providers/src/__tests__/presets.test.ts
index a8ef2b007a..c23148a7d3 100644
--- a/packages/model-providers/src/__tests__/presets.test.ts
+++ b/packages/model-providers/src/__tests__/presets.test.ts
@@ -488,6 +488,89 @@ describe('官方渠道预设契约', () => {
}));
});
+ it('阿里云百炼 Coding Plan 与 Token Plan 使用专属端点,个人/团队版分开锁定模型窗口', () => {
+ const codingPlan = preset('aliyun-bailian-coding');
+ const personalTokenPlan = preset('aliyun-bailian-token-plan-cn');
+ const teamTokenPlan = preset('aliyun-bailian-token-plan-team-cn');
+ const codingPlanModels = [
+ { id: 'qwen3.7-plus', name: 'Qwen 3.7 Plus' },
+ { id: 'qwen3-coder-next', name: 'Qwen3 Coder Next' },
+ { id: 'qwen3-coder-plus', name: 'Qwen3 Coder Plus' },
+ ];
+ const personalTokenPlanModels = [
+ { id: 'qwen3.8-max-preview', name: 'Qwen 3.8 Max Preview', contextWindow: 983_616 },
+ { id: 'qwen3.7-max', name: 'Qwen 3.7 Max', contextWindow: 992_000 },
+ { id: 'qwen3.7-plus', name: 'Qwen 3.7 Plus', contextWindow: 1_000_000 },
+ { id: 'qwen3.6-flash', name: 'Qwen 3.6 Flash', contextWindow: 1_000_000 },
+ { id: 'glm-5.2', name: 'GLM-5.2', contextWindow: 1_000_000 },
+ { id: 'deepseek-v4-pro', name: 'DeepSeek V4 Pro', contextWindow: 1_048_576 },
+ ];
+ const teamTokenPlanModels = [
+ { id: 'qwen3.8-max-preview', name: 'Qwen 3.8 Max Preview', contextWindow: 983_616 },
+ { id: 'qwen3.7-max', name: 'Qwen 3.7 Max', contextWindow: 992_000 },
+ { id: 'qwen3.7-plus', name: 'Qwen 3.7 Plus', contextWindow: 1_000_000 },
+ { id: 'qwen3.6-plus', name: 'Qwen 3.6 Plus', contextWindow: 1_000_000 },
+ { id: 'qwen3.6-flash', name: 'Qwen 3.6 Flash', contextWindow: 1_000_000 },
+ { id: 'deepseek-v4-pro', name: 'DeepSeek V4 Pro', contextWindow: 1_048_576 },
+ { id: 'deepseek-v4-flash', name: 'DeepSeek V4 Flash', contextWindow: 1_048_576 },
+ { id: 'deepseek-v3.2', name: 'DeepSeek V3.2', contextWindow: 131_072 },
+ { id: 'kimi-k2.7-code', name: 'Kimi K2.7 Code', contextWindow: 262_144 },
+ { id: 'kimi-k2.6', name: 'Kimi K2.6', contextWindow: 262_144 },
+ { id: 'kimi-k2.5', name: 'Kimi K2.5', contextWindow: 262_144 },
+ { id: 'glm-5.2', name: 'GLM-5.2', contextWindow: 1_000_000 },
+ { id: 'glm-5.1', name: 'GLM-5.1', contextWindow: 202_752 },
+ { id: 'glm-5', name: 'GLM-5', contextWindow: 202_752 },
+ { id: 'MiniMax-M2.5', name: 'MiniMax M2.5', contextWindow: 196_608 },
+ ];
+ const tokenPlanModelsUrl =
+ 'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/models';
+
+ expect(codingPlan).toEqual(expect.objectContaining({
+ name: '阿里云百炼 Coding Plan(包月)',
+ nameEn: 'Alibaba Cloud Bailian Coding Plan',
+ docsUrl: 'https://help.aliyun.com/zh/model-studio/coding-plan',
+ regionHint: 'cn',
+ }));
+ expect(personalTokenPlan).toEqual(expect.objectContaining({
+ name: '阿里云百炼 Token Plan(个人版)',
+ nameEn: 'Alibaba Cloud Bailian Token Plan (Personal)',
+ docsUrl: 'https://help.aliyun.com/zh/model-studio/token-plan-personal-overview',
+ regionHint: 'cn',
+ }));
+ expect(teamTokenPlan).toEqual(expect.objectContaining({
+ name: '阿里云百炼 Token Plan(团队版)',
+ nameEn: 'Alibaba Cloud Bailian Token Plan (Team)',
+ docsUrl: 'https://help.aliyun.com/zh/model-studio/token-plan-team-overview',
+ regionHint: 'cn',
+ }));
+ expect(codingPlan?.runtimes['claude-code']).toEqual({
+ baseUrl: 'https://coding.dashscope.aliyuncs.com/apps/anthropic',
+ modelsUrl: 'https://coding.dashscope.aliyuncs.com/v1/models',
+ models: codingPlanModels,
+ });
+ expect(codingPlan?.runtimes.codex).toEqual({
+ baseUrl: 'https://coding.dashscope.aliyuncs.com/v1',
+ wireProtocol: 'openai-chat',
+ models: codingPlanModels,
+ });
+ for (const [tokenPlan, models] of [
+ [personalTokenPlan, personalTokenPlanModels],
+ [teamTokenPlan, teamTokenPlanModels],
+ ] as const) {
+ expect(tokenPlan?.runtimes['claude-code']).toEqual({
+ baseUrl: 'https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic',
+ modelsUrl: tokenPlanModelsUrl,
+ models,
+ });
+ expect(tokenPlan?.runtimes.codex).toEqual({
+ baseUrl: 'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
+ wireProtocol: 'openai-chat',
+ modelsUrl: tokenPlanModelsUrl,
+ models,
+ });
+ }
+ });
+
it.each(['zhipu-coding-plan-cn', 'zai-coding-plan-global'])(
'%s 的 Claude Code GLM-5.2 1M 入口保留完整窗口元数据',
(id) => {
diff --git a/packages/model-providers/src/providerBranding.ts b/packages/model-providers/src/providerBranding.ts
index 37c6a978cc..514a483e4a 100644
--- a/packages/model-providers/src/providerBranding.ts
+++ b/packages/model-providers/src/providerBranding.ts
@@ -75,6 +75,8 @@ const PROVIDER_LOGO_KIND_BY_ID: Readonly<Record<string, ProviderLogoKind>> = {
'minimax-cn': 'minimax',
'minimax-global': 'minimax',
'aliyun-bailian-coding': 'alibaba',
+ 'aliyun-bailian-token-plan-cn': 'alibaba',
+ 'aliyun-bailian-token-plan-team-cn': 'alibaba',
'google-gemini-api': 'google',
litellm: 'litellm',
'litellm-proxy': 'litellm',
@@ -103,6 +105,7 @@ const PROVIDER_LOGO_KIND_BY_HOST: readonly (readonly [string, ProviderLogoKind])
['minimaxi.com', 'minimax'],
['minimax.io', 'minimax'],
['dashscope.aliyuncs.com', 'alibaba'],
+ ['maas.aliyuncs.com', 'alibaba'],
['generativelanguage.googleapis.com', 'google'],
['longcat.chat', 'longcat'],
['xiaomimimo.com', 'xiaomimimo'],