From fc4f30feab9b18b2901e582ea96a79ec67af7722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=C2=B7Dong?= <98630204+GeorgeDong32@users.noreply.github.com> Date: Wed, 29 Oct 2025 09:20:19 +0800 Subject: [PATCH] fix: update Dashscope Anthropic API host and migrate old configs (#10973) * fix: update Dashscope Anthropic API host and migrate old configs * fix(migration): remove obsolete dashscope rewrite * fix(migrate): overwrite Anthropic API host for dashscope provider --- src/renderer/src/config/providers.ts | 2 +- src/renderer/src/pages/code/index.ts | 2 +- src/renderer/src/store/migrate.ts | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/config/providers.ts b/src/renderer/src/config/providers.ts index 0008013af4..db3d65e30b 100644 --- a/src/renderer/src/config/providers.ts +++ b/src/renderer/src/config/providers.ts @@ -419,7 +419,7 @@ export const SYSTEM_PROVIDERS_CONFIG: Record = type: 'openai', apiKey: '', apiHost: 'https://dashscope.aliyuncs.com/compatible-mode/v1/', - anthropicApiHost: 'https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy', + anthropicApiHost: 'https://dashscope.aliyuncs.com/apps/anthropic', models: SYSTEM_MODELS.dashscope, isSystem: true, enabled: false diff --git a/src/renderer/src/pages/code/index.ts b/src/renderer/src/pages/code/index.ts index 1529043738..b2ddeb9d6f 100644 --- a/src/renderer/src/pages/code/index.ts +++ b/src/renderer/src/pages/code/index.ts @@ -72,7 +72,7 @@ export const getCodeToolsApiBaseUrl = (model: Model, type: EndpointType) => { }, dashscope: { anthropic: { - api_base_url: 'https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy' + api_base_url: 'https://dashscope.aliyuncs.com/apps/anthropic' } }, modelscope: { diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index 19346dace4..b54967a2e6 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -2728,6 +2728,11 @@ const migrateConfig = { preset.settings.toolUseMode = DEFAULT_ASSISTANT_SETTINGS.toolUseMode } }) + // 更新阿里云百炼的 Anthropic API 地址 + const dashscopeProvider = state.llm.providers.find((provider) => provider.id === 'dashscope') + if (dashscopeProvider) { + dashscopeProvider.anthropicApiHost = 'https://dashscope.aliyuncs.com/apps/anthropic' + } return state } catch (error) { logger.error('migrate 166 error', error as Error)