From eef4064a03b850523dbbae830cf866ad87c06757 Mon Sep 17 00:00:00 2001 From: Wibias <37517432+Wibias@users.noreply.github.com> Date: Fri, 31 Jul 2026 00:18:02 +0200 Subject: [PATCH 1/3] fix: address issue #756 Fixes #756 --- src/providers/base-url-choices.ts | 9 +++++++++ src/providers/registry.ts | 3 ++- tests/provider-registry-parity.test.ts | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/providers/base-url-choices.ts b/src/providers/base-url-choices.ts index 2c17a8e23..0cf4ffc24 100644 --- a/src/providers/base-url-choices.ts +++ b/src/providers/base-url-choices.ts @@ -39,6 +39,15 @@ export const ALIBABA_INTL_BASE_URL_CHOICES: readonly ProviderBaseUrlChoice[] = [ { id: "custom", label: "Custom" }, ]; +/** Alibaba Coding Plan endpoint presets (international default; China mainland selectable). */ +export const ALIBABA_CODING_INTL_BASE_URL = "https://coding-intl.dashscope.aliyuncs.com/v1"; +export const ALIBABA_CODING_CN_BASE_URL = "https://coding.dashscope.aliyuncs.com/v1"; + +export const ALIBABA_CODING_BASE_URL_CHOICES: readonly ProviderBaseUrlChoice[] = [ + { id: "intl", label: "International", baseUrl: ALIBABA_CODING_INTL_BASE_URL }, + { id: "china", label: "China", baseUrl: ALIBABA_CODING_CN_BASE_URL }, +]; + /** Match a saved baseUrl to a known choice id (`custom` when it does not match). */ export function matchBaseUrlChoice( choices: readonly ProviderBaseUrlChoice[], diff --git a/src/providers/registry.ts b/src/providers/registry.ts index 663e8c8ec..df3ce4c3c 100644 --- a/src/providers/registry.ts +++ b/src/providers/registry.ts @@ -5,6 +5,7 @@ import type { ProviderBaseUrlChoice } from "./base-url-choices"; import { QWEN_CLOUD_BASE_URL_CHOICES, QWEN_CLOUD_TOKEN_PLAN_BASE_URL, ALIBABA_INTL_BASE_URL_CHOICES, ALIBABA_INTL_TOKEN_PLAN_BASE_URL, + ALIBABA_CODING_BASE_URL_CHOICES, ALIBABA_CODING_INTL_BASE_URL, } from "./base-url-choices"; import { CURSOR_STATIC_MODELS, @@ -969,7 +970,7 @@ export const PROVIDER_REGISTRY: readonly ProviderRegistryEntry[] = [ // 2026-07-10: docs unverified; model data frozen. Evidence: devlog/_plan/260710_provider_hardening/002_research_cn.md. { id: "qianfan", label: "Qianfan (Baidu)", baseUrl: "https://qianfan.baidubce.com/v2", adapter: "openai-chat", authKind: "key", dashboardUrl: "https://console.bce.baidu.com/iam/#/iam/apikey/list" }, // 2026-07-10: docs unverified; model data frozen. Evidence: devlog/_plan/260710_provider_hardening/002_research_cn.md. - { id: "alibaba", label: "Alibaba Coding Plan", baseUrl: "https://coding-intl.dashscope.aliyuncs.com/v1", adapter: "openai-chat", authKind: "key", dashboardUrl: "https://dashscope.console.aliyun.com/apiKey" }, + { id: "alibaba", label: "Alibaba Coding Plan", baseUrl: ALIBABA_CODING_INTL_BASE_URL, adapter: "openai-chat", authKind: "key", allowBaseUrlOverride: true, baseUrlChoices: ALIBABA_CODING_BASE_URL_CHOICES, dashboardUrl: "https://dashscope.console.aliyun.com/apiKey" }, { id: "alibaba-token-plan", label: "Alibaba Token Plan (Beijing)", diff --git a/tests/provider-registry-parity.test.ts b/tests/provider-registry-parity.test.ts index d2f7d5735..897e83db0 100644 --- a/tests/provider-registry-parity.test.ts +++ b/tests/provider-registry-parity.test.ts @@ -252,6 +252,10 @@ describe("provider registry parity", () => { label: "Alibaba Coding Plan", baseUrl: "https://coding-intl.dashscope.aliyuncs.com/v1", }); + expect(PROVIDER_REGISTRY.find(entry => entry.id === "alibaba")?.baseUrlChoices).toEqual([ + { id: "intl", label: "International", baseUrl: "https://coding-intl.dashscope.aliyuncs.com/v1" }, + { id: "china", label: "China", baseUrl: "https://coding.dashscope.aliyuncs.com/v1" }, + ]); expect(KEY_LOGIN_PROVIDERS["alibaba-token-plan"]).toMatchObject({ label: "Alibaba Token Plan (Beijing)", adapter: "openai-chat", @@ -479,7 +483,7 @@ describe("provider registry parity", () => { test("base URL override permission is registry-only and limited to opted-in providers", () => { const optedIn = PROVIDER_REGISTRY.filter(entry => entry.allowBaseUrlOverride); - expect(optedIn.map(entry => entry.id)).toEqual(["ollama", "vllm", "lm-studio", "qwen-cloud", "alibaba-token-plan-intl", "litellm"]); + expect(optedIn.map(entry => entry.id)).toEqual(["ollama", "vllm", "lm-studio", "qwen-cloud", "alibaba", "alibaba-token-plan-intl", "litellm"]); for (const entry of optedIn) { expect(providerConfigSeed(entry)).not.toHaveProperty("allowBaseUrlOverride"); } From 6729491c3ee4bfc8caec51a1394dc1a82458079c Mon Sep 17 00:00:00 2001 From: Wibias <37517432+Wibias@users.noreply.github.com> Date: Fri, 31 Jul 2026 02:20:35 +0200 Subject: [PATCH 2/3] fix(providers): preserve custom Alibaba Coding base URLs Add a custom baseUrl choice so dashboard saves do not rewrite non-preset Coding Plan endpoints to the international default. --- src/providers/base-url-choices.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/providers/base-url-choices.ts b/src/providers/base-url-choices.ts index 0cf4ffc24..b2af6f1d0 100644 --- a/src/providers/base-url-choices.ts +++ b/src/providers/base-url-choices.ts @@ -46,6 +46,7 @@ export const ALIBABA_CODING_CN_BASE_URL = "https://coding.dashscope.aliyuncs.com export const ALIBABA_CODING_BASE_URL_CHOICES: readonly ProviderBaseUrlChoice[] = [ { id: "intl", label: "International", baseUrl: ALIBABA_CODING_INTL_BASE_URL }, { id: "china", label: "China", baseUrl: ALIBABA_CODING_CN_BASE_URL }, + { id: "custom", label: "Custom" }, ]; /** Match a saved baseUrl to a known choice id (`custom` when it does not match). */ From c712e786ae2c94b7b9fe00a3f40de1567f0a165c Mon Sep 17 00:00:00 2001 From: Wibias <37517432+Wibias@users.noreply.github.com> Date: Fri, 31 Jul 2026 02:44:51 +0200 Subject: [PATCH 3/3] test(providers): expect Alibaba Coding Plan custom baseUrl choice Registry now includes the custom endpoint option alongside intl and china presets. --- tests/provider-registry-parity.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/provider-registry-parity.test.ts b/tests/provider-registry-parity.test.ts index 897e83db0..9d7d91d40 100644 --- a/tests/provider-registry-parity.test.ts +++ b/tests/provider-registry-parity.test.ts @@ -255,6 +255,7 @@ describe("provider registry parity", () => { expect(PROVIDER_REGISTRY.find(entry => entry.id === "alibaba")?.baseUrlChoices).toEqual([ { id: "intl", label: "International", baseUrl: "https://coding-intl.dashscope.aliyuncs.com/v1" }, { id: "china", label: "China", baseUrl: "https://coding.dashscope.aliyuncs.com/v1" }, + { id: "custom", label: "Custom" }, ]); expect(KEY_LOGIN_PROVIDERS["alibaba-token-plan"]).toMatchObject({ label: "Alibaba Token Plan (Beijing)",