dsh-subagent-default-model 2.1.6 → 2.1.8
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 +77 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/lib/index.js +21 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,82 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.8 (2026-10-24)
|
|
4
|
+
|
|
5
|
+
### 兼容性核查:DSH Desktop 0.2.1-rc.3
|
|
6
|
+
|
|
7
|
+
当前宿主由 `0.2.1-rc.2` 升到 **`0.2.1-rc.3`**(nightly 渠道,2026-10-23 发布)。逐包比对 rc.2 → rc.3 的发布物,并**从运行中的 `app.asar` 直接读源码**复核插件依赖的每一处契约:**插件运行逻辑零改动**(`plugin/lib/index.js` / `plugin/lib/client.js` 未动一行)。
|
|
8
|
+
|
|
9
|
+
宿主 95 个随包发布里,**除版本号外只有 4 个包有实际改动**,且全部落在插件未触碰的面上:
|
|
10
|
+
|
|
11
|
+
| 包 | 改动 | 与本插件的关系 |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `dsh-client-ui-conversation` | 会话 View 标签页的**钉住/收起**(新增槽位 `conversation.session.header.views.actions`)、输入框草稿「追加」语义(`whenDraftExists`)、提交埋点新增 `is_new_session` / `agent_preset` | 纯新增,插件用的 `conversation.chat.node` 槽位与 `request/header` 帧语义未变 |
|
|
14
|
+
| `dsh-client-ui-primitives` | `Tooltip` 增加 `placement`、`MenuItem` 增加 `current`、`Menu` 增加 `minWidthFromAnchor`、新增 `IconAppsAdd*` | 纯新增;插件只用到 `Toast` 与 `IconChevronDown*`,全部仍在 |
|
|
15
|
+
| `dsh-llm-deepseek-account` / `-api-key` | 模型清单/目录能力下沉到共享的 `dsh-llm-deepseek`(`ModelListingCache`、`refuseListedModel`),配置字段重排 | 与插件的故障转移无关(插件只按宿主失败码分类,不解析模型清单) |
|
|
16
|
+
|
|
17
|
+
插件依赖的宿主契约**逐项复核结果**(行号为 rc.3 运行实例的实际行号):
|
|
18
|
+
|
|
19
|
+
| 检查项 | 结论 |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| 插件加载与注入 | ✅ 运行中的宿主已挂载本插件行,`Config` 投影出全部 7 个 volatile 字段 |
|
|
22
|
+
| 4 个事件钩子 | ✅ `agent/pre-step`、`agent/request`、`agent/request-error`、`agent/disposed` 全部仍在 |
|
|
23
|
+
| `preStep()` → `buildRequest()` 时序 | ✅ 未变(`:902` / `:1214`;`request/context` 仍在 `:1271` 才 append) |
|
|
24
|
+
| `inbox.claim()` 先抽干 | ✅ 未变(`preStep` 首行 `:906`;`pre-step` 瀑布 `:909`,默认决策 `:917`) |
|
|
25
|
+
| `session.requestContext()` 语义 | ✅ 未变(折叠定义 `:1627`;`isSeeded` 仍是「本会话继承了一段前缀」,`:1416` 依旧要求显式 seed) |
|
|
26
|
+
| 派发入口 | ✅ 仍只有 `startActivation(spec)`(`dsh-subagent` `:3036`),插件的包装点有效 |
|
|
27
|
+
| `agentOptions` 组装语义 | ✅ 未变:宿主仅在**显式**选择路由时才带上 `agentOptions`(`dsh-tool-subagent` `:470`),因此「无显式路由 → 插件注入」这条前提依然成立 |
|
|
28
|
+
| 失败码词表 | ✅ 未变(`RATE_LIMIT` / `QUOTA` / `SERVER` / `TIMEOUT` / `TRANSPORT` / `EMPTY_RESPONSE` / `INVALID_CREDENTIAL` 等) |
|
|
29
|
+
| peer 区间覆盖 | ✅ 宿主 `unmetRequirements()` 对 `0.2.1-rc.3` 返回「无未满足要求」 |
|
|
30
|
+
|
|
31
|
+
> 另记:宿主自带的「子代理模型可选」开关(`ctx.subagentModelSelection`,rc.2 起即存在,默认关闭)与本插件**不冲突**——它一旦启用,派发请求会带上显式 `agentOptions`,插件按既有约定**让位**(显式传参优先)。
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **asar 读取器的载荷基址错了 8 字节**(`plugin/test/peer-range.test.mjs` 的 `readFileFromAsar`)。头部的四个 uint32 本身就是 pickle 的框架,JSON 目录树从第 16 字节开始,而**载荷从 `8 + headerSize` 开始**;原实现用 `16 + headerSize`,于是**每个文件都被读偏 8 字节**:开头 8 字节被上一个文件的尾部顶替,末尾 8 字节被截断。
|
|
36
|
+
|
|
37
|
+
这个错误一直没人发现,是因为该读取器唯一的用途是「在文本里搜子串」(`function unmetRequirements(`),读偏的副本照样搜得到;**一旦按 JSON 解析就立刻炸**:`Unexpected token 'e', "e": "@deepseek-ai/dsh", … is not valid JSON`——本次新增的「运行中的宿主版本」用例正是第一个按 JSON 读它的用例,一上来就踩中。
|
|
38
|
+
|
|
39
|
+
修正为 `8 + headerSize`,并在注释里写清「为什么是 8 而不是 16」,避免下一个改它的人凭直觉改回去。
|
|
40
|
+
|
|
41
|
+
- **「应当通过」的宿主版本清单第三次滞后**:清单停在 `0.2.1-rc.2`,而真实运行的宿主已是 `0.2.1-rc.3`。这已是同一类回归的第三次(2.1.5、2.1.6 各一次),所以这次不再靠人记流程——**清单改成由宿主自己核对**。
|
|
42
|
+
|
|
43
|
+
### Tests
|
|
44
|
+
|
|
45
|
+
- **新增用例「the RUNNING host version must be admitted by the peer range」**:从本机安装的宿主(`app.asar` 内 `@deepseek-ai/dsh` 的 `package.json`)读出**实际运行版本**,断言 ① peer 区间放行它、② 它被显式列进 `ADMITTED_HOST_VERSIONS`。宿主一升级而清单没跟上 → **测试直接失败**,而不是等到某天被想起来。
|
|
46
|
+
- 无宿主环境时**显式 `t.skip`**(不是静默 `return`)。
|
|
47
|
+
- 变异验证:把 `0.2.1-rc.3` 从清单里去掉 → 该用例失败;放回去 → 通过。
|
|
48
|
+
- **「应当通过」清单抽成 `ADMITTED_HOST_VERSIONS` 常量**,semver 护栏与宿主评估器护栏共用同一份来源,杜绝两处清单各自漂移。
|
|
49
|
+
- 全量:`tests 153 / pass 153 / fail 0 / skip 0`(此前 152 项)。
|
|
50
|
+
|
|
51
|
+
### Docs
|
|
52
|
+
|
|
53
|
+
`DEVELOPMENT.md`:
|
|
54
|
+
|
|
55
|
+
1. 新增「宿主升级流程」一节:把「读 `app.asar` 核对契约 → 补版本清单 → 跑测试」固化成步骤,并写明**清单滞后三次**这一事实与新的自检用例。
|
|
56
|
+
2. 记录 asar 载荷基址 `8 + headerSize` 的坑(第三次踩 asar 相关的坑,注释里留了证据)。
|
|
57
|
+
|
|
58
|
+
## 2.1.7 (2026-10-18)
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- **DSH 0.2.x 上「多模型分配」整体空转**。宿主把派发入口从 `ctx.subagents.start(name, request)` / `startContinuable(spec)` 改成了 **`startActivation(spec)`**,而 `subagent` / `subagent_fork` 工具与 agent-team 的 `spawn_teammate` **都只调 `startActivation`**——旧的两个方法在服务上已无任何调用方。插件仍只包装旧方法,于是 `applyDefaultModel()` 从未执行,子代理静默继承父会话路由:配置 `workbuddy/space-bunny`,实际却跑在父会话的 `deepseek-flash` 上。
|
|
63
|
+
|
|
64
|
+
这就是「设置看起来生效、行为却是父路由」的隐蔽失败:面板显示正确、日志无异常、子代理照常工作,只是没走配置的路由。
|
|
65
|
+
|
|
66
|
+
修法:`installSubagentWrapper` 同时包装 `startActivation(spec)`,在 `spec.request` 上注入默认模型;`start` / `startContinuable` 继续包装以兼容旧宿主。未注入时**保持原 spec 引用**(不克隆),避免宿主侧的身份比较出现无意义差异。
|
|
67
|
+
|
|
68
|
+
> 现场取证方式:子代理会话首事件 `subagent/descriptor` 里固化了 `agentProvider` / `agentModel` / `agentReasoningEffort`,与插件配置对比即可判定注入是否发生——比读设置面板可靠。
|
|
69
|
+
|
|
70
|
+
### Notes
|
|
71
|
+
|
|
72
|
+
- **预检错误不触发故障转移**。像 `MISSING_CREDENTIAL`(provider 的路由凭据缺失)这类错误发生在请求发出之前,不在切换名单内,插件会原样放行。名单仍然只包含运行期的连接类与认证类错误码。
|
|
73
|
+
|
|
74
|
+
### Tests
|
|
75
|
+
|
|
76
|
+
- 新增 3 个用例:`legacy: false` 的主机(只有 `startActivation`)必须注入、显式 `agentOptions` 不被覆盖且 spec 引用不变、无配置时保持继承。
|
|
77
|
+
- 变异验证:把 `startActivation` 的包装赋值去掉 → 2 项失败(注入用例 + 卸载恢复用例)。
|
|
78
|
+
- 全量:`tests 152 / pass 152 / fail 0 / skip 0`。
|
|
79
|
+
|
|
3
80
|
## 2.1.6 (2026-10-17)
|
|
4
81
|
|
|
5
82
|
### 兼容性核查:DSH Desktop 0.2.1-rc.2
|
package/README.en.md
CHANGED
|
@@ -299,7 +299,7 @@ else model (+ provider) is non-empty → use that single route
|
|
|
299
299
|
else → no injection; the host inherits the parent-session route
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
-
The plugin wraps the host `ctx.subagents` service (`start` / `startContinuable`), so it covers every delegation path — built-in `subagent` / `subagent_fork` tools and any custom tool that calls the service without providing `agentOptions`.
|
|
302
|
+
The plugin wraps the host `ctx.subagents` service (`startActivation` on DSH 0.2.x, plus the legacy `start` / `startContinuable`), so it covers every delegation path — built-in `subagent` / `subagent_fork` tools, the agent-team `spawn_teammate` path, and any custom tool that calls the service without providing `agentOptions`.
|
|
303
303
|
|
|
304
304
|
## License
|
|
305
305
|
|
package/README.md
CHANGED
|
@@ -299,7 +299,7 @@ CI 在 `ubuntu-latest`、`windows-latest`、`macos-latest` 三个平台上同时
|
|
|
299
299
|
否则 → 不注入;由宿主自行继承父会话路由
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
-
插件包装宿主 `ctx.subagents`
|
|
302
|
+
插件包装宿主 `ctx.subagents` 服务(DSH 0.2.x 的 `startActivation`,以及旧版 `start` / `startContinuable`),覆盖所有派发路径 —— 内置的 `subagent` / `subagent_fork` 工具、agent-team 的 `spawn_teammate`,以及任何调用该服务但未提供 `agentOptions` 的自定义工具。
|
|
303
303
|
|
|
304
304
|
## 许可证
|
|
305
305
|
|
package/lib/index.js
CHANGED
|
@@ -628,6 +628,12 @@ function installSubagentWrapper(ctx, state) {
|
|
|
628
628
|
|
|
629
629
|
const originalStart = raw.start;
|
|
630
630
|
const originalStartContinuable = raw.startContinuable;
|
|
631
|
+
// DSH 0.2.x unified every delegation entry point on `startActivation(spec)`:
|
|
632
|
+
// `subagent` / `subagent_fork` and the agent-team `spawn_teammate` path all
|
|
633
|
+
// call it directly, and the old `start` / `startContinuable` service methods
|
|
634
|
+
// no longer have any caller. Wrapping only those two therefore selected no
|
|
635
|
+
// route at all on 0.2.x (children silently inherited the parent route).
|
|
636
|
+
const originalStartActivation = raw.startActivation;
|
|
631
637
|
const wrappedStart = typeof originalStart === "function"
|
|
632
638
|
? async (name, request) => originalStart.call(raw, name, applyDefaultModel(state, request))
|
|
633
639
|
: void 0;
|
|
@@ -640,10 +646,23 @@ function installSubagentWrapper(ctx, state) {
|
|
|
640
646
|
});
|
|
641
647
|
}
|
|
642
648
|
: void 0;
|
|
649
|
+
const wrappedStartActivation = typeof originalStartActivation === "function"
|
|
650
|
+
? async (spec) => {
|
|
651
|
+
if (spec === void 0 || spec === null) return originalStartActivation.call(raw, spec);
|
|
652
|
+
const request = applyDefaultModel(state, spec.request);
|
|
653
|
+
// Keep the spec reference when nothing was injected: host code compares
|
|
654
|
+
// identity and a needless clone would be a silent behaviour change.
|
|
655
|
+
return originalStartActivation.call(raw, request === spec.request ? spec : {
|
|
656
|
+
...spec,
|
|
657
|
+
request
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
: void 0;
|
|
643
661
|
|
|
644
|
-
if (wrappedStart === void 0 && wrappedStartContinuable === void 0) return;
|
|
662
|
+
if (wrappedStart === void 0 && wrappedStartContinuable === void 0 && wrappedStartActivation === void 0) return;
|
|
645
663
|
if (wrappedStart !== void 0) raw.start = wrappedStart;
|
|
646
664
|
if (wrappedStartContinuable !== void 0) raw.startContinuable = wrappedStartContinuable;
|
|
665
|
+
if (wrappedStartActivation !== void 0) raw.startActivation = wrappedStartActivation;
|
|
647
666
|
raw[WRAPPED] = state;
|
|
648
667
|
|
|
649
668
|
// Service method replacement is not a Cordis-managed contribution by itself.
|
|
@@ -651,6 +670,7 @@ function installSubagentWrapper(ctx, state) {
|
|
|
651
670
|
ctx.effect(() => () => {
|
|
652
671
|
if (wrappedStart !== void 0 && raw.start === wrappedStart) raw.start = originalStart;
|
|
653
672
|
if (wrappedStartContinuable !== void 0 && raw.startContinuable === wrappedStartContinuable) raw.startContinuable = originalStartContinuable;
|
|
673
|
+
if (wrappedStartActivation !== void 0 && raw.startActivation === wrappedStartActivation) raw.startActivation = originalStartActivation;
|
|
654
674
|
if (raw[WRAPPED] === state) delete raw[WRAPPED];
|
|
655
675
|
});
|
|
656
676
|
}
|
package/package.json
CHANGED