dsh-connect-trae 2.7.0 → 2.7.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 +28 -0
- package/lib/index.js +31 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.7.1 (2026-10-05)
|
|
4
|
+
|
|
5
|
+
> **修复「Max 档随机丢失、同一模型上下文窗口在多次刷新间漂移」**([#23](https://github.com/dingminhua/dsh-connect-trae/issues/23),报告人 JiewiW)。
|
|
6
|
+
>
|
|
7
|
+
> 这是 **2.6.0 引入/放大的缺陷**:那一版把发现侧从 2 个货架扩到 7 个,却保留了「先到先得」去重——而同一个模型在多个货架里的**容量并不相同**,货架顺序又**每次调用都不同**。结果同一模型这次是 `116000`、下次是 `256000`、再下次才带 1M Max,用户配置的 1M 预算被随机忽略。
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **跨货架去重改为「保留容量最强的行」**(`TraeSoloRemoteCatalogClient.fetchModels`):
|
|
12
|
+
- **根因**:remote `/models` 按 function 分组,同一模型 id 出现在多个组里,各组报告不同容量。实测(本机 CN 凭证,2026-10-05)同一次响应里 `Doubao-Seed-2.1-Pro` 的各组值:`builder_v3` → `116000`/无 Max;`solo_work_remote` / `solo_work_lite` → `256000`/无 Max;`chat_v3` / `solo_agent` / `solo_agent_remote` → `256000`/**`1000000`**(`max_mode: true`)。
|
|
13
|
+
- **为什么旧写法必错**:原来的去重是 `seen` Set 的「第一次遇到就锁定」,而我当时的代码注释还写着「保持网关自己的组顺序稳定」——**那个假设是错的**:连打 5 次实测得到 **5 种不同的组顺序**。于是容量的发布值取决于哪一组恰好先回来。`applyContextBudgets` 只能在 `maxContextWindow` 存在时升窗,所以丢失该字段会让配置了 1M 的模型被静默压到 256K 或更低,DSH 因此在远早于用户设定的阈值处反复压缩。
|
|
14
|
+
- **修法**:按 ① 带 Max 档优先 ② 都有 Max 取更大 ③ 都无 Max 取更宽的 dev 窗口 的顺序择强;平手保留先到者(模型顺序仍由网关决定)。同一 id 的各行在 `multimodal` / `reasoning` / 积分倍率上完全一致(同日实测逐字段核对),因此按容量择强不会丢失能力信息。
|
|
15
|
+
- **实测对比**(本机 CN,连打 6 次实时目录,同一预算配置):
|
|
16
|
+
| | 修复前 | 修复后 |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| `Doubao-Seed-2.1-Pro` 的取值 | `116000/无`、`256000/1000000`、`256000/无` **三种漂移** | 6/6 稳定 **`256000/1000000`** |
|
|
19
|
+
| 整目录带 Max 的模型数 | 11 → 26 **随机** | 6/6 稳定 **26** |
|
|
20
|
+
|
|
21
|
+
### Tests
|
|
22
|
+
|
|
23
|
+
- **全仓 413 → 417**:新增 4 例(`preferStrongerRow` 的三条择强分支 + 平手保留先到;以及**同一组数据在全部 6 种货架排列下产出完全相同的目录**——这条直接锁住了「结果不得依赖网关顺序」)。
|
|
24
|
+
- **变异验证 3 次全部被抓**:改回「先到先得」→ 1 例失败;去掉 Max 档优先 → 2 例失败;把平手规则从 `>` 改成 `>=`(后到者胜)→ 1 例失败。
|
|
25
|
+
- 其中第 3 次最初**没被抓到**:我原来的平手用例只覆盖了「都无 Max」的情况,没覆盖「两个相等的 Max」。补齐用例后才抓住——这本身说明那条断言当时的覆盖是假的。
|
|
26
|
+
|
|
27
|
+
### 致谢
|
|
28
|
+
|
|
29
|
+
报告人 **JiewiW** 给出的定位(跨组容量不一致 + 组顺序不稳定)与实测数据表完全正确,并附了可直接套用的补丁思路;本版按其方向实现,并补上了「结果与顺序无关」的回归测试。
|
|
30
|
+
|
|
3
31
|
## 2.7.0 (2026-10-02)
|
|
4
32
|
|
|
5
33
|
> **新增「一键测试启用模型」**:给每个已启用的模型发一条最小消息,看哪些**真的能应答**。
|
package/lib/index.js
CHANGED
|
@@ -2851,6 +2851,33 @@ const TRAE_REMOTE_DIRECTORY_FUNCTIONS = {
|
|
|
2851
2851
|
]
|
|
2852
2852
|
};
|
|
2853
2853
|
/**
|
|
2854
|
+
* Of two rows for the SAME model id, the one that advertises the stronger
|
|
2855
|
+
* capacity (issue #23).
|
|
2856
|
+
*
|
|
2857
|
+
* The gateway groups its directory by function and reports a model's capacity
|
|
2858
|
+
* per group, with the group order varying between calls. Keeping the strongest
|
|
2859
|
+
* row makes the published window deterministic:
|
|
2860
|
+
*
|
|
2861
|
+
* 1. a row with a Max tier beats one without (`maxContextWindow` is only set
|
|
2862
|
+
* when the group reported `max_mode: true` with a positive max);
|
|
2863
|
+
* 2. two Max rows: the larger max wins;
|
|
2864
|
+
* 3. no Max on either side: the wider dev window wins.
|
|
2865
|
+
*
|
|
2866
|
+
* Ties keep the incumbent, so the first row seen still decides equal cases and
|
|
2867
|
+
* the model order stays the one the gateway sent.
|
|
2868
|
+
*/
|
|
2869
|
+
function preferStrongerRow(candidate, incumbent) {
|
|
2870
|
+
if (incumbent === void 0) return candidate;
|
|
2871
|
+
const candidateMax = candidate.maxContextWindow;
|
|
2872
|
+
const incumbentMax = incumbent.maxContextWindow;
|
|
2873
|
+
if (candidateMax !== void 0 || incumbentMax !== void 0) {
|
|
2874
|
+
if (incumbentMax === void 0) return candidate;
|
|
2875
|
+
if (candidateMax === void 0) return incumbent;
|
|
2876
|
+
return candidateMax > incumbentMax ? candidate : incumbent;
|
|
2877
|
+
}
|
|
2878
|
+
return (candidate.contextWindow ?? 0) > (incumbent.contextWindow ?? 0) ? candidate : incumbent;
|
|
2879
|
+
}
|
|
2880
|
+
/**
|
|
2854
2881
|
* Region-scoped request dressing. The CN portal is `solo.trae.cn` with the
|
|
2855
2882
|
* CN locale headers; the international directory lives on the shared
|
|
2856
2883
|
* `coresg-normal.trae.ai` gateway and was verified (2026-09-15) with the
|
|
@@ -2907,14 +2934,13 @@ var TraeSoloRemoteCatalogClient = class {
|
|
|
2907
2934
|
});
|
|
2908
2935
|
if (!response.ok) throw new Error(`SOLO remote models returned HTTP ${response.status}`);
|
|
2909
2936
|
const groups = (await response.json()).data?.list ?? [];
|
|
2910
|
-
const
|
|
2911
|
-
const models = [];
|
|
2937
|
+
const byId = /* @__PURE__ */ new Map();
|
|
2912
2938
|
for (const group of groups) for (const raw of group.models ?? []) {
|
|
2913
2939
|
const model = parseTraeRemoteModel(raw);
|
|
2914
|
-
if (model === void 0
|
|
2915
|
-
|
|
2916
|
-
models.push(model);
|
|
2940
|
+
if (model === void 0) continue;
|
|
2941
|
+
byId.set(model.id, preferStrongerRow(model, byId.get(model.id)));
|
|
2917
2942
|
}
|
|
2943
|
+
const models = [...byId.values()];
|
|
2918
2944
|
if (models.length === 0) throw new Error("SOLO remote models response contained no models");
|
|
2919
2945
|
return models;
|
|
2920
2946
|
}
|
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": "2.7.
|
|
5
|
+
"version": "2.7.1",
|
|
6
6
|
"author": "dingminhua",
|
|
7
7
|
"copyright": "Copyright (c) 2026 LaoDing",
|
|
8
8
|
"license": "MIT",
|