dsh-connect-trae 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.5.1 (2026-10-16)
4
+
5
+ > **DeepSeek-V4 四个模型行不再必然报 4001。** 本版修一处 wire 名单合并的方向错误:
6
+ > 同名的多行里,旧代码让**最后**一行取胜,于是一个元数据残缺的小写尾行抢走了展示名,
7
+ > 桥接层把 `config_name` 改写成了上游不认的小写拼写。改为**每张映射表先到先得**后,
8
+ > 规范行留在原位,不再发生任何改写。
9
+
10
+ ### 修复
11
+
12
+ - **DeepSeek-V4 四行(`DeepSeek-V4-Flash` / `-Flash-Official` / `-Pro` / `-Pro-Official`)选中发送必报 4001**(issue #38):
13
+ - **上游名单的形状**:CN 区 wire(`get_detail_param`)把同一族列了**三行**,共享同一个展示名,其中尾行是
14
+ 元数据残缺的小写行 —— `DeepSeek-V4-Flash` 展示名同时对应 `DeepSeek-V4-Flash-Official`、
15
+ `DeepSeek-V4-Flash`、`deepseek-v4-flash` 三个 id;`DeepSeek-V4-Pro` 完全同构。
16
+ - **改坏它的那一步**:`mergeTraeModelSources` 用 `wireByName.set(...)` / `wireById.set(...)`
17
+ **无条件写入**,所以后到的那一行会覆盖先到的同名键。尾行的 `name` 正好是小写 id,
18
+ 于是 `displayKey("DeepSeek-V4-Flash")` 被它抢占,桥接层据此把 `config_name` 改写成
19
+ `deepseek-v4-flash`,上游回 `4001 the param is invalid`。
20
+ - **为什么 `-Official` 行也一起废**:`TraeSoloBridge` 在 catalog 取不到 `wireConfigName` 时
21
+ 会退回 `wireResolver(entry?.name)`,而 `entry.name` 同样是 `DeepSeek-V4-Flash`,
22
+ 于是又落到那一行上 —— **两行一起废**。
23
+ - **修法**:两张映射表都改成**先到先得**(`if (!map.has(key)) map.set(...)`)。
24
+ `displayKey("DeepSeek-V4-Flash")` 于是命中 id 完全相同的规范行,该行的 `config_name`
25
+ 本就是 `DeepSeek-V4-Flash`(与展示名一致),**不再发生改写**。
26
+ - **本机 CN 实测**(插件真实请求形状 `{messages, model, config_name, function, stream}`):
27
+ - 修前:`DeepSeek-V4-Flash` → 发出 `deepseek-v4-flash` → 流内 `4001`;`DeepSeek-V4-Pro` 同;
28
+ - 修后:四行发出 `DeepSeek-V4-Flash` / `DeepSeek-V4-Pro`(`-Official` 两行发出自身 id)→ **HTTP 200 + 完整正文**;
29
+ - 对照探测:大写能通、小写必 `4001`,`glm-5.2` 作基线正常 —— 证实「号码牌本身是好的,是被改写坏的」。
30
+
31
+ > 注意:`4001` 是**流内** `event:error`(外层 HTTP 仍是 200),所以只看状态码会把它误判成成功。
32
+
33
+ ### 测试
34
+
35
+ - 新增 2 例回归:`mergeTraeModelSources` 在「同名 + 尾行小写」的 wire 上必须让规范行取胜;
36
+ 以及「按展示名 join」在改为先到先得后仍然生效(防止过度修正)。
37
+ 两例在旧代码上均失败、在新代码上通过。
38
+ - 全仓 **619** 例测试通过。
39
+
3
40
  ## 3.5.0 (2026-10-14)
4
41
 
5
42
  > **积分读数不再只有一个固定位置。** 本版向同族 `dsh-connect-workbuddy` 学来它的 issue #62
package/README.md CHANGED
@@ -114,6 +114,12 @@ Trae does not serve this model under the SOLO function the request used
114
114
 
115
115
  即「上游不提供该模型」被如实说明,而不是静默失败或像网络故障。**官方把它们开放到 SOLO 通道后,插件会自动可用**(判据就是能不能拿到调用 id),无需升级插件。
116
116
 
117
+ > **同一条报错的另一种成因(3.5.1 已修,issue #38)**:`DeepSeek-V4` 四行曾报**同样的 4001**,但成因相反 ——
118
+ > 它们在上游名单里**本来可以调用**,只是 CN 区的 wire 把同一族列了三行且共享展示名,旧代码让**最后**一行
119
+ > (元数据残缺的小写行 `deepseek-v4-flash`)抢走了展示名键,桥接层据此把 `config_name` 改写成小写拼写,
120
+ > 上游拒收。**判别方法**:看这个模型在上游名单里有没有调用 id —— 有而报 4001,就是这一类。
121
+ > 3.5.1 起两张映射表都改为先到先得,不再发生改写,四行已实测恢复正常。
122
+
117
123
  > **为什么现在会显示(2026-10-02 起的策略)**:此前这类「目录里有、但拿不到调用 id」的模型会被**直接隐藏**,理由是「放出来只会报错」。但可调用名单是**按账号档位**下发的——在免费账号上测不到,不等于付费账号用不了(issue #19 的报告人就是 Pro:他的账号能调用本机免费账号被门禁挡住的模型)。**隐藏用户自己 Trae IDE 里有的模型,比让他看到一条明确的错误更糟**,所以改为:全部呈现 + 如实报错。
118
124
 
119
125
  > `deepseek-v4.1-flash` 曾在此列——`docs/DS41_CALLABILITY.md`(2026-09-15 取证)实测 8 个 SOLO function
package/lib/index.js CHANGED
@@ -222,10 +222,8 @@ function displayKey(name) {
222
222
  function mergeTraeModelSources(remote, wire) {
223
223
  const wireByName = /* @__PURE__ */ new Map();
224
224
  const wireById = /* @__PURE__ */ new Map();
225
- for (const model of wire) {
226
- wireByName.set(displayKey(model.name), model);
227
- wireById.set(displayKey(model.id), model);
228
- }
225
+ for (const model of wire) if (!wireById.has(displayKey(model.id))) wireById.set(displayKey(model.id), model);
226
+ for (const model of wire) if (!wireByName.has(displayKey(model.name))) wireByName.set(displayKey(model.name), model);
229
227
  const result = [];
230
228
  for (const model of remote) {
231
229
  const wireModel = wireById.get(displayKey(model.id)) ?? wireByName.get(displayKey(model.name));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-connect-trae",
3
3
  "displayName": "DSH Connect Trae",
4
4
  "description": "把本机登录的 Trae 模型接入 DeepSeek Harness:国内版与国际版双供应商并行,提供用量/积分概览与每日签到领取。",
5
- "version": "3.5.0",
5
+ "version": "3.5.1",
6
6
  "author": "dingminhua",
7
7
  "copyright": "Copyright (c) 2026 LaoDing",
8
8
  "license": "MIT",