Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/providers/base-url-choices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ 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 },
{ id: "custom", label: "Custom" },
];
Comment thread
Wibias marked this conversation as resolved.

/** Match a saved baseUrl to a known choice id (`custom` when it does not match). */
export function matchBaseUrlChoice(
choices: readonly ProviderBaseUrlChoice[],
Expand Down
3 changes: 2 additions & 1 deletion src/providers/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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" },
Comment thread
Wibias marked this conversation as resolved.
Comment thread
Wibias marked this conversation as resolved.
{
id: "alibaba-token-plan",
label: "Alibaba Token Plan (Beijing)",
Expand Down
7 changes: 6 additions & 1 deletion tests/provider-registry-parity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ 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" },
{ id: "custom", label: "Custom" },
]);
expect(KEY_LOGIN_PROVIDERS["alibaba-token-plan"]).toMatchObject({
label: "Alibaba Token Plan (Beijing)",
adapter: "openai-chat",
Expand Down Expand Up @@ -479,7 +484,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");
}
Expand Down
Loading