dsh-model-switch 0.4.63 → 0.4.64
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 +15 -0
- package/lib/subagent-runtime.js +29 -7
- package/lib/types/subagent-runtime.d.ts +8 -3
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## v0.4.64
|
|
2
|
+
|
|
3
|
+
DSH `0.2.2-rc.2` 兼容 + 子代理委派路由修复。
|
|
4
|
+
|
|
5
|
+
- **根因**:`0.2.2-rc.2` 把 `subagents.startActivation` 的规格从嵌套改为扁平——`@deepseek-ai/dsh-tool-subagent` 以 `...request` 把 `SubagentStartRequest` 字段(`parent`/`prompt`/`agentOptions` 等)直接展开到 spec 顶层,不再有嵌套的 `request` 字段。0.4.63 的包装器检查 `spec.request` 看到 `undefined` 后原样放行,子代理回退到父会话模型,固定/分组路由都不再注入。
|
|
6
|
+
- **修复(`src/subagent-runtime.ts`)**:新增 `routedSpecOf`,同一包装器接受两种规格形状——嵌套(0.2.1–0.2.2-rc.1)与扁平(0.2.2-rc.2+);无法识别的形状继续原样放行(未来形状保持官方回退可达)。`SubagentActivationSpecLike` 的 `request` 变为可选并继承 `RoutableSubagentRequest`;`src/subagent-runtime-legacy.ts` 的废弃入口同步类型。旧版 `start()` 线不受影响。
|
|
7
|
+
- **验证(virtual / 零真实额度)**:
|
|
8
|
+
- **rc.2 lab**(`D:/dsh-artifacts/rc2-diff/home`,端口 3084,探针 4719,DSH `0.2.2-rc.2` + 本构建 + `dsh-prime-memory@0.26.37` + `dsh-reference-session-collector@0.2.8`):回放一次 `subagent` 工具调用,探针记录 `gpt-6.1-sol`(父)→ `mimo-v2.6-pro`(子代理实际请求,配置的分组固定对)→ `gpt-6.1-sol`(父续跑);诊断行确认注入的 `agentOptions` 为 `apigoto/mimo-v2.6-pro/high`。同轮 `subagents/interruptByUser` 返回 `{accepted:true}`(rc.2 的 UI 停止端点;旧名 `interruptByParent` 已被上游撤回,返回 not found),全部插件行 active、无 incompatible/did-not-activate;`session/create` 正常(rc.2 对 standard preset 引用行新增 never-started 校验,lab 装齐依赖后通过)。
|
|
9
|
+
- **rc.1 回归**(`D:/dsh-artifacts/rc1-diff/home-next`):同一构建在嵌套形状上 delegation 仍命中 `mimo-v2.6-pro`。
|
|
10
|
+
- **标题路由**:rc.2 上每轮命名请求走配置路由(`mimo-v2.6-flash`),改分组 pin 后下一请求即 `mimo-v2.6-pro`(免重启热切换)。all-prompts 节奏的触发依赖宿主在会话 log 中记录 `request/header` 事件——官方 all-prompts 行与本插件行走同一链路(`dsh-session-title-all-prompts-llm` 与 `dsh-session-title` 两包在 rc.1/rc.2 间 byte-identical)。
|
|
11
|
+
- **prime-memory 0.26.37**:适配器 push `apigoto/deepseek-flash`(capabilities 报告 `installed:true`),`/dsh-memory/rpc/settings-get` 读回一致,memory.log「蒸馏模型路由」行匹配,蒸馏请求命中探针 `deepseek-flash`。0.26.37 的 `engines.dsh` 从精确枚举改为范围 `>=0.1.1-rc.2 <0.3.0`,是其支持 rc.1/rc.2 宿主的方式;上游已知降级:rc.2 上其 settings 分区注册 API 不可用(「记忆模式开关降级为恒开」),与本插件的 settings-forms 写入无关(适配器写入与读回均已验证)。
|
|
12
|
+
- **`dshReleases`**:新增 `0.2.2-rc.2: compatible`。npm `latest` 仍为 `0.2.2-rc.1`(`0.2.2-rc.2` 在 `next` 上,且桌面 runtime 已实际更新至该版本),按 0.2.1-rc.3 先例以 `latest` 同等证据标准验证。
|
|
13
|
+
- `pnpm run check` 全绿(tsc + tsdown + 679 测试 + pack 闸门)。
|
|
14
|
+
|
|
1
15
|
## v0.4.62
|
|
2
16
|
|
|
3
17
|
修复设置页「模型目录偶发加载失败后整个页面卡死」的问题:两个会话在不同供应商上并行、后台任务(如记忆蒸馏)恰在加载瞬间占用 Host 时,`session/modelCatalog` 的一次瞬时失败会把设置页永久留在空目录状态——供应商配置组下拉里所有供应商都带 ⚠、模型下拉没有选项、依赖目录的开关全部禁用,只能重开设置页恢复。
|
|
@@ -24,6 +38,7 @@
|
|
|
24
38
|
- 说明:本轮所有改动均未提交、未打标签、未推送、未发 npm、未安装到桌面 profile(按用户指示,等“发布并推送”)。`pnpm run check` 全绿:69 文件 / 678 测试 + pack 闸门。
|
|
25
39
|
|
|
26
40
|
- **0.4.62 无头 lab 补验(2026-11-05,virtual / 零真实额度)**:DSH `0.2.1-rc.5` lab(`D:\dsh-lab`,3082)+ `dsh-model-switch@0.4.62` 本地构建产物 + `tools/route-probe.mjs`(4731),用 dsh-browser-cdp 全程无头运行。基线目录加载正常(供应商下拉 8 项、无 ⚠);页面级仅拦截 `POST /session/modelCatalog` 做确定性故障注入:前 2 次失败后第 3 次成功,自动恢复无点击(calls=3, faulted=2);连续 3 次失败时显示错误与「重试」,「保存」「删除该组」保持可用;清除故障后点「重试」一次即恢复完整目录(calls=5, faulted=4,0 ⚠)。另在新建会话经 UI 发起一次真实工具调用:1 轮 2 步、页面显示「已读取文件」与 `ok`,探针记录 `deepseek-flash tool=read` → `mimo-v2.6-flash`(会话命名)→ `deepseek-flash` 后续请求,无 inactive context / body-not-executed 报错。宿主报告的 `ModelCatalogFailure` 合并在 lab 不可复现(pi-ai 提供商目录为静态配置,停探针不会让 `listModels` 抛错),该路径由 `tests/client-controller.spec.ts` 覆盖。证据:`D:\dsh-artifacts\lab-0462-evidence.json`、`D:\dsh-artifacts\probe-lab-0462-tool.jsonl`;宿主与探针已停止,3082/4731 已释放,lab 恢复为 npm `0.4.62`,桌面 profile 未改动。**仅文档,不发版。**
|
|
41
|
+
- **兼容巡检(2026-11-09,仅文档)**:DSH `latest` 仍是 `0.2.2-rc.1`(桌面应用运行 `@deepseek-ai/dsh-desktop-runtime@0.2.2-rc.1`),与 0.4.63 记录的基线一致,未移动、无需新适配。被监控的 `dsh-prime-memory` 从基线 **0.26.24 前进到 0.26.37**(`beta` 0.26.36、`dsh-0.2.1-rc.5` 标签仍是 0.26.35),`engines.dsh` 为 `>=0.1.1-rc.2 <0.3.0`,`0.2.1-rc.5` 与 `0.2.2-rc.1` 都被允许。**桌面实机结果(用户实测 2026-11-09)**:DSH `0.2.2-rc.1` + 本插件 `0.4.63` + `dsh-prime-memory@0.26.37` 下,当前插件已兼容最新 prime-memory,记忆行激活且蒸馏路由由本插件服务——这是真实部署面的结论(非 lab 复刻),因此按用户实测记为已验证;**0.26.37 的七步 lab 接入矩阵尚未重跑,明确列为未完成**。`docs/compat-watch-state.json` 的 `memory.latestVerified` 更新为 `0.26.37`(`verifiedWith` = `0.2.2-rc.1`),`checkedAt` 更新为 2026-11-09。**无代码改动,不发版。**
|
|
27
42
|
- **兼容巡检(2026-11-02,仅文档)**:DSH `latest` 仍是 `0.2.1-rc.5`(未移动,10-30/31 的验收结论继续有效);`dsh-prime-memory` 从 **0.26.16 移到 0.26.24**,其 `engines.dsh` 含 rc.5,已在 rc.5 lab + 本插件 0.4.60 下跑完七项接入检查(行激活、适配推送落地、无 `llm:` 静态钉、`settings-set` 读回、`effectiveCfg` 单测 9/9、免重启改路由 `replays:1→2`、蒸馏走新路由)。`docs/compat-watch-state.json` 记录 0.26.24 为已验证版本。**无代码改动,不发版。**
|
|
28
43
|
|
|
29
44
|
## v0.4.60
|
package/lib/subagent-runtime.js
CHANGED
|
@@ -105,9 +105,10 @@ var ModelSwitchSubagentRuntime = class extends OfficialSubagentRuntime {
|
|
|
105
105
|
}]);
|
|
106
106
|
}
|
|
107
107
|
startActivation(spec) {
|
|
108
|
+
const request = spec.request ?? spec;
|
|
108
109
|
return Reflect.apply(publicMethod("startActivation"), this, [{
|
|
109
110
|
...spec,
|
|
110
|
-
request: this.routed(spec.provider,
|
|
111
|
+
request: this.routed(spec.provider, request)
|
|
111
112
|
}]);
|
|
112
113
|
}
|
|
113
114
|
};
|
|
@@ -159,6 +160,31 @@ function isRequest(value) {
|
|
|
159
160
|
const parent = Reflect.get(value, "parent");
|
|
160
161
|
return typeof parent === "object" && parent !== null && Reflect.get(parent, "session") !== void 0;
|
|
161
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Route one activation spec under either released shape. 0.2.1 through
|
|
165
|
+
* 0.2.2-rc.1 nest the SubagentStartRequest under spec.request; 0.2.2-rc.2
|
|
166
|
+
* flattens those fields onto the spec itself. Unknown shapes pass through
|
|
167
|
+
* untouched, so an unanticipated future shape keeps the official route.
|
|
168
|
+
*/
|
|
169
|
+
function routedSpecOf(spec, provider, state) {
|
|
170
|
+
const nested = Reflect.get(spec, "request");
|
|
171
|
+
if (typeof nested === "object" && nested !== null && isRequest(nested)) {
|
|
172
|
+
const request = routeFor(state, provider, nested);
|
|
173
|
+
return request === nested ? spec : {
|
|
174
|
+
...spec,
|
|
175
|
+
request
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (isRequest(spec)) {
|
|
179
|
+
const request = routeFor(state, provider, spec);
|
|
180
|
+
if (request === spec) return spec;
|
|
181
|
+
return {
|
|
182
|
+
...spec,
|
|
183
|
+
agentOptions: request.agentOptions
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return spec;
|
|
187
|
+
}
|
|
162
188
|
function warn(ctx, message) {
|
|
163
189
|
try {
|
|
164
190
|
ctx.logger.warn(message);
|
|
@@ -216,12 +242,8 @@ function installSubagentRouteWrappers(ctx) {
|
|
|
216
242
|
const rawSpec = args[0];
|
|
217
243
|
if (typeof rawSpec !== "object" || rawSpec === null) return Reflect.apply(original, this, args);
|
|
218
244
|
const spec = rawSpec;
|
|
219
|
-
if (typeof spec.provider !== "string"
|
|
220
|
-
|
|
221
|
-
return Reflect.apply(original, this, [request === spec.request ? spec : {
|
|
222
|
-
...spec,
|
|
223
|
-
request
|
|
224
|
-
}, ...args.slice(1)]);
|
|
245
|
+
if (typeof spec.provider !== "string") return Reflect.apply(original, this, args);
|
|
246
|
+
return Reflect.apply(original, this, [routedSpecOf(spec, spec.provider, current), ...args.slice(1)]);
|
|
225
247
|
});
|
|
226
248
|
wrap("start", (original) => function(...args) {
|
|
227
249
|
const [provider, request] = args;
|
|
@@ -15,10 +15,15 @@ interface SubagentRuntimeSurface {
|
|
|
15
15
|
readonly start?: unknown;
|
|
16
16
|
readonly startContinuable?: unknown;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The public activation shape used by tools and Agent Teams. 0.2.1 through
|
|
20
|
+
* 0.2.2-rc.1 nest the SubagentStartRequest under a request field; 0.2.2-rc.2+
|
|
21
|
+
* flatten those fields onto the spec itself, so the request field is absent
|
|
22
|
+
* there and the spec's own parent/agentOptions carry the same meaning.
|
|
23
|
+
*/
|
|
24
|
+
export interface SubagentActivationSpecLike extends RoutableSubagentRequest {
|
|
20
25
|
readonly provider: string;
|
|
21
|
-
readonly request
|
|
26
|
+
readonly request?: RoutableSubagentRequest & Record<string, unknown>;
|
|
22
27
|
readonly [field: string]: unknown;
|
|
23
28
|
}
|
|
24
29
|
/** Structural form of the pre-0.2.1 continuation start API. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-model-switch",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.64",
|
|
4
4
|
"description": "Explicit model routing plus composer/Plan picker for DeepSeek Harness",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -123,7 +123,8 @@
|
|
|
123
123
|
"0.2.1-rc.2": "compatible",
|
|
124
124
|
"0.2.1-rc.3": "compatible",
|
|
125
125
|
"0.2.1-rc.5": "compatible",
|
|
126
|
-
"0.2.2-rc.1": "compatible"
|
|
126
|
+
"0.2.2-rc.1": "compatible",
|
|
127
|
+
"0.2.2-rc.2": "compatible"
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
},
|