diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index b993394a6..f9f2c6071 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -26,6 +26,7 @@ - Fixed Alibaba DashScope/Bailian per-minute token throttle (`429 Throttling.AllocationQuota`, "You exceeded your current quota, please check your plan and billing details. … error-code#token-limit", `type=insufficient_quota`) being misclassified as `QUOTA_EXHAUSTED`. The OpenAI-compatible billing wording (and the `insufficient_quota` payload code) matched the usage-limit classifier, so a transient TPM/TPS cap — which Bailian's docs document as clearing within the minute window — blocked the credential and stalled the session for the 30-minute quota backoff instead of retrying with a short backoff on the same credential. Bodies linking the `error-code#token-limit` anchor now classify as `RATE_LIMIT_EXCEEDED` and stay in the transient lane; the identical wording without the anchor (OpenAI's real account-quota error) is unchanged. - Fixed Anthropic-compatible streams dropping thinking bytes supplied by `content_block_start`, which invalidated signed-thinking replay ([#8319](https://github.com/can1357/oh-my-pi/pull/8319) by [@max12525k](https://github.com/max12525k)). +- Updated the Alibaba Coding Plan China login to open Bailian API-key management after the DashScope console was retired ([#8691](https://github.com/can1357/oh-my-pi/issues/8691)). ## [17.3.4] - 2026-08-14 diff --git a/packages/ai/src/registry/alibaba-coding-plan.ts b/packages/ai/src/registry/alibaba-coding-plan.ts index 6fcda83ce..979aab9c2 100644 --- a/packages/ai/src/registry/alibaba-coding-plan.ts +++ b/packages/ai/src/registry/alibaba-coding-plan.ts @@ -4,7 +4,7 @@ import type { OAuthController, OAuthCredentials, OAuthLoginCallbacks } from "./o import type { ProviderDefinition } from "./types"; const DEFAULT_AUTH_URL = "https://modelstudio.console.alibabacloud.com/"; -const CHINA_AUTH_URL = "https://dashscope.console.aliyun.com/"; +const CHINA_AUTH_URL = "https://bailian.console.aliyun.com/?tab=model#/api-key"; const DEFAULT_API_BASE_URL = "https://coding-intl.dashscope.aliyuncs.com/v1"; const CHINA_API_BASE_URL = "https://coding.dashscope.aliyuncs.com/v1"; const VALIDATION_MODEL = "qwen3.5-plus"; @@ -32,7 +32,7 @@ export async function loginAlibabaCodingPlan(options: OAuthController): Promise< if (choice === "2") { baseUrl = CHINA_API_BASE_URL; authUrl = CHINA_AUTH_URL; - instructions = "Copy your API key from the Alibaba Cloud DashScope console (China mainland)"; + instructions = "Copy your API key from the Alibaba Cloud Bailian console (China mainland)"; } else if (choice === "3") { const customUrl = await options.onPrompt({ message: "Enter custom base URL", diff --git a/packages/ai/test/alibaba-endpoint-selection.test.ts b/packages/ai/test/alibaba-endpoint-selection.test.ts index 30cd8e266..898829457 100644 --- a/packages/ai/test/alibaba-endpoint-selection.test.ts +++ b/packages/ai/test/alibaba-endpoint-selection.test.ts @@ -69,8 +69,10 @@ describe("alibaba-coding-plan endpoint selection", () => { expect(result.access).toBe("sk-cn-key"); expect(result.refresh).toBe("sk-cn-key"); expect(result.enterpriseUrl).toBe("https://coding.dashscope.aliyuncs.com/v1"); - expect(capturedAuth?.url).toBe("https://dashscope.console.aliyun.com/"); - expect(capturedAuth?.instructions).toContain("China mainland"); + expect(capturedAuth?.url).toBe("https://bailian.console.aliyun.com/?tab=model#/api-key"); + expect(capturedAuth?.instructions).toBe( + "Copy your API key from the Alibaba Cloud Bailian console (China mainland)", + ); expect(validateSpy).toHaveBeenCalledWith({ provider: "Alibaba Coding Plan",