fix(alicode-intl): split into Coding Plan + Model Studio providers

8b9cac1 swapped alicode-intl to the DashScope compatible-mode endpoint to
fix #2591 for standard DashScope keys, but that broke Coding Plan keys
(sk-sp-...) which only work on coding-intl.dashscope.aliyuncs.com. The two
key types use two different hosts and are not interchangeable.

- alicode-intl: revert to coding-intl endpoint (Coding Plan keys)
- alims-intl: new provider for dashscope-intl/compatible-mode (standard keys)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
decolua
2026-07-19 16:29:55 +07:00
co-authored by Claude Fable 5
parent c4a120af8f
commit 55628eea02
9 changed files with 86 additions and 19 deletions
+5 -2
View File
@@ -620,10 +620,13 @@ async function testApiKeyConnection(connection, effectiveProxy = null) {
return { valid, error: valid ? null : "Invalid API key" };
}
case "alicode":
case "alicode-intl": {
// Aliyun Coding Plan uses OpenAI-compatible API
case "alicode-intl":
case "alims-intl": {
// Aliyun Coding Plan uses OpenAI-compatible API; alims-intl uses Model Studio compatible-mode
const aliBaseUrl = connection.provider === "alicode-intl"
? "https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions"
: connection.provider === "alims-intl"
? "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions"
: "https://coding.dashscope.aliyuncs.com/v1/chat/completions";
const res = await fetchWithConnectionProxy(aliBaseUrl, {
method: "POST",