dsh-subagent-default-model 1.2.3 → 2.0.0

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,92 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0 (2026-09-25)
4
+
5
+ ### Breaking
6
+
7
+ - **宿主最低版本提升至 `@deepseek-ai/dsh >= 0.1.7-rc.1`**(peer 区间收窄为 `>=0.1.7-rc.1 <0.2.0`,全部 8 个 `@deepseek-ai/*` peer 一致)。0.1.7 线删除了本插件此前依赖的三处契约:`@deepseek-ai/dsh-settings` 的 `installSettingsSection` / `settingsNamespace` 命名导出、客户端 `settingsScope` 服务与 `settings.plugin.item` 槽位。依据同族插件 `dsh-ldvh` 的同源调研。
8
+
9
+ ### Changed
10
+
11
+ - **设置接入迁移到 0.1.7「插件 Config 即设置」模型**:`lib/index.js` 导出 `Config`(字段逐个 `.volatile()`),移除对 `@deepseek-ai/dsh-settings` 的**命名导入**——该导入在 0.1.7 上会导致模块链接期失败、整个宿主插件无法装载,且因 peer 区间「覆盖了该版本」而不会被版本检查拦下(**范围覆盖 ≠ 符号仍存在**)。写入改走 profile patch(经宿主 `configEditor`)。
12
+ - **客户端设置面迁移**:硬注入 `settingsScope`(0.1.7 已删除,会让整个客户端插件永不 apply)改为仅硬注入 `slots` / `locale`,`configForms` 改软注入;设置卡从已删除的 `settings.plugin.item` 迁到 `plugins.bundle.config` 与 `plugins.row.config` 双注册。
13
+ - **设置卡对齐同族范式**:`view: 'page'` 默认展开、`view: 'summary'` 只渲染一行描述,展开/收起按钮补 `aria-label`。
14
+ - **`dsh-client-ui-primitives` 图标族适配**:尺寸数字后缀(`…Outline14`)→ 粗细语义后缀(`…OutlineRegular` / `…Medium`),改为按名探测取第一个可用者并在渲染点兜底——把宿主改名造成的渲染期**硬崩溃**降级为视觉降级。
15
+
16
+ ### Fixed
17
+
18
+ - **宿主整体装载失败(P0):依赖树指向已被删除的 `/Applications/DSH Desktop.app`**。`plugin/node_modules/@deepseek-ai/` 下的 `schemastery` / `cordis` / `dsh-settings` 三个条目是**指向旧应用包的符号链接**;应用换成 `DSH NEXT.app` 后这些链接全部悬空,`lib/index.js` 第一行的 `import z from "@deepseek-ai/schemastery"` 直接 `ERR_MODULE_NOT_FOUND`。宿主表现为 `dsh-subagent-default-model (dsh-subagent-default-model): failed to import`,插件**一行都没跑**——而 `npm test` 仍全绿。已删除悬空链接并以 `npm install` 重建为真实目录。判据:`find node_modules -maxdepth 3 -type l ! -exec test -e {} \; -print` 必须为空。
19
+ - **devDependency 精确锁定致 `npm install` ERESOLVE**:`@deepseek-ai/dsh-settings` 写死 `0.1.7-rc.1`,而它自身 peer 依赖 `@deepseek-ai/dsh-brand@0.1.7-rc.1`,该包只发布了 `0.1.7-rc.2`,于是干净安装直接失败。这正是本仓 CHANGELOG **1.2.2 已经记过的那条教训**(「此处必须用范围而非精确锁定」)——被 0.1.7 适配时的版本推进重新踩了一次。已改为 `^0.1.7-rc.1`。
20
+ - **旧 `settings.yaml` 配置不会随 0.1.7 迁移过来**:0.1.6 及更早,本插件把配置注册为 `~/.dsh/settings.yaml` 的 `subagent-default-model` 段。0.1.7 起该文件在启动时被**一次性导入并改名**为 `settings.yaml.imported`(改名先于首次写入,所以部分导入永不重试),导入按段名**直接当条目 id** 使用,而本插件的条目 id 是 `dsh-subagent-default-model`——于是该段导入失败,宿主日志留 `section subagent-default-model … was not imported into entry subagent-default-model`,`profile/cordis.patch.yml` 里始终没有本插件的 `config:`。**本机实测命中**:旧值仍在 `.imported` 文件中,需手工搬进 profile patch。README / DEVELOPMENT.md 已改为描述 0.1.7 的真实存储位置并写明该陷阱(原文档仍在教用户编辑 `~/.dsh/settings.yaml`)。
21
+ - **设置保存必然失败(P0)**:`Config` 未声明 `reasoningEffort`,而设置卡的保存路径每次都写入该键。宿主 `@deepseek-ai/dsh-settings` 的 `write()` 对每个写入路径执行 `Config field "…" is not volatile` 门禁,因此**任何一次保存都被拒绝**——不只是改推理强度,而是整张设置卡存不进去,且界面只显示笼统的「保存失败」。已把 `reasoningEffort` 补为声明字段并标记 volatile;`getSection()` 同步读回该键,否则单模型形态配置的推理强度会被静默忽略。
22
+ - **设置卡可能绑定到无人服务的命名空间**:0.1.7 的 `configForms.get()` 对宿主 served-namespace 目录做**精确匹配**,而桌面宿主以 `include:<包名>` 挂载 Loader 条目。绑定错误时 `status: unavailable`、**静默失效不报错**(同 `dsh-ldvh` abb35db、`dsh-connect-workbuddy` 2.0.16 修掉的同一类坑)。现抽为具名 `subagentEntryIdOf(forms)`,按「声明条目 id → `include:<条目 id>` → 包名子串」的顺序匹配,仅在 mirror 未就绪时回落到声明 id。已用真机命名空间 `include:dsh-subagent-default-model` 做端到端绑定验证。
23
+ - **回落常量取的是已退役的 0.1.6 段名**:`SUBAGENT_MODEL_SETTINGS_NS` 原为 `"subagent-default-model"`,那是 0.1.6 及更早 `settings.yaml` 独立设置模型里的段名;0.1.7 起命名空间**就是 Loader 条目 id** `"dsh-subagent-default-model"`。mirror 未就绪时按旧名回落会绑定到无人服务的命名空间。已改为条目 id;`lib/index.js` 中被遗留的同名常量(仅声明、从未使用)一并删除——宿主而非插件拥有「条目 id ↔ 命名空间」的映射,插件不该保留第二份。
24
+ - **图标回退分支无样式**:`IconChevronDown` 探测全缺失时渲染 `.dsm-plugin-card-caret` 字形,但该类**只有使用点、没有 CSS 规则**。已补规则,并加守卫用例禁止「渲染了却无规则」的类再次出现。
25
+ - **设置卡的 Provider / Model 下拉永远为空(P0):`remote.session` 是异步挂载的服务,插件却在 `apply` 时只取一次**。`lib/client.js` 原写法 `var sessionRemote = ctx.get("remote.session")` 把叶服务**捕获**进变量;而该服务由网关的**异步** `remote.$mount()` 注册(`packages/api/gateway/src/client/index.ts`:`remoteServiceKey(ns)` → `remote.<ns>`,挂载点在 `async $mount` 内)。`apply` 跑的时候网关通常还没挂完 → 捕获到 `undefined` → `loadCatalog` 从此恒返回空数组,**而且因为值是捕获的,之后挂载完成也永远不会重取**。表现就是设置卡能打开、两个下拉却没有任何可选项。
26
+ 已改为**每次调用时懒探测**(先 `ctx.get("remote.session")`,再退回 `ctx.get("remote")?.session`),晚到的挂载即可被拾取;网关始终缺失时仍降级为空下拉且不抛错。官方同功能卡片(`ui-settings-subagent`)是把 `'remote','remote.session'` 写进 `inject` 让 Cordis 等待;本插件保持软注入(网关缺失不该扣下整张卡),因此改用重探测达到同样效果。
27
+ - **同族坑:`ctx.get()` 不按点号拆分**。Cordis 的 `get(name)` 是整串查表(`this.ctx[symbols.isolate][name]`),`"remote.session"` 之所以成立,是因为网关真的以这个字面量注册了服务(`remote.${namespace}`),不是 `remote` 的嵌套属性访问。所以「带点的服务名」能否解析,只能以**是否有人注册过该整串**为准——按「父对象.子属性」去推断会得到错误结论。
28
+ - **Plugins 详情页整块没有配置区(P0):读取未在 `inject` 声明的服务会抛错,把 `apply` 后半段整段打断**。`lib/client.js` 用 `if (ctx.uiConversation && ctx.uiConversation.events && …)` 这种「守卫写法」读 `ctx.uiConversation`,而它**没有**出现在 `inject` 里。Cordis 对未声明的服务**不返回 `undefined`**,而是抛 `cannot get property "uiConversation" without inject`(Cordis `lib/index.js` 的 service accessor;已用真实 `new Context()` 复现)。因此那个 `&&` 守卫**完全无效**——求值 `ctx.uiConversation` 本身就是抛错点。
29
+ 致命之处在于位置:该读取位于 `apply()` **中段**,它一抛,**其后**的 `ctx.inject(["configForms"], …)` 整块——也就是注册设置卡的那段——再也不会执行。于是详情页连配置区外壳都不出现(宿主只在 `ledger.bundles.has(包名)` 时才渲染该区块),且宿主日志只留一行、没有栈。
30
+ 已把 `uiConversation` 加进 `inject`(与官方全部 7 个消费者一致:ui-chat / ui-plan / ui-deliverables / ui-open-in-app / ui-settings-account / ui-settings-models / ui-model-selection)。`configForms` 仍走软注入——它本身是可选的,且 `ctx.inject` 正是「等它就绪而不抛错」的 API。
31
+ - **同族坑:`ctx.<service>` 的读取必须声明,`ctx.get()` 才是无声明探测**。前者抛错、后者返回 `undefined`。凡「想可选地用一个服务」只能走 `ctx.get` / `ctx.inject`;写成 `if (ctx.foo && …)` 不但拦不住,还会把 `apply` 打断在最坏的位置。
32
+ - **「当前供应商/模型」上下文行不再出现(P0):0.1.7 适配时把 `uiConversation` 从 `inject` 里误删,导致每次 `apply` 都在读它时抛错**。对照本仓 HEAD 可见演进:适配前是 `["slots","locale","settingsScope","remote","remote.session","uiConversation"]`,适配后只剩 `["slots","locale"]` —— `uiConversation` **不在 0.1.7 的删除清单里**(被删的是 `settingsScope`),属误伤。而本轮 §「未声明服务读取会抛错」已证明:读未声明的服务是**抛错**而非返回 undefined,于是 `apply` 在第 610 行中断,其后两个 `events.register` 与设置卡注册全部不执行——用户可感的正是**「切换模型/当前模型的上下文提示消失」**。已把 `uiConversation` 加回 `inject`。
33
+ - **同族坑:`ConversationEventRegistry.register` 对重复 `kind` 抛错,必须包进 `ctx.effect`**。我们把两个 conversation 定义**裸调**注册且丢弃 disposer(`conversation Definition "<kind>" is already registered`)。Cordis 在替换 fiber 时会再次执行 `apply`,第二次注册即抛错——修复 `inject` 后它仍会中断 `apply` 后半段(含设置卡)。官方全部消费者(`ui-plan`、`ui-deliverables` …)都写作 `ctx.effect(() => ctx.uiConversation.events.register(def), '…')`,让 Cordis 在重挂前先释放。已按该范式包裹两处。
34
+ 注意:**多定义 `match` 同一事件是设计允许的**——`assembler.dispatchInput` 会遍历**所有**定义并逐个 `accept`,不是「先到先得」。因此本插件的 `request/header` 定义与官方 `ui-trajectory` 的同名匹配**不冲突**,可见性问题与匹配竞争无关。
35
+ - **客户端半边整体不激活(P0):`apply` 重复执行时命中宿主 locale 重名抛错**。`lib/client.js` 的 `apply` 在函数最开头无条件调用 `ctx.locale.register("settings.subagentModel", …)`,且**丢弃返回值**。宿主 `@deepseek-ai/dsh-client-locale` 对「命名空间已有该语言」是**抛错**(`locale namespace "…" already has locale "…"`),而 Cordis 在 fiber 被替换时会再次执行 `apply`——于是第二次 apply 在注册设置卡**之前**就抛错。宿主表现为 `web boot: 1 entry did not activate` / `dsh-subagent-default-model: failed`,客户端半边**全部贡献**(设置卡、轨迹行、对话行)都不注册,且宿主日志只留一行,没有栈。
36
+ 已按同族 `dsh-ldvh` / `dsh-sub-cli` 的范式把登记包进 `ctx.effect(...)` 并**接住两个 disposer**:Cordis 在重挂前会先释放上一次登记,重入即从干净命名空间开始。
37
+ 复现与验证方式(不依赖 Electron):以真实 `locale` 语义(重名抛错)+ Cordis 语义(effect 在重挂前释放)构造 stub,连跑三次 `apply` —— 修复前 `#1:OK #2:THREW #3:THREW`,修复后 `#1:OK #2:OK #3:OK`。
38
+ **这一条是被「测试全绿」掩盖的第三个 P0**:原测试的 `locale.register` stub 只做字典合并、从不抛错,所以永远测不出只对第一次 apply 成立的登记。
39
+
40
+ ### Notes
41
+
42
+ - **`npm test` 全绿不能证明宿主能装载**:测试与宿主走的是两条不同的模块解析路径(测试从 `plugin/` 解析,宿主从 profile 经软链解析)。本轮三个 P0 里有**三个**在测试全绿的情况下依然让插件完全不可用。宿主编译期的唯一判据是**真正 import 一次**:`cd ~/.dsh/profiles/<profile> && node --input-type=module -e 'import("<包名>")'`。
43
+ - **stub 比被测代码宽松时,测试会给假绿灯**:`locale` 那条 P0 的根因就是 stub 省略了宿主唯一的失败路径(重名抛错)。写 stub 时应**先读宿主实现**再决定放行什么——本次是照 `dsh-client-locale/lib/client.js` 的重名抛错逐字建模后,才复现出来。
44
+ - **客户端半边是否真的激活,要按 `failed` / `pending` 区分**:两者都表现为「插件在 Web 上不见了」,但机制相反——`pending (waiting for service: …)` 是硬注入了一个不存在的服务(apply 因为等不到服务而从未运行);`<id>: failed` 是 apply **跑了但抛错**。查证入口是 `~/Library/Logs/DeepSeek Harness/crash-*-web-boot.log`,它同时给出判据行与 renderer console。
45
+ - **改完 `node_modules` 后,已在运行的宿主进程不会重新 import**:它把失败状态留在内存里,`plugin_manager` 反复 enable/disable 都返回同一个 `failed to import`,且不再写新日志。验证修复必须**重启应用**,而不是重试开关。
46
+
47
+
48
+ ### Docs
49
+
50
+ - **安装入口改写**:`dsh plugin --profile desktop add <path>` 在新版桌面壳上会被拒绝(`profile "desktop" is managed exclusively by the Electron application`)。DEVELOPMENT.md 改为走 DSH Desktop 内插件管理 / `plugin_manager` 的 `install_bundle`(target = 插件包绝对路径),并补上三条安装后核对(bundle 列表、软链、`listConfigs` 条目 id)。
51
+ - README(中/英,根与包内)配置示例从 `~/.dsh/settings.yaml` 段改为 profile patch 的 `config:` 块,并写明旧文件的一次性导入与段名不匹配陷阱。
52
+
53
+
54
+ ### Testing
55
+
56
+ - `plugin/test/client-trajectory.test.mjs` 新增 5 个契约用例:服务命名空间必须经 `subagentEntryIdOf` 解析且不得裸调 `get(声明id)`、`include:` 前缀命名空间下必须绑定到宿主实际服务的那一个、回落常量必须是 Loader 条目 id 而非遗留段名、`page` 形态默认展开 / `summary` 形态只渲染一行、全部渲染类都必须有 CSS 规则;另加匹配优先级用例(宿主同时服务 `include:<条目id>` 与遗留段名时,精确匹配必须胜出)。
57
+ - 新增 `plugin/test/dependency-integrity.test.mjs`(3 项)——把本轮两个 P0 变成测试能拦住的回归:① 依赖软链不得悬空(`lstatSync` 是链接但 `existsSync` 为假即失败);② 声明的 runtime dependency 必须在 `node_modules` 里存在;③ devDependency 不得是精确预发布锁定(`^\d.*-` 即失败)。两条守卫都用**变异验证**过:重新造一个悬空链接、把 `dsh-settings` 改回 `0.1.7-rc.1`,各自都被对应用例抓住。
58
+ - 全量 **85 项通过**(原 63 项 + 设置/图标契约 5 项 + 依赖完整性 3 项 + `apply` 重入契约 3 项 + 模型目录契约 3 项 + 服务声明契约 2 项 + 会话行注册契约 2 项 + 其余 4 项);`node integration.mjs`(8 项)与 `node prove.mjs`(1 项)同样通过。
59
+ - 新增 2 个 **会话行注册契约**用例(`plugin/test/client-trajectory.test.mjs`),针对「上下文提示消失」:① 用一个**重复 `kind` 即抛错**的注册表 stub 模拟宿主语义,断言三次 `apply`(中间执行 fiber teardown)都能把两个定义重新登记上去——修复前第二次即抛 `already registered`;② 静态守卫,要求两处 `ctx.uiConversation.events.register` 都必须写成 `ctx.effect(function () { return ctx.uiConversation.events.register(…) })`。
60
+ 同样用**变异验证**过:把两处改回裸调后,上述 2 条立刻变红,改回即全绿。
61
+ - 新增 2 个 **服务声明契约**用例(`plugin/test/client-trajectory.test.mjs`),其中一个用**真实 Cordis**(`new Context()` + `root.plugin({ inject })`)跑 `apply`,断言它必须**正常完成**而不是在未声明服务的读取处抛错——这正是「详情页没有配置区」的根因所在。另一个是静态守卫:把客户端源码去掉注释后,凡 `ctx.<service>` 形式的**属性读取**都必须出现在 `inject` 里。
62
+ 同样用**变异验证**过:把 `uiConversation` 从 `inject` 拿掉后,上述 3 条(含真实 Cordis 那条)立刻变红,加回即全绿。
63
+ - **跨 realm 断言注意**:客户端工厂由 `new Function` 执行,其数组带的是另一个 realm 的 `Array.prototype`,对两个「内容相同但来源不同」的数组用 `assert.deepEqual` 会误报失败(`actual: []` / `expected: []` 却判不等)。相关用例改用 `assert.equal(arr.length, …)` 比较。
64
+ - 新增 3 个 **模型目录契约**用例(`plugin/test/client-trajectory.test.mjs`):① `remote.session` 在 `apply` **之后**才挂载时,`loadCatalog` 必须重探测并取到目录;② 网关**始终缺失**时降级为空数组且不抛错;③ 守卫 `apply` 不得把 `remote.session` 捕获进变量(防止这个 bug 以任何形式复发)。
65
+ 同样用**变异验证**过:把 `loadCatalog` 改回「`apply` 时一次性捕获叶服务」的原始写法后,①③ 立刻变红,改回修复版即全绿。
66
+ - **跨 realm 断言注意**:客户端工厂由 `new Function` 执行,其数组带的是另一个 realm 的 `Array.prototype`,对两个「内容相同但来源不同」的数组用 `assert.deepEqual` 会误报失败(`actual: []` / `expected: []` 却判不等)。这两条用例改用 `assert.equal(arr.length, 0)` 比较。
67
+ - 新增 3 个 **`apply` 重入契约**用例(`plugin/test/client-trajectory.test.mjs`):① 以真实 `locale` 语义(重名抛错)连跑三次 `apply`,每次先释放上一 fiber 的登记,三次都必须干净登记;② 显式记录边界——宿主若**不**先释放就重挂,仍会抛 `already has locale`(所以登记必须留在 `ctx.effect` 内);③ 断言 locale 登记确实被 `ctx.effect` 包住(否则 Cordis 无从释放)。
68
+ 这 3 项同时用**变异验证**过:把 `lib/client.js` 改回「无条件登记、丢返回值」的原始写法后,①③ 立刻变红,改回修复版即全绿。
69
+ - P0 已用**宿主门禁的独立复现**验证:对适配前的 5 字段 `Config` 跑宿主 `isVolatilePath`,`reasoningEffort` 判定为 `not volatile` → 写入抛错;补上该字段后 6 个写入路径全部通过。
70
+ - 宿主接缝已逐项在**运行时目录**核对(不是只搜源码):`agent/request-error`(waterfall)、`agent/request`(waterfall)、`agent/disposed`(emit)三者均存在;已删除的 `agent/session-start` 未被本插件引用;`subagents` 服务的 `start` / `startContinuable` 签名与包装点一致。
71
+
72
+ ## 1.3.0 (2026-09-22)
73
+
74
+ ### Features
75
+
76
+ - **设置面板预检 `reasoningEffort` 是否被目标模型声明,不匹配时给出红字警告**:当所配 effort 不在目标模型当前声明的 `reasoning.efforts` 内(或该模型**根本没有声明任何 effort**)时,在该路由行内与保存区各显示一条警告,指明具体缺失的档位。选中即时校验,声明补齐后警告自动消失;**保存不被阻止**——供应商目录可能尚未刷新,卡住保存会把用户困在一个暂时性的状态里。
77
+ - **警告文案区分「模型未声明任何推理强度」与「未声明指定档位」两种情形**,后者会把档位名插值进文案(`{effort}`)。
78
+
79
+ ### Fixes
80
+
81
+ - **不再让「effort 不被支持」这类配置错误静默表现为「子代理没有任何上下文」**。此前:所配 effort 不被目标模型接受时,宿主在 `prepareRequest()` 阶段就抛 `UNSUPPORTED_REASONING_EFFORT`,**早于** system prompt 组装与上下文注入,也**早于** `agent/request-error` 瀑布派发。子会话因此只有 11 个事件、`request/header` 与 `system/message` 均为 0——界面上表现为「这个子代理里什么都没有」,父会话只收到一句 `failed before it finished / It left no closing message`;真实错误码只落在会话日志里。实测对照:同一路由在声明补齐后连续 3 次成功(descriptor 逐字一致),确认其成因是**上游供应商目录的能力声明在时间窗口内缺失**,而非本插件注入有误。本插件的确定性缺陷是**从不校验**:`reasoningEffort` 在 schema 层仅校验为字符串,因此界面能选出的值与运行时能接受的值可能在窗口期内不一致。本次在设置面板补上该校验。
82
+
83
+ ### Testing
84
+
85
+ - `plugin/test/client-trajectory.test.mjs` 新增 13 个用例(9 个纯函数契约 + 4 个面板渲染):覆盖「声明命中不报」「声明缺该档位报并插值档位名」「模型完全未声明 effort 报」「未配置 effort 不报」「未知 provider/model **不报**」「空 efforts 数组等同未声明」「畸形 catalog 与不完整路由不抛异常」,以及渲染侧断言警告节点确实进入组件树、文案插值已解析(非字面量 `{effort}`)。
86
+ - 保守方向**是**被测试保护的:把「未知模型」也判为不支持会同时打挂两个用例(纯函数与渲染各一),已用该变异验证。
87
+ - 渲染用例驱动**真实注册的卡片组件**(经 hook 感知的 React 替身展开子组件)而非直接调用纯函数,否则接线丢失不会被发现;已用「让检查返回 null」的变异验证其可捕获性。
88
+ - 全部 61 项测试通过(原 48 项 + 新增 13 项)。
89
+
3
90
  ## 1.2.3 (2026-09-16)
4
91
 
5
92
  ### Fixes
package/README.en.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [中文](README.md)
4
4
 
5
- Pick the default model for subagent delegations in [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness), configurable via `~/.dsh/settings.yaml`.
5
+ Pick the default model for subagent delegations in [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness), configured through the plugin's own settings card (its Cordis `Config`), stored in the profile's `cordis.patch.yml`.
6
6
 
7
7
  When a subagent is created without an explicit `model`, this plugin injects the configured default — so every `subagent`, `subagent_fork`, and any tool that omits `agentOptions` routes through it. Explicit per-call overrides always win; an absent or incomplete settings section keeps the historical behavior (children inherit the parent route).
8
8
 
@@ -82,34 +82,37 @@ Notes:
82
82
 
83
83
  ## Configuration
84
84
 
85
- Add to `~/.dsh/settings.yaml`:
85
+ Use the Web settings card (**Settings → Plugins → dsh-subagent-default-model**).
86
+
87
+ You can also edit the profile patch `~/.dsh/profiles/<profile>/cordis.patch.yml` directly: since DSH 0.1.7 that is where settings live, keyed by this plugin's Loader entry id `dsh-subagent-default-model`:
86
88
 
87
89
  ```yaml
88
- # Single model
89
- subagent-default-model:
90
- provider: deepseek-official
91
- model: deepseek-v4-pro
92
-
93
- # Or multiple models
94
- subagent-default-model:
95
- provider: deepseek-official
96
- models:
97
- - deepseek-v4-pro
98
- - deepseek-v4-flash
99
- strategy: round-robin # round-robin | random
100
-
101
- # With reasoning strength
102
- subagent-default-model:
103
- provider: deepseek-official
104
- models:
105
- - model: deepseek-v4-reasoner
106
- reasoningEffort: high
107
- - provider: other-provider
108
- model: gpt-5.6
109
- reasoningEffort: max
110
- strategy: round-robin # round-robin | random
90
+ - id: dsh-subagent-default-model
91
+ name: dsh-subagent-default-model
92
+ config:
93
+ # Single model
94
+ provider: deepseek-official
95
+ model: deepseek-v4-pro
96
+
97
+ # Or multiple models
98
+ provider: deepseek-official
99
+ models:
100
+ - deepseek-v4-pro
101
+ - deepseek-v4-flash
102
+ strategy: round-robin # round-robin | random
103
+
104
+ # Or with per-route reasoning strength
105
+ provider: deepseek-official
106
+ models:
107
+ - model: deepseek-v4-reasoner
108
+ reasoningEffort: high
109
+ - provider: other-provider
110
+ model: gpt-5.6
111
+ reasoningEffort: max
111
112
  ```
112
113
 
114
+ > **Upgrading from 0.1.6 or earlier**: the old configuration lived in the `subagent-default-model` section of `~/.dsh/settings.yaml`. 0.1.7 imports that file **once** and renames it to `settings.yaml.imported`, never reading it again. The import uses each section name verbatim as an entry id, while this plugin's entry id is `dsh-subagent-default-model` — so the old section is **not** imported (the host logs `section subagent-default-model … was not imported into entry subagent-default-model`) and the old values survive only in the renamed file. Move them into the `config:` block above by hand.
115
+
113
116
  | Field | Type | Default | Description |
114
117
  | --- | --- | --- | --- |
115
118
  | `provider` | string | — | Provider for string-type model entries. |
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.en.md) | 中文
4
4
 
5
- 为 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 中的子代理(subagent)派发选择默认模型,可通过 `~/.dsh/settings.yaml` 配置。
5
+ 为 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 中的子代理(subagent)派发选择默认模型,可通过插件自己的设置卡片(其 Cordis `Config`)配置,存在 profile 的 `cordis.patch.yml`。
6
6
 
7
7
  当创建子代理时未显式指定 `model`,本插件注入配置的默认模型 —— 因此所有 `subagent`、`subagent_fork` 以及任何省略 `agentOptions` 的工具调用都会经过它。显式传参的覆盖始终生效;配置段缺失或不完整时保持原有行为(子代理继承父会话路由)。
8
8
 
@@ -82,31 +82,38 @@ npm install dsh-subagent-default-model
82
82
 
83
83
  ## 配置
84
84
 
85
- 在 `~/.dsh/settings.yaml` 中添加:
85
+ 优先用 Web 设置卡片(**设置 → 插件 → dsh-subagent-default-model**)。
86
+
87
+ 也可以直接编辑 profile 的 patch 文件 `~/.dsh/profiles/<profile>/cordis.patch.yml`:DSH 0.1.7 起设置就存在这里,段名是本插件的 Loader 条目 id `dsh-subagent-default-model`:
86
88
 
87
89
  ```yaml
88
- # 单模型
89
- subagent-default-model:
90
- provider: deepseek-official
91
- model: deepseek-v4-pro
92
-
93
- # 或多模型
94
- subagent-default-model:
95
- provider: deepseek-official
96
- models:
97
- - deepseek-v4-pro
98
- - deepseek-v4-flash
99
- strategy: round-robin # round-robin | random
90
+ - id: dsh-subagent-default-model
91
+ name: dsh-subagent-default-model
92
+ config:
93
+ # 单模型
94
+ provider: deepseek-official
95
+ model: deepseek-v4-pro
96
+
97
+ # 或多模型
98
+ provider: deepseek-official
99
+ models:
100
+ - deepseek-v4-pro
101
+ - deepseek-v4-flash
102
+ strategy: round-robin # round-robin | random
103
+
104
+ # 带推理强度
105
+ provider: deepseek-official
106
+ models:
107
+ - model: deepseek-v4-reasoner
108
+ reasoningEffort: high
109
+ - provider: other-provider
110
+ model: gpt-5.6
111
+ reasoningEffort: max
112
+
113
+ failoverEnabled: true
114
+ ```
100
115
 
101
- # 带推理强度
102
- subagent-default-model:
103
- provider: deepseek-official
104
- models:
105
- - model: deepseek-v4-reasoner
106
- reasoningEffort: high
107
- - provider: other-provider
108
- model: gpt-5.6
109
- reasoningEffort: max
116
+ > **从 0.1.6 及更早版本升级**:旧版把配置写在 `~/.dsh/settings.yaml` 的 `subagent-default-model` 段。0.1.7 会在启动时把该文件**一次性导入并改名**为 `settings.yaml.imported`,改名后不再回读。导入按段名直接当条目 id 用,而本插件的条目 id 是 `dsh-subagent-default-model`,因此旧段**不会被导入**(宿主日志留一条 `section subagent-default-model … was not imported into entry subagent-default-model`),旧值只留在改名后的文件里——需要手工搬到上面的 `config:` 里。
110
117
  strategy: round-robin # round-robin | random
111
118
  ```
112
119
 
package/lib/client.js CHANGED
@@ -8,13 +8,22 @@ window.__ModuleLoader__.load({
8
8
  var React = require("react");
9
9
  var primitives = require("@deepseek-ai/dsh-client-ui-primitives");
10
10
  var Toast = primitives.Toast;
11
+ // ── 图标族适配(DSH 0.1.7 起重命名)──────────────────────────────────
12
+ // 旧命名以尺寸为后缀(IconChevronDownOutline14),新命名改为粗细语义后缀
13
+ // (IconChevronDownOutlineRegular / …Medium)。按名探测取第一个可用的,
14
+ // 全缺失时由使用点渲染自绘字形——把 undefined 直接交给 React.createElement
15
+ // 会在渲染期抛错。
16
+ var IconChevronDown = primitives.IconChevronDownOutlineRegular
17
+ || primitives.IconChevronDownOutlineMedium
18
+ || primitives.IconChevronDownOutline14
19
+ || null;
11
20
 
12
21
  // ── GitHub 页面(「鼓励一下」链接目标) ──────────────────────────────
13
22
  var DSM_GITHUB_URL = "https://github.com/dingminhua/dsh-subagent-default-model";
14
23
 
15
24
  // ── plugin icon (LD brand logo, 64px) ────────────────────────────────
16
25
  var DSM_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAXG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1LT7u+9dA99tNZ+yHxBTcNztz0mr9x74I/hnZXhD7F/PCAn6bJz+U0vrPr7K5VJUJZf5/v040NDcG02LGGJVmfOsuxdifg03U9vUZHrPz0fl7p5caGjNkiEmTFUXBooUDbjWGs5TE+Pdyy6vjqijO+MPYACb+efjwdiYsqIewMk+d8tbro1b1uXXehPrYahmn+hZmGgtefqsalNFvU1BpAhM8QXhUlCmgCmihAUnBUQixk6J2eSYqwvM9Iz5sfrApM7LDF7W651oILbef3Tky0Nk2vcfeed0dxp3Nu7h6EYr2sgOL/Aa5OuMdnE5sWAAAAAElFTkSuQmCC";
17
- var SETTINGS_CSS = ".dsm-model-settings{display:flex;flex-direction:column;gap:14px;margin:0;padding:0}.dsm-model-settings-list{display:flex;flex-direction:column;gap:10px}.dsm-model-settings-route{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end;padding:10px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:10px;background:var(--dsw-alias-bg-layer-3,#202126)}.dsm-model-settings-field{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-select{width:100%;max-width:220px;height:32px;padding:0 28px 0 10px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:var(--dsw-alias-bg-layer-2,#232529);color:var(--dsw-alias-label-primary,#e6e6e6);font:inherit;font-size:13px;line-height:1.5}.dsm-model-settings-select:focus{outline:2px solid var(--dsw-alias-state-business-primary,#5686fe);outline-offset:1px}.dsm-model-settings-select:disabled{color:var(--dsw-alias-label-tertiary,#999);cursor:default}.dsm-model-settings-remove{height:32px;min-width:32px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer;font-size:16px;line-height:1}.dsm-model-settings-remove:hover{color:var(--dsw-alias-state-error-primary,#ef4444);background:var(--dsw-alias-interactive-bg-hover-danger,rgba(242,90,90,.15))}.dsm-model-settings-options{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.dsm-model-settings-strategy{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-strategy .dsm-model-settings-select{max-width:150px}.dsm-model-settings-failover{display:flex;align-items:center;gap:6px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer}.dsm-model-settings-failover input[type=checkbox]{cursor:pointer}.dsm-failover-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999);white-space:nowrap}.dsm-model-settings-footer{border-top:1px solid var(--dsw-alias-border-l2,#36373b);display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 0 4px}.dsm-model-settings-footer-left{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.dsm-model-settings-footer-status{flex:1;min-width:0;color:var(--dsw-alias-label-secondary,#b8b8b8);font-size:12px;line-height:1.5}.dsm-model-settings-footer-error{flex:1;min-width:0;color:var(--dsw-alias-label-error,#ef4444);font-size:12px;line-height:1.5}.dsm-btn{appearance:none;font:inherit;cursor:pointer;border:1px solid transparent;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.dsm-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px}.dsm-btn:disabled{opacity:.4;cursor:default}.dsm-btn-outline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:transparent;font-weight:500}.dsm-btn-outline:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed);background:rgba(255,255,255,.04)}.dsm-btn-primary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.dsm-btn-primary:hover:not(:disabled){opacity:.9}.dsm-model-settings-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-plugin-card{border:1px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-3,#202126);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dsm-plugin-card:hover{border-color:var(--dsw-alias-label-dimmed,#777)}.dsm-plugin-card-open{background:var(--dsw-alias-bg-layer-2,#25262b);border-color:var(--dsw-alias-label-dimmed,#777)}.dsm-plugin-card-header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:transparent;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dsm-plugin-card-header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:-2px}.dsm-plugin-card-head{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dsm-plugin-card-title{color:var(--dsw-alias-label-primary,#e6e6e6);font-size:15px;font-weight:600;line-height:1.4}.dsm-plugin-card-description{color:var(--dsw-alias-label-tertiary,#999);font-size:13px;line-height:1.5}.dsm-plugin-card-chevron{color:var(--dsw-alias-label-tertiary,#999);flex:none;display:inline-flex;transition:transform .16s}.dsm-plugin-card-chevron-open{transform:rotate(180deg)}.dsm-plugin-card-body{border-top:1px solid var(--dsw-alias-border-l2,#36373b);margin:0 16px;padding:0 0 8px}.dsm-plugin-card-body .dsm-model-settings{margin:0;padding:12px 0 0;background:transparent;border:0;border-radius:0}.dsm-plugin-card-body .dsm-model-settings-head{display:none}.dsm-plugin-card-icon{width:32px;height:32px;flex:none;border-radius:7px}.dsm-model-settings-cheer{display:inline-flex;align-items:center;gap:4px;flex:none;text-decoration:underline;text-underline-offset:2px;color:var(--dsw-alias-label-tertiary,#999);font-size:13px;line-height:1.5;transition:color .16s}.dsm-model-settings-cheer-star{font-size:12px;line-height:1;display:inline-flex}.dsm-model-settings-cheer:hover{color:var(--dsw-alias-label-primary,#e6e6e6)}.dsm-model-settings-cheer:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:2px}";
26
+ var SETTINGS_CSS = ".dsm-model-settings{display:flex;flex-direction:column;gap:14px;margin:0;padding:0}.dsm-model-settings-list{display:flex;flex-direction:column;gap:10px}.dsm-model-settings-route{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end;padding:10px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:10px;background:var(--dsw-alias-bg-layer-3,#202126)}.dsm-model-settings-field{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-select{width:100%;max-width:220px;height:32px;padding:0 28px 0 10px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:var(--dsw-alias-bg-layer-2,#232529);color:var(--dsw-alias-label-primary,#e6e6e6);font:inherit;font-size:13px;line-height:1.5}.dsm-model-settings-select:focus{outline:2px solid var(--dsw-alias-state-business-primary,#5686fe);outline-offset:1px}.dsm-model-settings-select:disabled{color:var(--dsw-alias-label-tertiary,#999);cursor:default}.dsm-model-settings-remove{height:32px;min-width:32px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer;font-size:16px;line-height:1}.dsm-model-settings-remove:hover{color:var(--dsw-alias-state-error-primary,#ef4444);background:var(--dsw-alias-interactive-bg-hover-danger,rgba(242,90,90,.15))}.dsm-model-settings-options{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.dsm-model-settings-strategy{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-strategy .dsm-model-settings-select{max-width:150px}.dsm-model-settings-failover{display:flex;align-items:center;gap:6px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer}.dsm-model-settings-failover input[type=checkbox]{cursor:pointer}.dsm-failover-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999);white-space:nowrap}.dsm-model-settings-footer{border-top:1px solid var(--dsw-alias-border-l2,#36373b);display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 0 4px}.dsm-model-settings-footer-left{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.dsm-model-settings-footer-status{flex:1;min-width:0;color:var(--dsw-alias-label-secondary,#b8b8b8);font-size:12px;line-height:1.5}.dsm-model-settings-footer-error{flex:1;min-width:0;color:var(--dsw-alias-label-error,#ef4444);font-size:12px;line-height:1.5}.dsm-btn{appearance:none;font:inherit;cursor:pointer;border:1px solid transparent;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.dsm-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px}.dsm-btn:disabled{opacity:.4;cursor:default}.dsm-btn-outline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:transparent;font-weight:500}.dsm-btn-outline:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed);background:rgba(255,255,255,.04)}.dsm-btn-primary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.dsm-btn-primary:hover:not(:disabled){opacity:.9}.dsm-model-settings-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-plugin-card{border:1px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-3,#202126);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dsm-plugin-card:hover{border-color:var(--dsw-alias-label-dimmed,#777)}.dsm-plugin-card-open{background:var(--dsw-alias-bg-layer-2,#25262b);border-color:var(--dsw-alias-label-dimmed,#777)}.dsm-plugin-card-header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:transparent;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dsm-plugin-card-header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:-2px}.dsm-plugin-card-head{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dsm-plugin-card-title{color:var(--dsw-alias-label-primary,#e6e6e6);font-size:15px;font-weight:600;line-height:1.4}.dsm-plugin-card-description{color:var(--dsw-alias-label-tertiary,#999);font-size:13px;line-height:1.5}.dsm-plugin-card-chevron{color:var(--dsw-alias-label-tertiary,#999);flex:none;display:inline-flex;transition:transform .16s}.dsm-plugin-card-chevron-open{transform:rotate(180deg)}.dsm-plugin-card-caret{color:inherit;font-size:12px;line-height:1;display:inline-flex}.dsm-plugin-card-body{border-top:1px solid var(--dsw-alias-border-l2,#36373b);margin:0 16px;padding:0 0 8px}.dsm-plugin-card-body .dsm-model-settings{margin:0;padding:12px 0 0;background:transparent;border:0;border-radius:0}.dsm-plugin-card-body .dsm-model-settings-head{display:none}.dsm-plugin-card-icon{width:32px;height:32px;flex:none;border-radius:7px}.dsm-model-settings-cheer{display:inline-flex;align-items:center;gap:4px;flex:none;text-decoration:underline;text-underline-offset:2px;color:var(--dsw-alias-label-tertiary,#999);font-size:13px;line-height:1.5;transition:color .16s}.dsm-model-settings-cheer-star{font-size:12px;line-height:1;display:inline-flex}.dsm-model-settings-cheer:hover{color:var(--dsw-alias-label-primary,#e6e6e6)}.dsm-model-settings-cheer:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:2px}.dsm-model-settings-warn{grid-column:1/-1;color:var(--dsw-alias-label-error,#ef4444);font-size:12px;line-height:18px}.dsm-model-settings-warn-list{display:flex;flex-direction:column;gap:4px;color:var(--dsw-alias-label-error,#ef4444);font-size:12px;line-height:18px}";
18
27
 
19
28
  if (typeof document !== "undefined") {
20
29
  var cssId = "dsh-subagent-default-model/client.css";
@@ -44,11 +53,15 @@ window.__ModuleLoader__.load({
44
53
  "row.empty": "尚未指定默认模型,子代理将继承父会话路由。",
45
54
  "row.effortDefault": "Default",
46
55
  "row.discard": "放弃修改",
56
+ "row.expand": "展开",
57
+ "row.collapse": "收起",
47
58
  "row.cheer": "鼓励一下",
48
59
  "row.save": "保存",
49
60
  "row.saving": "保存中…",
50
61
  "row.saved": "已保存",
51
62
  "row.incomplete": "请为每个模型路由选择 Provider 和 Model。",
63
+ "row.effortNoDeclaration": "该模型当前未声明任何推理强度;子代理会因 effort 不被支持而一个请求都发不出(清空此项或改选模型)。",
64
+ "row.effortNotDeclared": "该模型当前未声明「{effort}」推理强度;子代理会因此无法启动(改选其它强度或清空此项)。",
52
65
  "row.saveFailed": "保存失败,请重试。",
53
66
  "row.toastSaved": "子代理默认模型设置已保存。",
54
67
  "row.failoverEnabled": "连接失败时按队列与策略切换模型",
@@ -73,11 +86,15 @@ window.__ModuleLoader__.load({
73
86
  "row.effortDefault": "Default",
74
87
  "row.empty": "No default model is selected; subagents inherit the parent route.",
75
88
  "row.discard": "Discard",
89
+ "row.expand": "Expand",
90
+ "row.collapse": "Collapse",
76
91
  "row.cheer": "Star on GitHub",
77
92
  "row.save": "Save",
78
93
  "row.saving": "Saving…",
79
94
  "row.saved": "Saved",
80
95
  "row.incomplete": "Choose a provider and model for every route.",
96
+ "row.effortNoDeclaration": "This model declares no reasoning efforts right now; subagents will fail to issue any request with the configured effort (clear it or pick another model).",
97
+ "row.effortNotDeclared": "This model does not declare the \"{effort}\" reasoning effort right now; subagents will fail to start (pick another effort or clear it).",
81
98
  "row.saveFailed": "Could not save the setting. Try again.",
82
99
  "row.toastSaved": "Subagent default model settings saved.",
83
100
  "row.failoverEnabled": "Switch models by queue and strategy on connection failure",
@@ -89,7 +106,43 @@ window.__ModuleLoader__.load({
89
106
  };
90
107
 
91
108
  // ── helpers ──────────────────────────────────────────────────────────
92
- var SUBAGENT_MODEL_SETTINGS_NS = "subagent-default-model";
109
+ // This plugin's DECLARED Loader entry id = `cordis.patch.yml` `insert.id`.
110
+ // It is the 0.1.7 settings namespace (the plugin's own `Config` is the
111
+ // settings section), and only the fallback here: the Desktop host mounts
112
+ // community bundles as `include:<name>` and `configForms.get()` matches the
113
+ // served-namespace directory EXACTLY. Binding a namespace nothing serves
114
+ // fails silently (`status: unavailable`, no error), so the card would simply
115
+ // never show its values. The real id is resolved by `subagentEntryIdOf()`.
116
+ var SUBAGENT_MODEL_SETTINGS_NS = "dsh-subagent-default-model";
117
+
118
+ /**
119
+ * Resolve the settings namespace the host actually serves for this plugin.
120
+ *
121
+ * Match order: the declared entry id exactly, then a `include:`-prefixed
122
+ * form of it, then the host-served namespace carrying the package name.
123
+ * The legacy section name (`subagent-default-model`, pre-0.1.7
124
+ * `settings.yaml` keying) is deliberately accepted last, so it can only win
125
+ * when it is genuinely the served namespace. Falls back to the declared id
126
+ * while the mirror is not ready.
127
+ *
128
+ * @param {object} forms - the `configForms` client service.
129
+ * @returns {string} the namespace to pass to `forms.get()`.
130
+ */
131
+ function subagentEntryIdOf(forms) {
132
+ try {
133
+ var view = forms.describe().getSnapshot().view;
134
+ var namespaces = (view && view.namespaces) || [];
135
+ var served = namespaces.find(function (entry) {
136
+ return entry.ns === SUBAGENT_MODEL_SETTINGS_NS;
137
+ }) ?? namespaces.find(function (entry) {
138
+ return entry.ns === "include:" + SUBAGENT_MODEL_SETTINGS_NS;
139
+ }) ?? namespaces.find(function (entry) {
140
+ return /subagent-default-model/i.test((entry && entry.ns) || "");
141
+ });
142
+ if (served !== undefined && typeof served.ns === "string" && served.ns !== "") return served.ns;
143
+ } catch (_e) { /* mirror not ready: the declared id is still the right guess */ }
144
+ return SUBAGENT_MODEL_SETTINGS_NS;
145
+ }
93
146
 
94
147
  function normalizeDefaultModels(value) {
95
148
  var result = [];
@@ -140,6 +193,43 @@ window.__ModuleLoader__.load({
140
193
  return next;
141
194
  }
142
195
 
196
+ // ── effort capability check ──────────────────────────────────────────
197
+ // A configured `reasoningEffort` that the target model does not declare
198
+ // makes every delegation fail before its first request: the harness
199
+ // assembles no system prompt and injects no context, so the subagent looks
200
+ // like "nothing was injected". The provider catalog is the only source of
201
+ // truth for that capability, and it can lag (a model may declare efforts
202
+ // only after its directory refreshes). Report the mismatch in the panel so
203
+ // the user learns it before saving, instead of diagnosing a silent failure.
204
+ //
205
+ // Pure: given one route and the loaded catalog groups, return the
206
+ // diagnostic key + params, or null when the route is fine or unknown.
207
+ // An unknown provider/model yields null: an absent catalog entry must
208
+ // never be reported as "unsupported" (the model may be valid but simply
209
+ // not advertised yet).
210
+ function checkEffortSupport(route, groups) {
211
+ if (!route || !route.provider || !route.model) return null;
212
+ if (!route.reasoningEffort) return null;
213
+ if (!Array.isArray(groups)) return null;
214
+ var group = null;
215
+ for (var i = 0; i < groups.length; i++) {
216
+ if (groups[i] && groups[i].id === route.provider) { group = groups[i]; break; }
217
+ }
218
+ if (!group || !Array.isArray(group.models)) return null;
219
+ var model = null;
220
+ for (var j = 0; j < group.models.length; j++) {
221
+ if (group.models[j] && group.models[j].id === route.model) { model = group.models[j]; break; }
222
+ }
223
+ if (!model) return null;
224
+ var reasoning = model.reasoning;
225
+ var efforts = reasoning && Array.isArray(reasoning.efforts) ? reasoning.efforts : [];
226
+ if (efforts.length === 0) return { key: "row.effortNoDeclaration", params: {} };
227
+ for (var k = 0; k < efforts.length; k++) {
228
+ if (efforts[k] && efforts[k].id === route.reasoningEffort) return null;
229
+ }
230
+ return { key: "row.effortNotDeclared", params: { effort: route.reasoningEffort } };
231
+ }
232
+
143
233
  function persistDefaultModels(scope, value) {
144
234
  return Promise.resolve().then(function () { return scope.set("provider", value.provider); }).then(function () {
145
235
  return scope.set("model", value.model);
@@ -262,6 +352,11 @@ window.__ModuleLoader__.load({
262
352
  toastState[1](null);
263
353
  }
264
354
  var hasIncompleteRoute = routesState[0].some(function (route) { return !route.provider || !route.model; });
355
+ var effortWarnings = [];
356
+ routesState[0].forEach(function (route, index) {
357
+ var warning = checkEffortSupport(route, groupsState[0]);
358
+ if (warning !== null) effortWarnings.push({ index: index, key: warning.key, warning: warning });
359
+ });
265
360
  var saveDisabled = !snap || snap.status !== "ready" || snap.writable === false || busyState[0] || hasIncompleteRoute || !dirtyState[0];
266
361
  var discardDisabled = !dirtyState[0] || busyState[0];
267
362
  var routes = routesState[0].map(function (route, index) {
@@ -283,6 +378,11 @@ window.__ModuleLoader__.load({
283
378
  if (route.reasoningEffort && !effortChoices.some(function (candidate) { return candidate.id === route.reasoningEffort; })) {
284
379
  effortChoices.unshift({ id: route.reasoningEffort, name: route.reasoningEffort });
285
380
  }
381
+ // Non-blocking capability warning: saving is still allowed (a catalog
382
+ // that has not refreshed yet must not trap the user), but a mismatch is
383
+ // surfaced here rather than discovered later as a subagent that starts
384
+ // no request at all.
385
+ var effortWarning = checkEffortSupport(route, groupsState[0]);
286
386
  return React.createElement("div", { className: "dsm-model-settings-route", key: index },
287
387
  React.createElement("label", { className: "dsm-model-settings-field" },
288
388
  t("row.provider"),
@@ -331,7 +431,12 @@ window.__ModuleLoader__.load({
331
431
  "aria-label": t("row.remove"),
332
432
  title: t("row.remove"),
333
433
  onClick: function () { removeRoute(index); }
334
- }, "\u00d7")
434
+ }, "\u00d7"),
435
+ effortWarning === null ? null : React.createElement("div", {
436
+ className: "dsm-model-settings-warn",
437
+ role: "status",
438
+ "data-effort-warning": effortWarning.key
439
+ }, t(effortWarning.key, effortWarning.params))
335
440
  );
336
441
  });
337
442
  return React.createElement("section", { className: "dsm-model-settings" },
@@ -360,6 +465,13 @@ window.__ModuleLoader__.load({
360
465
  React.createElement("span", { className: "dsm-failover-hint" }, t("row.failoverHint"))
361
466
  ),
362
467
  hasIncompleteRoute ? React.createElement("div", { className: "dsm-model-settings-hint" }, t("row.incomplete")) : null,
468
+ effortWarnings.length === 0 ? null : React.createElement("div", {
469
+ className: "dsm-model-settings-warn-list",
470
+ role: "status",
471
+ "data-effort-warning-count": String(effortWarnings.length)
472
+ }, effortWarnings.map(function (entry) {
473
+ return React.createElement("div", { key: entry.key + ":" + entry.index }, t(entry.warning.key, entry.warning.params));
474
+ })),
363
475
  React.createElement("div", { className: "dsm-model-settings-footer" },
364
476
  React.createElement("div", { className: "dsm-model-settings-footer-left" },
365
477
  React.createElement("a", {
@@ -381,7 +493,13 @@ window.__ModuleLoader__.load({
381
493
 
382
494
  // ── SubagentModelCard: collapsible card shell (default collapsed) ─────
383
495
  function SubagentModelCard(props) {
384
- var openState = React.useState(false);
496
+ // Family pattern (dsh-ldvh / dsh-connect-workbuddy / dsh-sub-cli): on the
497
+ // Plugins page a card is asked for `view: 'summary'` (a one-line glance)
498
+ // or `view: 'page'` (the form itself). Only the page form should default
499
+ // to open — collapsing a summary keeps the list scannable, while an
500
+ // unopened page form hides the settings the user came for.
501
+ if (props.view === "summary") return props.t("row.desc");
502
+ var openState = React.useState(props.view === "page");
385
503
  var open = openState[0];
386
504
  var setOpen = openState[1];
387
505
  var t = props.t;
@@ -392,7 +510,7 @@ window.__ModuleLoader__.load({
392
510
  type: "button",
393
511
  className: "dsm-plugin-card-header",
394
512
  "aria-expanded": open,
395
- "aria-label": title,
513
+ "aria-label": t(open ? "row.collapse" : "row.expand") + ": " + title,
396
514
  onClick: function () { setOpen(!open); }
397
515
  },
398
516
  React.createElement("img", { className: "dsm-plugin-card-icon", src: DSM_ICON, alt: "" }),
@@ -400,7 +518,7 @@ window.__ModuleLoader__.load({
400
518
  React.createElement("span", { className: "dsm-plugin-card-title" }, title),
401
519
  React.createElement("span", { className: "dsm-plugin-card-description" }, description)
402
520
  ),
403
- React.createElement("span", { className: "dsm-plugin-card-chevron" + (open ? " dsm-plugin-card-chevron-open" : "") }, React.createElement(primitives.IconChevronDownOutline14, { size: 14 }))
521
+ React.createElement("span", { className: "dsm-plugin-card-chevron" + (open ? " dsm-plugin-card-chevron-open" : "") }, IconChevronDown ? React.createElement(IconChevronDown, { size: 14 }) : React.createElement("span", { className: "dsm-plugin-card-caret" }, "▾"))
404
522
  ),
405
523
  React.createElement("div", { className: "dsm-plugin-card-body", hidden: !open },
406
524
  React.createElement(SubagentModelRow, props)
@@ -409,14 +527,52 @@ window.__ModuleLoader__.load({
409
527
  }
410
528
 
411
529
  // ── apply: inject settings row ───────────────────────────────────────
412
- var inject = ["slots", "locale", "settingsScope", "remote", "remote.session", "uiConversation"];
530
+ // `settingsScope` service was REMOVED in DSH 0.1.7 (settings moved to
531
+ // `configForms` + the plugin's own `Config`). Hard-injecting it would keep
532
+ // this whole client plugin from ever applying.
533
+ //
534
+ // `uiConversation` MUST be declared here, not merely read behind a guard:
535
+ // Cordis does not return `undefined` for an undeclared service — reading
536
+ // `ctx.uiConversation` THROWS `cannot get property "uiConversation" without
537
+ // inject`. Because that read sits in the middle of `apply()`, the throw
538
+ // aborted everything AFTER it — including the `ctx.inject(["configForms"])`
539
+ // block that registers the settings card, so the Plugins page showed no
540
+ // configuration section at all. A `if (ctx.foo && …)` guard cannot protect
541
+ // this: evaluating `ctx.foo` is itself the failure.
542
+ //
543
+ // All seven official consumers (ui-chat / ui-plan / ui-deliverables / …)
544
+ // declare it for exactly this reason. Declaring it is safe: the renderer
545
+ // mounts this plugin only once every dependency is available, and
546
+ // `uiConversation` ships in the same client bundle set as `slots`/`locale`,
547
+ // so it cannot be selectively absent while those are present.
548
+ //
549
+ // `configForms` stays soft (via `ctx.inject`) — unlike `uiConversation` it
550
+ // is optional by design, and `ctx.inject` is the API that waits for it
551
+ // without throwing.
552
+ var inject = ["slots", "locale", "uiConversation"];
413
553
 
414
554
  function apply(ctx) {
415
- // The old `connection.api.llm.models()` seat no longer exists. Resolve
416
- // the current model-catalog remote defensively so a missing/changed seat
417
- // degrades to an empty selector instead of crashing the Plugins tab.
418
- var sessionRemote = typeof ctx.get === "function" ? ctx.get("remote.session") : undefined;
555
+ // The old `connection.api.llm.models()` seat no longer exists. The current
556
+ // model catalog lives on the `remote.session` namespaced service.
557
+ //
558
+ // `remote.session` is mounted ASYNCHRONOUSLY by `remote.$mount()`
559
+ // (`packages/api/gateway/src/client/index.ts`: `remoteServiceKey(ns)` →
560
+ // `remote.<ns>`, mounted from an async `$mount`). Reading it ONCE during
561
+ // `apply` therefore usually captures `undefined` when the gateway has not
562
+ // finished mounting yet — and because the value was captured, the catalog
563
+ // stayed empty for the lifetime of the page. That is what left the
564
+ // Provider/Model dropdowns permanently blank.
565
+ //
566
+ // Resolve it lazily on EVERY call instead, so a late mount is picked up.
567
+ // `remote` is held as the lookup root rather than the leaf so the leaf is
568
+ // re-read per call. The official sibling card declares
569
+ // `inject: ['…','remote','remote.session',…]` to have Cordis wait for it;
570
+ // we stay soft-injected (a missing gateway must not withhold the card)
571
+ // and re-probe instead.
572
+ var remoteRoot = typeof ctx.get === "function" ? ctx.get("remote") : undefined;
419
573
  var loadCatalog = function () {
574
+ var sessionRemote = ctx.get ? ctx.get("remote.session") : undefined;
575
+ if (!sessionRemote) sessionRemote = remoteRoot && remoteRoot.session;
420
576
  if (!sessionRemote || typeof sessionRemote.modelCatalog !== "function") return Promise.resolve([]);
421
577
  return sessionRemote.modelCatalog().then(function (response) {
422
578
  if (!response || !response.ok) return [];
@@ -424,9 +580,27 @@ window.__ModuleLoader__.load({
424
580
  }).catch(function () { return []; });
425
581
  };
426
582
 
427
- // Register locale for this component
428
- ctx.locale.register(SUBAGENT_ROW_LOCALE, "zh", SUBAGENT_ROW_ZH);
429
- ctx.locale.register(SUBAGENT_ROW_LOCALE, "en", SUBAGENT_ROW_EN);
583
+ // Register locale for this component.
584
+ //
585
+ // The host `locale` service THROWS when a namespace already holds a locale
586
+ // (`dsh-client-locale`: `locale namespace "…" already has locale "…"`), and
587
+ // Cordis keeps a fiber's registrations alive while `apply` re-runs for its
588
+ // replacement. Registering unconditionally therefore makes the SECOND
589
+ // apply() of this plugin throw at the top of the function — before either
590
+ // card is registered — so the client half never activates and web boot
591
+ // reports `dsh-subagent-default-model: failed`.
592
+ //
593
+ // `ctx.effect` ties the registration to the current fiber: Cordis disposes
594
+ // it before running the replacement, so a re-apply starts from a clean
595
+ // namespace. Same pattern as `dsh-ldvh`/`dsh-sub-cli`.
596
+ ctx.effect(function () {
597
+ var offZh = ctx.locale.register(SUBAGENT_ROW_LOCALE, "zh", SUBAGENT_ROW_ZH);
598
+ var offEn = ctx.locale.register(SUBAGENT_ROW_LOCALE, "en", SUBAGENT_ROW_EN);
599
+ return function () {
600
+ if (typeof offZh === "function") offZh();
601
+ if (typeof offEn === "function") offEn();
602
+ };
603
+ }, "dsh-subagent-default-model: settings copy");
430
604
 
431
605
  // ── trajectory: surface the subagent model per request ──────────────
432
606
  // agent-loop appends a `request/context` frame (provider/model) whenever
@@ -450,7 +624,7 @@ window.__ModuleLoader__.load({
450
624
  seq: event.seq,
451
625
  time: event.time,
452
626
  content: [{ type: "text", text: label }],
453
- source: { kind: "plugin", plugin: "dsh-subagent-default-model", form: "notice" }
627
+ source: { kind: "plugin:dsh-subagent-default-model", form: "notice" }
454
628
  };
455
629
  },
456
630
  update: function (context) { return context.state; },
@@ -467,7 +641,16 @@ window.__ModuleLoader__.load({
467
641
  };
468
642
  }
469
643
  };
470
- ctx.uiConversation.events.register(modelContextDefinition);
644
+ // `ctx.effect` ties the registration to this fiber, so Cordis disposes it
645
+ // before re-running `apply` for a replacement fiber. Registering BARE is
646
+ // wrong here: `ConversationEventRegistry.register` throws
647
+ // `conversation Definition "<kind>" is already registered` on a duplicate
648
+ // kind, so the second apply would abort — taking the settings-card
649
+ // registration below it down with it. Every official consumer wraps this
650
+ // in `ctx.effect` (ui-plan, ui-deliverables, …).
651
+ ctx.effect(function () {
652
+ return ctx.uiConversation.events.register(modelContextDefinition);
653
+ }, "dsh-subagent-default-model: trajectory model row");
471
654
 
472
655
  // ── chat: surface the subagent model in the conversation view ──
473
656
  // agent-loop writes a `request/header` frame with a `reason` the first
@@ -506,7 +689,7 @@ window.__ModuleLoader__.load({
506
689
  // `summary` is the collapsed row's one-line account (notice form):
507
690
  // without it the row only shows the provenance label and hides the
508
691
  // model behind expansion.
509
- source: { kind: "plugin", plugin: "dsh-subagent-default-model", form: "notice", summary: label },
692
+ source: { kind: "plugin:dsh-subagent-default-model", form: "notice", summary: label },
510
693
  provenance: { role: "inject", label: "dsh-subagent-default-model" },
511
694
  form: "notice"
512
695
  };
@@ -526,10 +709,19 @@ window.__ModuleLoader__.load({
526
709
  };
527
710
  }
528
711
  };
529
- ctx.uiConversation.events.register(chatModelDefinition);
712
+ ctx.effect(function () {
713
+ return ctx.uiConversation.events.register(chatModelDefinition);
714
+ }, "dsh-subagent-default-model: chat model row");
530
715
  }
531
716
 
532
- var subagentScope = ctx.settingsScope.bind({ namespace: SUBAGENT_MODEL_SETTINGS_NS });
717
+ // Resolve the settings scope for this plugin. On DSH 0.1.7+ the settings
718
+ // surface is the plugin's own Loader entry id (`dsh-subagent-default-model`),
719
+ // served by the `configForms` client service (replacing the removed
720
+ // `settingsScope.bind({namespace})`). The namespace the Host actually
721
+ // serves is host-chosen (Desktop mounts it as `include:dsh-subagent-default-model`),
722
+ // so probe the mirror directory and fall back to the declared id rather
723
+ // than guessing — a wrong guess binds to a namespace nothing serves.
724
+ var subagentScope = null;
533
725
  var subagentRowInjected = function () {
534
726
  return {
535
727
  settingsScope: subagentScope,
@@ -540,22 +732,38 @@ window.__ModuleLoader__.load({
540
732
  };
541
733
  };
542
734
 
543
- ctx.slots.inject("settings.plugin.item", function () {
544
- return ctx.slots.register({
545
- name: "settings.plugin.item",
546
- key: "subagent-default-model",
547
- locale: SUBAGENT_ROW_LOCALE,
548
- inject: subagentRowInjected
549
- }, SubagentModelCard);
550
- });
735
+ // `configForms` is the 0.1.7 client settings surface; soft-inject it so the
736
+ // card simply stays absent when the service is unavailable, instead of
737
+ // blocking the whole client plugin. The served namespace is probed (see
738
+ // `subagentEntryIdOf`) rather than assumed — see that function.
739
+ ctx.inject(["configForms"], function (formsCtx) {
740
+ var forms = formsCtx.configForms;
741
+ subagentScope = forms.get(subagentEntryIdOf(forms));
551
742
 
552
- // The Plugins tab renders the intersection of registered cards and the
553
- // Host settings namespace directory. Community Host plugins can finish
554
- // registration after the core mirror's first read; force one fresh read
555
- // after claiming our card so `subagent-default-model` becomes active.
556
- ctx.settingsScope.describe().load();
743
+ var registerCard = function (slotName, key) {
744
+ try {
745
+ ctx.slots.inject(slotName, function () {
746
+ return ctx.slots.register({
747
+ name: slotName,
748
+ key: key,
749
+ locale: SUBAGENT_ROW_LOCALE,
750
+ inject: subagentRowInjected
751
+ }, SubagentModelCard);
752
+ });
753
+ } catch (error) {
754
+ console.error('[dsh-subagent-default-model] settings card slot "' + slotName + '" failed to register (host provider unaffected):', error);
755
+ }
756
+ };
757
+ // 0.1.7 placement: register under Plugins config surfaces (the old
758
+ // `settings.plugin.item` slot was removed in 0.1.7).
759
+ registerCard("plugins.bundle.config", "dsh-subagent-default-model");
760
+ registerCard("plugins.row.config", "dsh-subagent-default-model#dsh-subagent-default-model");
761
+ });
557
762
  }
558
763
 
559
- return { apply: apply, inject: inject };
764
+ // `checkEffortSupport` is exported as a pure test seam (same convention as
765
+ // the host half's `settingsSectionInstaller`); the module loader only reads
766
+ // `apply` / `inject`.
767
+ return { apply: apply, inject: inject, checkEffortSupport: checkEffortSupport };
560
768
  }
561
769
  });
package/lib/index.js CHANGED
@@ -1,22 +1,25 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
- import * as dshSettings from "@deepseek-ai/dsh-settings";
3
2
 
4
3
  /**
5
4
  * dsh-subagent-default-model — default model(s) for subagent delegations.
6
5
  *
7
- * Host-plane plugin. It registers the shared `subagent-default-model` settings
8
- * section (`~/.dsh/settings.yaml`) and wraps the host `ctx.subagents` service
6
+ * Host-plane plugin. It declares its configurable surface as the plugin's own
7
+ * Cordis `Config` (DSH 0.1.7+ "settings model": a plugin's `Config` IS the
8
+ * settings section). The host projects this `Config` into a settings form keyed
9
+ * by the Loader entry id (`dsh-subagent-default-model`) and writes changes back
10
+ * to the profile patch; volatile fields hot-reload without re-mounting the
11
+ * plugin. This plugin then wraps the host `ctx.subagents` service
9
12
  * (`start` / `startContinuable`), so any delegation whose request carries no
10
13
  * explicit `agentOptions` (the stock `subagent` / `subagent_fork` tools and
11
14
  * every other tool that omits model/provider) creates the child with a
12
15
  * configured default model. Explicit per-call overrides (e.g.
13
- * `subagent_with_model`) always win; an absent or incomplete settings section
14
- * keeps the historical behavior: children inherit the parent session route.
16
+ * `subagent_with_model`) always win; an absent or incomplete section keeps the
17
+ * historical behavior: children inherit the parent session route.
15
18
  *
16
19
  * Multiple models are supported: the `models` list is picked from on every
17
20
  * delegation either round-robin (default) or at random (`strategy`), so a
18
21
  * batch of parallel subagents spreads across the configured models. The
19
- * selection is re-evaluated on every call (settings hot-reload + live picker
22
+ * selection is re-evaluated on every call (live Config reference + live picker
20
23
  * state), so configuration changes apply to the very next delegation.
21
24
  *
22
25
  * The wrap lives on the service, not on any tool, so it covers every
@@ -38,45 +41,33 @@ import * as dshSettings from "@deepseek-ai/dsh-settings";
38
41
  */
39
42
 
40
43
  export const name = "dsh-subagent-default-model";
41
- // Do not hard-inject `subagents` at the plugin root: DSH 0.1.2 may mount that
42
- // service after this row. The settings section must become available
43
- // independently; `apply()` attaches the service wrapper through `ctx.inject()`.
44
-
45
- /** Settings namespace: default model route for subagent runs without an explicit `agentOptions`. */
46
- const SUBAGENT_DEFAULT_MODEL_SETTINGS_NAMESPACE = "subagent-default-model";
44
+ // Do not hard-inject `subagents` at the plugin root: DSH may mount that
45
+ // service after this row. The settings surface is the declared `Config` (the
46
+ // host projects it independently of any service wave); `apply()` attaches the
47
+ // service wrapper through `ctx.inject()`.
48
+ //
49
+ // There is deliberately no settings-namespace constant here: on 0.1.7 the
50
+ // namespace IS this Loader entry id (`dsh-subagent-default-model`), and the
51
+ // host — not this plugin — owns that mapping. The client resolves the served
52
+ // namespace from the configForms mirror instead of guessing it.
47
53
 
48
54
  /**
49
- * Pick the settings-section installer for the installed DSH generation.
50
- *
51
- * DSH 0.1.2-alpha.2 removed the standalone `installSettingsSection` /
52
- * `settingsNamespace` exports from `@deepseek-ai/dsh-settings` in favor of
53
- * the `ctx.settings` service seam (`settings.installSection`), and that seam
54
- * does not exist on older hosts (`settings.register` there, reachable only
55
- * through the legacy helper). Decide by export presence: a module that still
56
- * ships the helper (pre-alpha.2 hosts, and DSH Desktop's transitional
57
- * compatibility patch, where the helper merely delegates to the seam) uses
58
- * it; otherwise wire the official seam directly. Both paths register the
59
- * section only once the settings service mounts — the legacy helper itself
60
- * wraps `ctx.inject(["settings"], …)` — so neither ever blocks the plugin
61
- * root on service waves.
55
+ * Mark a schema's field as volatile on the DSH lines that support it.
62
56
  *
63
- * Exported for unit tests only; not part of the plugin contract.
57
+ * `volatile()` exists from schemastery 3.18.4 (the DSH 0.1.7 line, which is the
58
+ * only line whose settings write gate reads the marker). On a host without the
59
+ * method the schema stays byte-identical to the unmarked original (identity
60
+ * no-op), so the plugin still loads — the field simply loses hot-reload
61
+ * semantics rather than breaking the whole plugin at module-eval time.
64
62
  *
65
- * @param module - the resolved `@deepseek-ai/dsh-settings` module namespace.
66
- * @returns an `(ctx, ns, schema, entry, hooks)` installer for that generation.
63
+ * @template T
64
+ * @param {object} schema - a schemastery field.
65
+ * @returns {object} the field, marked volatile when supported.
67
66
  */
68
- export function settingsSectionInstaller(module) {
69
- if (typeof module?.installSettingsSection === "function") {
70
- return (ctx, ns, schema, entry, hooks) => module.installSettingsSection(ctx, ns, schema, entry, hooks);
71
- }
72
- return (ctx, ns, schema, entry, hooks) => {
73
- ctx.inject(["settings"], (settingsCtx) => {
74
- settingsCtx.settings.installSection(ctx, ns, schema, entry, hooks);
75
- });
76
- };
67
+ export function volatileField(schema) {
68
+ return typeof schema?.volatile === "function" ? schema.volatile() : schema;
77
69
  }
78
70
 
79
- const INSTALL_SETTINGS_SECTION = settingsSectionInstaller(dshSettings);
80
71
  /** One model entry: a bare model id (uses the section `provider`) or an explicit `{provider, model}` pair. */
81
72
  const MODEL_ENTRY = z.union([
82
73
  z.string(),
@@ -88,13 +79,23 @@ const MODEL_ENTRY = z.union([
88
79
  ]);
89
80
  /** Schema of the `subagent-default-model` settings section; an absent section keeps inheriting the parent route. */
90
81
  const SUBAGENT_DEFAULT_MODEL_SETTINGS_SCHEMA = z.object({
91
- provider: z.string(),
92
- model: z.string(),
93
- models: z.array(MODEL_ENTRY).default([]),
94
- strategy: z.union([z.const("round-robin"), z.const("random")]).default("round-robin"),
95
- failoverEnabled: z.boolean().default(true)
82
+ provider: volatileField(z.string().description("Default provider for subagent runs without an explicit agentOptions")),
83
+ model: volatileField(z.string().description("Default model id; the single-model form, backward compatible")),
84
+ models: volatileField(z.array(MODEL_ENTRY).default([]).description("Multi-model list; picked per strategy on every delegation")),
85
+ strategy: volatileField(z.union([z.const("round-robin"), z.const("random")]).default("round-robin").description("How to pick from `models`")),
86
+ failoverEnabled: volatileField(z.boolean().default(true).description("Retry a subagent request on another pool model after a connection failure")),
87
+ // Must be DECLARED and volatile: the settings write gate rejects every path
88
+ // that is not a declared volatile field (`@deepseek-ai/dsh-settings`
89
+ // `write()` throws `Config field "…" is not volatile`). The client card
90
+ // writes this key as part of EVERY save, so omitting it made every save
91
+ // fail — not just the reasoning-effort field. It also carries the
92
+ // single-model form's effort, which `defaultModel()` reads back.
93
+ reasoningEffort: volatileField(z.string().description("Reasoning effort for the single-model form (`model`)"))
96
94
  }).default({});
97
95
 
96
+ /** The plugin's Cordis Config — on DSH 0.1.7+ this IS the settings section. */
97
+ export const Config = SUBAGENT_DEFAULT_MODEL_SETTINGS_SCHEMA;
98
+
98
99
  /** State retained on the raw host service while this plugin fiber is active. */
99
100
  const WRAPPED = Symbol.for("dsh-subagent-default-model.wrapped");
100
101
 
@@ -128,7 +129,7 @@ function resolveEntry(section, entry) {
128
129
 
129
130
  /** Pick the next default model from the live settings section, or undefined to inherit the parent route. */
130
131
  function defaultModel(state) {
131
- const section = state.settingsSource?.();
132
+ const section = state.getSection?.();
132
133
  if (section === void 0 || section === null) return void 0;
133
134
 
134
135
  // Multi-model list wins; pick per strategy.
@@ -166,7 +167,7 @@ function applyDefaultModel(state, request) {
166
167
 
167
168
  /** Read the live failover view: the `models` list as the switch pool and the strategy. */
168
169
  function failoverView(state) {
169
- const section = state.settingsSource?.();
170
+ const section = state.getSection?.();
170
171
  if (section === void 0 || section === null) return void 0;
171
172
  if (section.failoverEnabled === false) return void 0;
172
173
  const entries = Array.isArray(section.models)
@@ -351,23 +352,40 @@ function installSubagentWrapper(ctx, state) {
351
352
  });
352
353
  }
353
354
 
354
- export function apply(ctx) {
355
+ export function apply(ctx, config) {
355
356
  const state = {
356
- settingsSource: void 0,
357
- rrCursor: 0
357
+ rrCursor: 0,
358
+ /**
359
+ * Resolve the live settings section. On DSH 0.1.7+ `config` is the
360
+ * plugin's resolved `Config`; volatile fields arrive as `{ get() }`
361
+ * live references (cosmokit Volatile), so unwrap each before reading.
362
+ * An absent/missing config falls back to the schema default (empty
363
+ * section) — children then inherit the parent route as before.
364
+ *
365
+ * @returns {object|undefined} the current section values.
366
+ */
367
+ getSection: () => {
368
+ const raw = config === void 0 || config === null ? void 0 : config;
369
+ if (raw === void 0) return void 0;
370
+ const unwrap = (value) => (value !== null && typeof value === "object" && typeof value.get === "function" ? value.get() : value);
371
+ const section = {
372
+ provider: unwrap(raw.provider),
373
+ model: unwrap(raw.model),
374
+ models: unwrap(raw.models),
375
+ strategy: unwrap(raw.strategy),
376
+ failoverEnabled: unwrap(raw.failoverEnabled),
377
+ // Read back too: the single-model form stores its effort here, so
378
+ // dropping the key silently ignored the configured effort.
379
+ reasoningEffort: unwrap(raw.reasoningEffort)
380
+ };
381
+ // Drop any field that resolved to undefined so downstream defaults apply.
382
+ for (const key of Object.keys(section)) {
383
+ if (section[key] === void 0) delete section[key];
384
+ }
385
+ return section;
386
+ }
358
387
  };
359
388
 
360
- // Register settings independently from the `subagents` service lifecycle.
361
- // DSH 0.1.2 can mount that service later or in a different service wave; a
362
- // root-level hard inject would otherwise keep this whole plugin waiting and
363
- // hide its settings card even though the Client half is already registered.
364
- INSTALL_SETTINGS_SECTION(ctx, SUBAGENT_DEFAULT_MODEL_SETTINGS_NAMESPACE, SUBAGENT_DEFAULT_MODEL_SETTINGS_SCHEMA, {}, {
365
- setSource: (current) => {
366
- state.settingsSource = current;
367
- },
368
- onChange: () => {}
369
- });
370
-
371
389
  // Subagent-only failover hooks the agent loop, not the subagents service,
372
390
  // so it is installed unconditionally: listeners no-op when the `failover`
373
391
  // section is absent/disabled or when the failing agent is the main loop.
@@ -380,7 +398,6 @@ export function apply(ctx) {
380
398
  });
381
399
 
382
400
  ctx.effect(() => () => {
383
- state.settingsSource = void 0;
384
401
  state.rrCursor = 0;
385
402
  });
386
403
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-subagent-default-model",
3
- "version": "1.2.3",
3
+ "version": "2.0.0",
4
4
  "description": "Configure default model routes for DeepSeek Harness subagents, with single-model, round-robin, random, and per-route reasoning-effort options.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -65,17 +65,17 @@
65
65
  }
66
66
  },
67
67
  "dependencies": {
68
- "@deepseek-ai/schemastery": "^3.18.1"
68
+ "@deepseek-ai/schemastery": ">=3.18.4 <4.0.0"
69
69
  },
70
70
  "peerDependencies": {
71
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
72
- "@deepseek-ai/dsh-subagent": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
73
- "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
74
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
75
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
76
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
77
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
78
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6 || ^0.1.1-rc.2 || >=0.1.2-alpha.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0"
71
+ "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.2.0",
72
+ "@deepseek-ai/dsh-subagent": ">=0.1.7-rc.1 <0.2.0",
73
+ "@deepseek-ai/dsh-client-connection": ">=0.1.7-rc.1 <0.2.0",
74
+ "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.2.0",
75
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.2.0",
76
+ "@deepseek-ai/dsh-client-ui-primitives": ">=0.1.7-rc.1 <0.2.0",
77
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.7-rc.1 <0.2.0",
78
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.7-rc.1 <0.2.0"
79
79
  },
80
80
  "peerDependenciesMeta": {
81
81
  "@deepseek-ai/dsh-client-connection": {
@@ -98,7 +98,8 @@
98
98
  }
99
99
  },
100
100
  "devDependencies": {
101
- "@deepseek-ai/cordis": "^4.0.2",
102
- "@deepseek-ai/dsh-settings": "^0.1.5-rc.1"
101
+ "@deepseek-ai/cordis": "~4.0.4",
102
+ "@deepseek-ai/dsh-settings": "^0.1.7-rc.1",
103
+ "@deepseek-ai/schemastery": "3.18.4"
103
104
  }
104
105
  }