Skip to content

Commit 8d7b2d7

Browse files
committed
feat: update PLUS API host selection logic
1 parent bef2734 commit 8d7b2d7

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/core/src/common/plus-subscription.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { CreateOpenAIClient, OpenAIClientResult } from "./tool-types";
66

77
export const DEEPCODE_PLUS_LEGACY_HOST = "https://deepcode.vegamo.cn";
88
export const DEEPCODE_PLUS_HOST = "https://www.deepcodeplus.com";
9-
export const DEEPCODE_PLUS_LLM_HOST = "https://api.deepcodeplus.com";
9+
export const DEEPCODE_PLUS_LLM_HOST = "https://chat.deepcodeplus.com";
1010

1111
/** Undefined means unconfigured; all explicitly configured values must be valid. */
1212
export function normalizePlusApiKey(

‎packages/core/src/tests/openai-client.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test("on mode retains PLUS routing after the existing models warmup fails", asyn
6565
assert.equal(warmup.mock.callCount(), 1);
6666
assert.equal(first.usingPlus, true);
6767
assert.equal(first.apiKey, "sk-bbbbbbbbbbbbbbbbbbbbbbbbbb");
68-
assert.equal(first.baseURL, "https://api.deepcodeplus.com/plugin/openai");
68+
assert.equal(first.baseURL, "https://chat.deepcodeplus.com/plugin/openai");
6969
assert.equal(first.client?.baseURL, first.baseURL);
7070
assert.equal(factory().client, first.client);
7171
assert.equal(factory().usingPlus, true);

‎packages/core/src/tests/plus-api.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { reportNewPrompt } from "../common/telemetry";
1717
const routes = [
1818
[undefined, "https://deepcode.vegamo.cn", "https://deepcode.vegamo.cn"],
1919
[`sk-${"a".repeat(24)}`, "https://deepcode.vegamo.cn", "https://deepcode.vegamo.cn"],
20-
[`sk-${"b".repeat(26)}`, "https://www.deepcodeplus.com", "https://api.deepcodeplus.com"],
20+
[`sk-${"b".repeat(26)}`, "https://www.deepcodeplus.com", "https://chat.deepcodeplus.com"],
2121
] as const;
2222

2323
for (const [key, host, llmHost] of routes) {

‎packages/core/templates/skills/bundled/deepcode-self-refer/references/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ PLUS 独立配置文件为 `~/.deepcode-plus/settings.json`:
271271
}
272272
```
273273

274-
PLUS 接口根据去除首尾空白后的 `env.PLUS_API_KEY` 选择域名:`sk-` 后接 24 位字符串时,所有服务使用 `https://deepcode.vegamo.cn`;后接 26 位字符串时,LLM 请求 `/plugin/openai/**`(包括 `/models` 订阅探测和连接预热)使用 `https://api.deepcodeplus.com`,其余服务使用 `https://www.deepcodeplus.com`,包括网络搜索、图片理解、图片/视频生成、遥测及积分试算。未配置 Key 的匿名插件请求继续使用旧域名。不额外限制 Key 后缀字符类型;已配置但格式无效(包括空字符串或非字符串)时明确报错,`subscriptionPlan=off` 也不例外。 下文 `{llmHost}` 表示选定的 LLM 域名。
274+
PLUS 接口根据去除首尾空白后的 `env.PLUS_API_KEY` 选择域名:`sk-` 后接 24 位字符串时,所有服务使用 `https://deepcode.vegamo.cn`;后接 26 位字符串时,LLM 请求 `/plugin/openai/**`(包括 `/models` 订阅探测和连接预热)使用 `https://chat.deepcodeplus.com`,其余服务使用 `https://www.deepcodeplus.com`,包括网络搜索、图片理解、图片/视频生成、遥测及积分试算。未配置 Key 的匿名插件请求继续使用旧域名。不额外限制 Key 后缀字符类型;已配置但格式无效(包括空字符串或非字符串)时明确报错,`subscriptionPlan=off` 也不例外。 下文 `{llmHost}` 表示选定的 LLM 域名。
275275

276276
`subscriptionPlan` 支持 `default`、`on`、`off`;缺失或非法值按 `default` 处理。普通通道继续使用上文配置层级合并后的 API key 和 base URL。
277277

‎packages/core/templates/skills/bundled/deepcode-self-refer/references/configuration_en.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Configure PLUS separately in `~/.deepcode-plus/settings.json`:
269269
}
270270
```
271271

272-
PLUS API domains are selected from `env.PLUS_API_KEY` after trimming surrounding whitespace. With `sk-` followed by 24 characters, all services use `https://deepcode.vegamo.cn`. With 26 characters, LLM requests under `/plugin/openai/**` (including `/models` subscription probes and connection warmup) use `https://api.deepcodeplus.com`; all other services use `https://www.deepcodeplus.com`, including web search, image understanding, image/video generation, telemetry, and cost estimates. Without a key, anonymous plugin requests retain the legacy host. No additional suffix character restriction applies. An explicitly configured invalid value (including an empty string or non-string) produces an error even when `subscriptionPlan=off`. In the URLs below, `{llmHost}` refers to the selected LLM domain.
272+
PLUS API domains are selected from `env.PLUS_API_KEY` after trimming surrounding whitespace. With `sk-` followed by 24 characters, all services use `https://deepcode.vegamo.cn`. With 26 characters, LLM requests under `/plugin/openai/**` (including `/models` subscription probes and connection warmup) use `https://chat.deepcodeplus.com`; all other services use `https://www.deepcodeplus.com`, including web search, image understanding, image/video generation, telemetry, and cost estimates. Without a key, anonymous plugin requests retain the legacy host. No additional suffix character restriction applies. An explicitly configured invalid value (including an empty string or non-string) produces an error even when `subscriptionPlan=off`. In the URLs below, `{llmHost}` refers to the selected LLM domain.
273273

274274
`subscriptionPlan` accepts `default`, `on`, or `off`; missing or invalid values use `default`. The regular connection retains the user/project/environment precedence described above.
275275

0 commit comments

Comments
 (0)