dsh-subagent-default-model 2.1.15 → 2.2.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 +224 -0
- package/lib/client.js +174 -26
- package/lib/index.js +42 -27
- package/package.json +2 -5
- package/docs/DETAIL.md +0 -1
- package/docs/DETAIL.zh.md +0 -1
- package/locale/en.json +0 -7
- package/locale/zh.json +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,229 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.1 (2026-11-10)
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
**注入的路由行晚了一步,两步以内结束的子代理根本看不到。**
|
|
8
|
+
|
|
9
|
+
实机验证时,四个子代理里只有两个「更正」了自己的路由;其余在本应回答时答「未知」。查宿主源码后确认不是它们偷懒,而是投递时机错了:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
// dsh-agent-loop / preStep()
|
|
13
|
+
const claimed = this.inbox.claim(target, position.turn); // ← 先把 next-step 抽干
|
|
14
|
+
const decision = await this.dispatch.waterfall("agent/pre-step", { messages: claimed, ... });
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`claim()` 在 waterfall **之前**就把 `next-step` 清空了。旧实现是在 waterfall 里 `agent.inbox.prepend("next-step", …)`,所以那行只能被**下一次** `preStep()` 认领——它必然晚一步到达模型。一步结束的子代理永远看不到;两步的也是到最后才看到。
|
|
18
|
+
|
|
19
|
+
这直接违背了这一功能的原始承诺(「子代理因此能回答自己跑在哪个模型上」)。
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
注入改为写进 `decision.messages`:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
return { ...decision, messages: [...decision.messages, message] };
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
这样一次投递同时得到两个效果:
|
|
30
|
+
|
|
31
|
+
1. **当前步就能看到**——`decision.messages` 正是 `step()` 要发送的消息列表;
|
|
32
|
+
2. **持久进历史**——`step()` 会把每一条 append 成 `user/message`,所以后续步骤无需重复注入也能看到。
|
|
33
|
+
|
|
34
|
+
因此 inbox 不再参与投递,去掉了「清理未认领副本」的逻辑,并删除随之成为孤儿的 `isRouteContextMessage`。
|
|
35
|
+
|
|
36
|
+
### 仍然存在、且无法通过实现消除的限制
|
|
37
|
+
|
|
38
|
+
路由要等**当前步的请求**发出后才知道(`request/context`),而 `preStep()` 在它之前运行。所以:
|
|
39
|
+
|
|
40
|
+
- 第 1 步没有可信的路由可报——用 `agent.options` 的派发时种子去猜,正是本项目早已修过的 bug(子代理实际跑在 `ds41`,却被标成 `glm`);
|
|
41
|
+
- 因此这一行**从第 2 步起**才可见;**一步就结束的子代理仍然看不到**。这是时序决定的,不是遗漏。
|
|
42
|
+
- 附带代价:注入使该步消息非空,于是「本来要收尾的轮次」会多跑一步(循环只在 `turnEnds && messages.length === 0` 时结束)。去重保证每个路由最多一次,所以一定收敛——旧实现同样如此,只是它把行又推迟了一步。
|
|
43
|
+
|
|
44
|
+
README(中英)与设置页开关说明都已改成如实描述:「从第 2 步起」。
|
|
45
|
+
|
|
46
|
+
### Tests
|
|
47
|
+
|
|
48
|
+
`183/183`(180 → 183),`skip 0`。新增三条守卫:
|
|
49
|
+
|
|
50
|
+
- 路由一确定就在**同一步**投递(断言 inbox 里不留残余),这条正是旧实现的失败点;
|
|
51
|
+
- 投递一次即持久:后续两步不重复注入,历史里恰好一份;
|
|
52
|
+
- 路由中途变化时投递新值,同一路由永不重复投递。
|
|
53
|
+
|
|
54
|
+
夹具也做了对应改造:`dispatchPreStep` 现在模拟 `step()` 把 `decision.messages` 写入历史,并区分「正常步」与「收尾空步」——原来默认传空列表,在新语义下等于收尾步。
|
|
55
|
+
|
|
56
|
+
变异验证 4/4 命中:改回 inbox 投递、去掉去重、前置而非追加、丢弃循环自带消息。
|
|
57
|
+
|
|
58
|
+
## 2.2.0 (2026-11-06)
|
|
59
|
+
|
|
60
|
+
**次版本号升级**:这一版把插件的配置界面从「插件市场详情页的卡片」整体搬到**设置面板左侧导航的独立页面**,是一次用户可见的入口变更,因此走 `2.2.0` 而不是补丁号。同时撤销了 2.1.15 的详情页短简介机制。
|
|
61
|
+
|
|
62
|
+
> 2.1.16 – 2.1.21 的改动都包含在这一版里;它们只存在于 git 历史,没有单独发布到 npm。
|
|
63
|
+
|
|
64
|
+
### Changed
|
|
65
|
+
|
|
66
|
+
**配置入口迁移到「设置 → 子代理默认模型」。** 该页面注册在宿主的 `settings.section` LIST 槽位(0.2.1-rc.5 起提供),与「账号与余额 / 通用设置 / 模型」等内置页面并列。原 `plugins.bundle.config` / `plugins.row.config` 两处注册已移除——同一份配置不应有两个编辑入口。
|
|
67
|
+
|
|
68
|
+
页面结构(自上而下):标题 → 一句话总述 → 三条核心用途 → 配置表单 → 诊断信息(折叠)。
|
|
69
|
+
|
|
70
|
+
三条核心用途各自成条,替代原先挤在一句里的概括:
|
|
71
|
+
|
|
72
|
+
1. **多模型分配** —— 按轮换或随机策略,为每次子代理指派池中的一条路由。
|
|
73
|
+
2. **跨供应商故障转移** —— 连接失败时自动切到另一家供应商的模型,耗尽才放行真实错误。
|
|
74
|
+
3. **路由可见可查** —— 当前供应商与模型显示在轨迹和对话里,并写进子代理自己的上下文。
|
|
75
|
+
|
|
76
|
+
导航图标使用插件自有的 LD 品牌标记(不是通用齿轮),与页面同一个 `inject` 回调注册,配对关系是结构性的。
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
**`settings.section` 的注册曾经完全失效。** 2.1.16/2.1.17 用一个 `typeof ctx.slots.specOf === "function"` 的能力探测来保护注册,但 `specOf` 只存在于渲染器的内部 hostFace,不在 `ctx.slots` 这个公共服务上——探测恒为 false,整段注册被跳过,界面上看不到任何痕迹也不报错。
|
|
81
|
+
|
|
82
|
+
现在无条件调用 `slots.inject()`:它本身就是探测(等待 slot 声明,未声明时什么都不做、不抛错)。教训是**探测失败必须往「能用」的方向失败**,而不是「探测不到就关闭功能」。
|
|
83
|
+
|
|
84
|
+
### Reverted
|
|
85
|
+
|
|
86
|
+
**撤销 2.1.15 的 100 字详情文档。** `docs/DETAIL.zh.md`、`docs/DETAIL.md`、`locale/*.json` 及其守卫测试全部移除,`package.json#files` 回到 7 项。插件详情页恢复渲染完整 README。
|
|
87
|
+
|
|
88
|
+
理由:`meta.detail` 依赖「路径正确 + 语言链命中」这类隐式约定,失败时静默回落到 README、界面看不出问题;而它唯一的作用只是缩短显示文本。README 的内容本身是有用的,只是长。
|
|
89
|
+
|
|
90
|
+
### Changed(承接 2.1.21)
|
|
91
|
+
|
|
92
|
+
**诊断信息移到页面最后一行(保存按钮下方)。**
|
|
93
|
+
|
|
94
|
+
2.1.20 把它折叠了,但位置仍在顶部——紧挨着简介,读起来像「关于本插件的一条警告」,而且把用户真正来配置的表单往下推。现在它是表单的最后一个块,位于保存/放弃按钮之后。
|
|
95
|
+
|
|
96
|
+
页面的阅读顺序因此是:标题 → 一句话总述 → 三条核心用途 → 配置表单 → 诊断信息(折叠)。越往下越是元信息。
|
|
97
|
+
|
|
98
|
+
### Tests
|
|
99
|
+
|
|
100
|
+
`180/180`(179 → 180),`skip 0`。新增位置守卫:诊断块必须在保存页脚**之后**,且是表单的最后一个块。变异验证 1/1 命中(把诊断块移回顶部,用例即失败)。
|
|
101
|
+
|
|
102
|
+
## 2.1.20 (2026-11-06)
|
|
103
|
+
|
|
104
|
+
### Changed
|
|
105
|
+
|
|
106
|
+
**设置页顶部改为三条核心用途,诊断信息默认折叠。**
|
|
107
|
+
|
|
108
|
+
原文案是一句概括(「指定子代理默认使用的模型,配置连接失败时的故障转移,以及路由在轨迹与对话中的可见性」),把三件事压在一行里,读者很难对上下面那些开关各自买到什么。现在拆成三条,每个核心价值一句:
|
|
109
|
+
|
|
110
|
+
1. **多模型分配** —— 按轮换或随机策略,为每次子代理指派池中的一条路由。
|
|
111
|
+
2. **跨供应商故障转移** —— 连接失败时自动切到另一家供应商的模型,耗尽才放行真实错误。
|
|
112
|
+
3. **路由可见可查** —— 当前供应商与模型显示在轨迹和对话里,并写进子代理自己的上下文。
|
|
113
|
+
|
|
114
|
+
同时把 `[diag 2026-11-06.1] mirror=ready · view.ns=32 · …` 那一行收进折叠区(默认收起,点「诊断信息」展开)。它是排查保存问题用的,常驻在界面上会让正常用户以为出了错——尤其这页的职责正是让人放心地改配置。信息一点即达,不再占版面。
|
|
115
|
+
|
|
116
|
+
### Tests
|
|
117
|
+
|
|
118
|
+
`179/179`(177 → 179),`skip 0`。新增两条守卫:
|
|
119
|
+
|
|
120
|
+
- 三条价值各自渲染,且确实是三个独立条目(不是一段连排文字);
|
|
121
|
+
- 诊断信息**首次渲染必须折叠**(`aria-expanded="false"` 且 `[data-bindings-diag]` 不在树里)。
|
|
122
|
+
|
|
123
|
+
变异验证 2/2 命中:把诊断默认展开、删掉第三条价值,各自触发对应用例失败。
|
|
124
|
+
|
|
125
|
+
## 2.1.19 (2026-11-06)
|
|
126
|
+
|
|
127
|
+
### Reverted
|
|
128
|
+
|
|
129
|
+
**撤销 2.1.15 的「100 字详情文档」,插件详情页恢复渲染完整 README。**
|
|
130
|
+
|
|
131
|
+
2.1.15 曾给插件页加了一套短简介机制(`docs/DETAIL.zh.md` / `docs/DETAIL.md` + `locale/*.json` 的 `meta.detail`),目的是避免宿主把整篇 README 塞进详情区块。现在这些全部移除:
|
|
132
|
+
|
|
133
|
+
- 删除 `docs/DETAIL.zh.md`、`docs/DETAIL.md`;
|
|
134
|
+
- 删除 `locale/zh.json`、`locale/en.json`;
|
|
135
|
+
- `package.json#files` 去掉 `locale` 与两条 `docs/` 路径,回到 7 项;
|
|
136
|
+
- 删除 `test/detail-docs.test.mjs`(5 条守卫随之失效,测试 182 → 177)。
|
|
137
|
+
|
|
138
|
+
宿主的行为随之回到默认:`meta.detail` 一个都找不到 → 回落包根 README → 详情页显示完整说明。
|
|
139
|
+
|
|
140
|
+
**为什么会想做这件事、又为什么撤掉**:`meta.detail` 的取值要求「id 必须与 section 匹配」这类隐式约定,与新版宿主叠加后容易失效且失败无声(找不到就静默回落,界面上看不出问题)。与其维护一套只为缩短显示文本的机制,不如让 README 直接可见——它的内容是有用的,只是很长。
|
|
141
|
+
|
|
142
|
+
## 2.1.18 (2026-11-06)
|
|
143
|
+
|
|
144
|
+
### Fixed
|
|
145
|
+
|
|
146
|
+
**设置页在 2.1.16 / 2.1.17 里根本没有注册上。**
|
|
147
|
+
|
|
148
|
+
我把「能力探测」写成了 `typeof ctx.slots.specOf === "function"`,而 `specOf` 只存在于渲染器的**内部 hostFace**(`dsh-client-ui-renderer` 的 `hostFace()`),并不在 `ctx.slots` 这个公共服务上。探测因此恒为 `false`,注册被整段跳过——页面和图标都没进 ledger,界面上看不到任何痕迹,也没有报错。
|
|
149
|
+
|
|
150
|
+
三条教训:
|
|
151
|
+
|
|
152
|
+
1. **`slots.inject()` 本身就是探测。** 它等待 slot 声明,未声明时什么都不做、也不抛错。在它外面再套一层探测不仅多余,而且引入了新的失败点:探测错 = 功能永不生效,且悄无声息。
|
|
153
|
+
2. **探测失败必须往「能用」的方向失败。** 我写成「探测不到就不注册」,于是任何探测缺陷都会静默关闭功能。正确方向是「拿不准就注册,让宿主决定」。
|
|
154
|
+
3. **我上一轮的错误推断**:2.1.16 界面里出现过那一项,我据此认为探测可用。但那一项来自**当时的旧 bundle**(重启前加载的 2.1.15 之前版本),不是新代码。我把「界面有东西」当成了「新代码生效」,这个证据链是断的。
|
|
155
|
+
|
|
156
|
+
现在的实现:无条件 `slots.inject("settings.section", …)`,页面与图标在同一个回调里注册、disposer 成对返回。宿主没有这个槽位时,回调永不执行,插件其余功能完全不受影响。
|
|
157
|
+
|
|
158
|
+
### Tests
|
|
159
|
+
|
|
160
|
+
`182/182`,`skip 0`。三档宿主情形逐一验证(用真实 `slots.inject` 语义模拟):
|
|
161
|
+
|
|
162
|
+
| 宿主 | 行为 |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| 声明 section + icon | 页面与图标都注册 |
|
|
165
|
+
| 只声明 section | 只注册页面 |
|
|
166
|
+
| 两样都不声明(0.1.7) | 什么都不注册,`apply()` 不抛错 |
|
|
167
|
+
|
|
168
|
+
> 夹具这次也修了:它原先**立刻调用** `inject` 回调返回的 disposer,等于注册完马上释放——宿主绝不会这样做(disposer 交给 fiber 在卸载时调用)。同时 `inject` 现在只对本宿主**声明过**的 slot 执行回调,忠实模拟「未声明则等待」。
|
|
169
|
+
|
|
170
|
+
## 2.1.17 (2026-11-06)
|
|
171
|
+
|
|
172
|
+
### Fixed
|
|
173
|
+
|
|
174
|
+
**设置侧边栏的导航图标没有出现,仍显示通用齿轮。**
|
|
175
|
+
|
|
176
|
+
2.1.16 把配置页搬到 `settings.section` 后,同一次提交也注册了 `settings.section.icon`,但页面上只见到默认齿轮。原因是两处注册用了**两个独立的 `slots.inject()`**:
|
|
177
|
+
|
|
178
|
+
- 每个 `inject()` 各自等待自己的 slot 声明;
|
|
179
|
+
- 渲染器对 `.icon` 的取值是 `renderSlot("settings.section.icon", …, { only: row.id })`,**id 必须与 section 完全一致**才会有 occupant,否则静默回落到 `navIcon()` 的通用齿轮,页面上看不出任何错误。
|
|
180
|
+
|
|
181
|
+
现在两处注册合并进**同一个 `inject` 回调**,disposer 成对返回、随 fiber 一起释放。配对关系因此是结构性的,而不是靠两处代码碰巧都写对。
|
|
182
|
+
|
|
183
|
+
同时加固了图标本身:
|
|
184
|
+
|
|
185
|
+
- 按 owner 传入的 `size` 渲染(此前硬编码 16),`active` 为假时降到 75% 不透明度;
|
|
186
|
+
- `inline: true` 的槽位把 cell 包在 `<span>` 里,所以用 `<img>` + `display:block` 精确占位,不会破坏导航行的基线;
|
|
187
|
+
- `.icon` 也有自己的声明探测:宿主没有这个槽位时只打 warn,页照常渲染。
|
|
188
|
+
|
|
189
|
+
### Tests
|
|
190
|
+
|
|
191
|
+
`182/182`(181 → 182),`skip 0`。新增「导航图标必须与页面同 id」与「按 size 渲染品牌图标」两条守卫;变异验证 2/2 命中(去掉图标注册、把尺寸硬编码回 16)。
|
|
192
|
+
|
|
193
|
+
> 夹具又一次挡在前面:`settings.section` 与 `settings.section.icon` 现在从**同一个** `inject` 出来,原先按「哪次 inject」区分注册的桩全部失效,必须改成按 `options.name` 选取。这类改动不改就只会测试变红、看不出真实原因。
|
|
194
|
+
|
|
195
|
+
## 2.1.16 (2026-11-06)
|
|
196
|
+
|
|
197
|
+
### Changed
|
|
198
|
+
|
|
199
|
+
**插件设置从「插件页卡片」移动到「设置 → 侧边栏」独立页面。**
|
|
200
|
+
|
|
201
|
+
原来配置只在插件市场的 `plugins.bundle.config` / `plugins.row.config` 两个 keyed 槽位里,用户要点开插件详情页才能找到。现在改为宿主的 `settings.section` LIST 槽位——就是设置面板左侧导航里「账号与余额 / 通用设置 / 模型 / 内置插件 / OpenCode Go …」那一列,一个注册对应一个页面。
|
|
202
|
+
|
|
203
|
+
- 新增 `settings.section` 页面(`id: dsh-subagent-default-model`,`order: 30`,排在内置 section 之后);
|
|
204
|
+
- 新增 `settings.section.icon` 导航图标(复用插件自有品牌图标,而不是又一个通用齿轮);
|
|
205
|
+
- **删除了**原 `plugins.bundle.config` / `plugins.row.config` 两处注册。同一个文档不应有两个编辑入口,这也是「移动」而非「新增」的含义;
|
|
206
|
+
- 页面直接渲染表单(`SubagentModelRow`),**不套**可折叠卡片外壳:设置页本身就是独立界面,它收到的是 `{ t, close }` 而没有 `view`,套卡片会因 `props.view === "page"` 为假而默认折叠,把所有控件藏到二次展开之后。
|
|
207
|
+
|
|
208
|
+
### Compatibility
|
|
209
|
+
|
|
210
|
+
`settings.section` 是 **0.2.1-rc.5** 引入的,而本插件的 peer 下限是 `0.1.7`。因此注册前先做**声明探测**(`ctx.slots.specOf("settings.section")`,即渲染器自己的 `specDynamic`);未声明时**不注册**并打一条 warn 说明原因。
|
|
211
|
+
|
|
212
|
+
> 为什么不直接 `slots.inject`:读 `dsh-client-ui-renderer` 的 `inject()` 实现可知,slot 未声明时它只是等待声明出现(`spec === undefined` 时直接 return),注册永不发生、也不报错——在旧宿主上这会表现为「配置入口凭空消失且无人知其所以然」。
|
|
213
|
+
|
|
214
|
+
### Tests
|
|
215
|
+
|
|
216
|
+
`181/181`(178 → 181),`skip 0`。新增/改写:
|
|
217
|
+
|
|
218
|
+
- 页面注册到 `settings.section`,`id`/`order`/`locale` 正确,label 经本地化字典解析;
|
|
219
|
+
- **旧宿主(未声明该 slot)上不注册任何东西,并打出说明性 warn**;
|
|
220
|
+
- 页面渲染真实表单,且**不含**可折叠卡片的头部按钮;
|
|
221
|
+
- 导航图标与页面 **id 必须一致**(不一致会静默回落到通用齿轮)。
|
|
222
|
+
|
|
223
|
+
变异验证 4/4 命中:①去掉声明探测(无条件注册)→ 旧宿主用例失败;②用折叠卡片替代表单 → 渲染用例失败;③恢复旧的两处插件页注册 → 「no Plugins-page card」用例失败;④图标 id 与页面 id 不一致 → 图标用例失败。
|
|
224
|
+
|
|
225
|
+
> 夹具也被修了:测试桩原本没有 `specOf`,新探测在测试里恒为假、永远走不到注册分支——测试会全绿但功能从不生效。现在夹具显式声明 `settings.section`(并可通过删除它来模拟旧宿主)。
|
|
226
|
+
|
|
3
227
|
## 2.1.15 (2026-11-06)
|
|
4
228
|
|
|
5
229
|
### Changed
|
package/lib/client.js
CHANGED
|
@@ -26,11 +26,11 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
// 跑的是哪一个 client bundle」——宿主在启动时快照 bundle,页面可能仍
|
|
27
27
|
// 持有旧版本;一眼对出构建号即可排除/坐实这一点。每次改 client.js
|
|
28
28
|
// 排查时必须递增它。
|
|
29
|
-
var DSM_CLIENT_BUILD = "2026-
|
|
29
|
+
var DSM_CLIENT_BUILD = "2026-11-06.1";
|
|
30
30
|
|
|
31
31
|
// ── plugin icon (LD brand logo, 64px) ────────────────────────────────
|
|
32
32
|
var DSM_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUh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h6p7CX8CYEQLtShKocTfmbpRLHs3d1LT7u+9dA99tNZ+yHxBTcNztz0mr9x74I/hnZXhD7F/PCAn6bJz+U0vrPr7K5VJUJZf5/v040NDcG02LGGJVmfOsuxdifg03U9vUZHrPz0fl7p5caGjNkiEmTFUXBooUDbjWGs5TE+Pdyy6vjqijO+MPYACb+efjwdiYsqIewMk+d8tbro1b1uXXehPrYahmn+hZmGgtefqsalNFvU1BpAhM8QXhUlCmgCmihAUnBUQixk6J2eSYqwvM9Iz5sfrApM7LDF7W651oILbef3Tky0Nk2vcfeed0dxp3Nu7h6EYr2sgOL/Aa5OuMdnE5sWAAAAAElFTkSuQmCC";
|
|
33
|
-
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-inject-route{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-inject-route input[type=checkbox]{cursor:pointer}.dsm-inject-route-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999)}.dsm-model-settings-apply-fork{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-apply-fork input[type=checkbox]{cursor:pointer}.dsm-apply-fork-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999)}.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}.dsm-notice-row{display:flex;flex-direction:column;gap:4px;margin:6px 0;font-size:12px}.dsm-notice-toggle{appearance:none;font:inherit;cursor:pointer;background:transparent;border:0;padding:2px 0;display:flex;align-items:center;gap:6px;color:var(--dsw-alias-label-tertiary,#9a9a9a);text-align:left;min-width:0}.dsm-notice-toggle:hover{color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-notice-toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px;border-radius:3px}.dsm-notice-dot{flex:none;width:5px;height:5px;border-radius:50%;background:var(--dsw-alias-label-caption,#777)}.dsm-notice-label{flex:none;font-weight:500}.dsm-notice-summary{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-notice-summary:before{content:'·';margin-right:6px;color:var(--dsw-alias-label-caption,#777)}.dsm-notice-body{margin:0;padding:8px 10px;border-left:2px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-1,#1b1b1d);color:var(--dsw-alias-label-secondary,#b8b8b8);font-size:12px;line-height:18px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:420px;overflow:auto}";
|
|
33
|
+
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-inject-route{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-inject-route input[type=checkbox]{cursor:pointer}.dsm-inject-route-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999)}.dsm-model-settings-apply-fork{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-apply-fork input[type=checkbox]{cursor:pointer}.dsm-apply-fork-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,#999)}.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}.dsm-notice-row{display:flex;flex-direction:column;gap:4px;margin:6px 0;font-size:12px}.dsm-notice-toggle{appearance:none;font:inherit;cursor:pointer;background:transparent;border:0;padding:2px 0;display:flex;align-items:center;gap:6px;color:var(--dsw-alias-label-tertiary,#9a9a9a);text-align:left;min-width:0}.dsm-notice-toggle:hover{color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-notice-toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px;border-radius:3px}.dsm-notice-dot{flex:none;width:5px;height:5px;border-radius:50%;background:var(--dsw-alias-label-caption,#777)}.dsm-notice-label{flex:none;font-weight:500}.dsm-notice-summary{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-notice-summary:before{content:'·';margin-right:6px;color:var(--dsw-alias-label-caption,#777)}.dsm-model-settings-section{display:flex;flex-direction:column;gap:14px}.dsm-settings-heading{margin:0;font-size:16px;font-weight:600;line-height:24px;color:var(--dsw-alias-label-primary,#e6e6e6)}.dsm-settings-intro{margin:0;font-size:13px;line-height:20px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-section .dsm-model-settings{margin:0;padding:0;background:transparent;border:0;border-radius:0}.dsm-settings-values{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px;font-size:13px;line-height:20px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-settings-values li::marker{color:var(--dsw-alias-label-tertiary,#999)}.dsm-model-settings-diag{display:flex;flex-direction:column;gap:4px}.dsm-model-settings-diag-toggle{appearance:none;font:inherit;cursor:pointer;background:transparent;border:0;padding:2px 0;display:flex;align-items:center;gap:6px;color:var(--dsw-alias-label-tertiary,#999);font-size:12px;line-height:18px;text-align:left;min-width:0}.dsm-model-settings-diag-toggle:hover{color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-diag-toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px;border-radius:3px}.dsm-model-settings-diag-caret{flex:none;font-size:10px;line-height:1;display:inline-flex}.dsm-model-settings-diag-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-caption,#777)}.dsm-notice-body{margin:0;padding:8px 10px;border-left:2px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-1,#1b1b1d);color:var(--dsw-alias-label-secondary,#b8b8b8);font-size:12px;line-height:18px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:420px;overflow:auto}";
|
|
34
34
|
|
|
35
35
|
if (typeof document !== "undefined") {
|
|
36
36
|
var cssId = "dsh-subagent-default-model/client.css";
|
|
@@ -65,6 +65,13 @@ window.__ModuleLoader__.load({
|
|
|
65
65
|
var SUBAGENT_ROW_ZH = {
|
|
66
66
|
"row.title": "子代理默认模型(dsh-subagent-default-model)",
|
|
67
67
|
"row.desc": "为 subagent / subagent_fork 选择一个或多个默认路由;清空后子代理继承父会话路由。",
|
|
68
|
+
"section.title": "子代理默认模型",
|
|
69
|
+
"section.intro": "三个核心用途:",
|
|
70
|
+
"section.value1": "多模型分配:按轮换或随机策略,为每次子代理指派池中的一条路由。",
|
|
71
|
+
"section.value2": "跨供应商故障转移:连接失败时自动切到另一家供应商的模型,耗尽才放行真实错误。",
|
|
72
|
+
"section.value3": "路由可见可查:当前供应商与模型显示在轨迹和对话里,并写进子代理自己的上下文。",
|
|
73
|
+
"section.diagToggle": "诊断信息",
|
|
74
|
+
"section.diagHint": "排查保存问题时展开",
|
|
68
75
|
"row.provider": "Provider",
|
|
69
76
|
"row.model": "Model",
|
|
70
77
|
"row.effort": "推理强度",
|
|
@@ -93,7 +100,7 @@ window.__ModuleLoader__.load({
|
|
|
93
100
|
"row.failoverEnabled": "连接失败时按队列与策略切换模型",
|
|
94
101
|
"row.failoverHint": "(需配置 ≥2 个 Provider,切换才会生效)。",
|
|
95
102
|
"row.injectRouteContext": "把当前模型与供应商写进子代理上下文",
|
|
96
|
-
"row.injectRouteContextHint": "
|
|
103
|
+
"row.injectRouteContextHint": "(子代理从第 2 步起能回答自己跑在哪个模型上;这是一行真实提示词,不是界面显示)。",
|
|
97
104
|
"row.applyToForkChildren": "让 subagent_fork 子代理也使用这里设定的模型",
|
|
98
105
|
"row.applyToForkChildrenHint": "(默认关闭。fork 子代理会继承父会话的完整对话,宿主因此让它留在父路由上,好让这段前缀能复用缓存;开启后它会改用这里的模型,代价是那段继承的上下文要在新模型上重新算一次)。",
|
|
99
106
|
"row.trajectoryModel": "当前供应商/模型",
|
|
@@ -105,6 +112,13 @@ window.__ModuleLoader__.load({
|
|
|
105
112
|
var SUBAGENT_ROW_EN = {
|
|
106
113
|
"row.title": "Subagent default model (dsh-subagent-default-model)",
|
|
107
114
|
"row.desc": "Choose one or more default routes for subagent / subagent_fork; clear them to inherit the parent session route.",
|
|
115
|
+
"section.title": "Subagent default model",
|
|
116
|
+
"section.intro": "Three things this plugin does:",
|
|
117
|
+
"section.value1": "Multi-model assignment: hand each subagent one route from the pool, by rotation or at random.",
|
|
118
|
+
"section.value2": "Cross-provider failover: switch to another vendor's model when a connection fails, surfacing the real error only once the pool is spent.",
|
|
119
|
+
"section.value3": "Visible route: the live provider and model show in the trajectory and conversation, and are written into the subagent's own context.",
|
|
120
|
+
"section.diagToggle": "Diagnostics",
|
|
121
|
+
"section.diagHint": "expand when triaging a save problem",
|
|
108
122
|
"row.provider": "Provider",
|
|
109
123
|
"row.model": "Model",
|
|
110
124
|
"row.effort": "Reasoning strength",
|
|
@@ -133,7 +147,7 @@ window.__ModuleLoader__.load({
|
|
|
133
147
|
"row.failoverEnabled": "Switch models by queue and strategy on connection failure",
|
|
134
148
|
"row.failoverHint": "(requires at least 2 configured providers).",
|
|
135
149
|
"row.injectRouteContext": "Tell subagents which model and provider they run on",
|
|
136
|
-
"row.injectRouteContextHint": "(
|
|
150
|
+
"row.injectRouteContextHint": "(from step 2 a subagent can answer which model it is; a real prompt line, not a display row).",
|
|
137
151
|
"row.applyToForkChildren": "Also apply these models to subagent_fork children",
|
|
138
152
|
"row.applyToForkChildrenHint": "(off by default. A fork child inherits the parent's full conversation, so the host keeps it on the parent's route to preserve cache reuse of that prefix; turning this on moves it to the configured model and re-runs the inherited context once on the new model).",
|
|
139
153
|
"row.trajectoryModel": "Current provider/model",
|
|
@@ -860,11 +874,14 @@ window.__ModuleLoader__.load({
|
|
|
860
874
|
+ " · writable=" + String(diagnostics.writable)
|
|
861
875
|
+ " · rev=" + (diagnostics.revision === null || diagnostics.revision === void 0 ? "?" : String(diagnostics.revision));
|
|
862
876
|
}
|
|
877
|
+
// The binding diagnostics are a triage aid, not part of the form: a
|
|
878
|
+
// permanently visible `[diag …]` line reads as an error to anyone who is
|
|
879
|
+
// not debugging. It stays COLLAPSED, one click away, and LAST on the page
|
|
880
|
+
// — the bottom edge is where meta information belongs, so it never pushes
|
|
881
|
+
// the configuration the user came for down the screen.
|
|
882
|
+
var diagOpenState = React.useState(false);
|
|
883
|
+
var diagOpen = diagOpenState[0];
|
|
863
884
|
return React.createElement("section", { className: "dsm-model-settings" },
|
|
864
|
-
diagnosticText ? React.createElement("div", {
|
|
865
|
-
className: "dsm-model-settings-hint",
|
|
866
|
-
"data-bindings-diag": diagnosticText
|
|
867
|
-
}, diagnosticText) : null,
|
|
868
885
|
// An empty catalog is the cause of "the model cannot be selected": the
|
|
869
886
|
// Provider select then offers only "inherit" and the Model select is
|
|
870
887
|
// disabled behind `!route.provider`. Say so instead of showing a select
|
|
@@ -965,6 +982,22 @@ window.__ModuleLoader__.load({
|
|
|
965
982
|
React.createElement("button", { type: "button", className: "dsm-btn dsm-btn-outline", disabled: discardDisabled, onClick: discard }, t("row.discard")),
|
|
966
983
|
React.createElement("button", { type: "button", className: "dsm-btn dsm-btn-primary", disabled: saveDisabled, onClick: save }, busyState[0] ? t("row.saving") : t("row.save"))
|
|
967
984
|
),
|
|
985
|
+
diagnosticText ? React.createElement("div", { className: "dsm-model-settings-diag" },
|
|
986
|
+
React.createElement("button", {
|
|
987
|
+
type: "button",
|
|
988
|
+
className: "dsm-model-settings-diag-toggle",
|
|
989
|
+
"aria-expanded": diagOpen ? "true" : "false",
|
|
990
|
+
onClick: function () { diagOpenState[1](!diagOpen); }
|
|
991
|
+
},
|
|
992
|
+
React.createElement("span", { className: "dsm-model-settings-diag-caret" }, diagOpen ? "\u25BE" : "\u25B8"),
|
|
993
|
+
t("section.diagToggle"),
|
|
994
|
+
diagOpen ? null : React.createElement("span", { className: "dsm-model-settings-diag-hint" }, "\u00B7 " + t("section.diagHint"))
|
|
995
|
+
),
|
|
996
|
+
diagOpen ? React.createElement("div", {
|
|
997
|
+
className: "dsm-model-settings-hint",
|
|
998
|
+
"data-bindings-diag": diagnosticText
|
|
999
|
+
}, diagnosticText) : null
|
|
1000
|
+
) : null,
|
|
968
1001
|
toastState[0] ? React.createElement(Toast, { key: toastState[0].seq, text: toastState[0].text, onDone: function () { toastState[1](null); } }) : null
|
|
969
1002
|
);
|
|
970
1003
|
}
|
|
@@ -1004,6 +1037,41 @@ window.__ModuleLoader__.load({
|
|
|
1004
1037
|
);
|
|
1005
1038
|
}
|
|
1006
1039
|
|
|
1040
|
+
// ── SubagentModelSection: the MAIN Settings sidebar page ─────────────
|
|
1041
|
+
//
|
|
1042
|
+
// Since 0.2.1-rc.5 the general Settings panel exposes a `settings.section`
|
|
1043
|
+
// LIST slot: each registration becomes one item in the left-hand nav rail
|
|
1044
|
+
// (id / order / label) and one page in the right-hand pane. Third-party
|
|
1045
|
+
// plugins use it too (e.g. `dsh-opencode-go` registers `id: "opencode-go"`,
|
|
1046
|
+
// `order: 20`), which is exactly the "OpenCode Go" row in the Settings UI.
|
|
1047
|
+
//
|
|
1048
|
+
// Why a wrapper instead of registering `SubagentModelCard` directly:
|
|
1049
|
+
// - the section component receives `{ t, close }`, NOT `view`, so the
|
|
1050
|
+
// collapsible card would render CLOSED (its open state is seeded from
|
|
1051
|
+
// `props.view === "page"`);
|
|
1052
|
+
// - a Settings page is already a dedicated surface, so a second
|
|
1053
|
+
// collapsible shell around the form is redundant chrome.
|
|
1054
|
+
//
|
|
1055
|
+
// So the section renders the real form (`SubagentModelRow`) directly, with
|
|
1056
|
+
// the same heading + intro the shipped sections use, and a small block of
|
|
1057
|
+
// CSS so the form reads as a page rather than a card.
|
|
1058
|
+
function SubagentModelSection(props) {
|
|
1059
|
+
var t = props.t;
|
|
1060
|
+
// The page's one-line intro names the plugin's three values, one sentence
|
|
1061
|
+
// each, so a user landing here can tell what the switches below actually
|
|
1062
|
+
// buy them. A prose paragraph buried that; three bullets carry it.
|
|
1063
|
+
return React.createElement("div", { className: "dsm-model-settings-section" },
|
|
1064
|
+
React.createElement("h2", { className: "dsm-settings-heading" }, t("section.title")),
|
|
1065
|
+
React.createElement("p", { className: "dsm-settings-intro" }, t("section.intro")),
|
|
1066
|
+
React.createElement("ul", { className: "dsm-settings-values" },
|
|
1067
|
+
React.createElement("li", null, t("section.value1")),
|
|
1068
|
+
React.createElement("li", null, t("section.value2")),
|
|
1069
|
+
React.createElement("li", null, t("section.value3"))
|
|
1070
|
+
),
|
|
1071
|
+
React.createElement(SubagentModelRow, props)
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1007
1075
|
// ── 对话流注入行的渲染器(自有节点 kind)─────────────────────────────
|
|
1008
1076
|
//
|
|
1009
1077
|
// 宿主按 `entryKey = node.kind` 在 `conversation.chat.node` 槽位**运行时分派**
|
|
@@ -1557,30 +1625,110 @@ window.__ModuleLoader__.load({
|
|
|
1557
1625
|
};
|
|
1558
1626
|
};
|
|
1559
1627
|
|
|
1560
|
-
//
|
|
1561
|
-
//
|
|
1562
|
-
//
|
|
1563
|
-
//
|
|
1564
|
-
//
|
|
1565
|
-
|
|
1628
|
+
// ── Main Settings sidebar page (`settings.section`) ──────────────
|
|
1629
|
+
//
|
|
1630
|
+
// The plugin's configuration used to live ONLY in the Plugins page's
|
|
1631
|
+
// `plugins.bundle.config` / `plugins.row.config` keyed slots. Starting
|
|
1632
|
+
// with 0.2.1-rc.5 the general Settings panel exposes a `settings.section`
|
|
1633
|
+
// LIST slot, and third-party plugins (e.g. dsh-opencode-go) use it to
|
|
1634
|
+
// put their own page in the left-hand nav rail. The request is to MOVE
|
|
1635
|
+
// the settings there, so those two registrations are gone and the form
|
|
1636
|
+
// is now a first-class Settings section.
|
|
1637
|
+
//
|
|
1638
|
+
// Capability probe: `settings.section` does not exist on hosts before
|
|
1639
|
+
// 0.2.1-rc.5, and this plugin still supports 0.1.7. `slots.inject()`
|
|
1640
|
+
// on an undeclared slot waits forever rather than throwing, so a
|
|
1641
|
+
// registration there would simply never appear — but probing first
|
|
1642
|
+
// makes the intent explicit and keeps the diagnostics honest. We use
|
|
1643
|
+
// `getVersion`, the same API the shipped settings shell uses to rebuild
|
|
1644
|
+
// its nav rows, and fall back to a no-op when it is unavailable.
|
|
1645
|
+
// A DECLARATION probe, not a version compare: `specOf` is the renderer's
|
|
1646
|
+
// own `specDynamic` accessor and answers `undefined` for a slot the host
|
|
1647
|
+
// never declared (`slots.inject()` would then wait forever and the page
|
|
1648
|
+
// would simply never appear). Probing keeps the console honest instead
|
|
1649
|
+
// of leaving a silent no-op.
|
|
1650
|
+
//
|
|
1651
|
+
// NO declaration probe. `slots.inject()` already IS the probe: it waits
|
|
1652
|
+
// for the declaration and runs the callback only once the slot exists,
|
|
1653
|
+
// doing nothing at all on a host that never declares it. A probe built
|
|
1654
|
+
// on an accessor the service may not expose turns "not supported here"
|
|
1655
|
+
// into "never registers anywhere" — which is exactly how 2.1.16/2.1.17
|
|
1656
|
+
// shipped a page nobody could see. Let the host answer.
|
|
1657
|
+
{
|
|
1566
1658
|
try {
|
|
1567
|
-
ctx.slots.inject(
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1659
|
+
ctx.slots.inject("settings.section", function () {
|
|
1660
|
+
// The page and its nav glyph are registered together, in ONE
|
|
1661
|
+
// `inject` callback, and both disposers are returned as a pair.
|
|
1662
|
+
//
|
|
1663
|
+
// Two separate `slots.inject()` calls look equivalent but are not:
|
|
1664
|
+
// each waits on its own declaration, and the glyph's cell is only
|
|
1665
|
+
// meaningful while the page's id exists. Registering them from the
|
|
1666
|
+
// same callback makes the pairing structural instead of a
|
|
1667
|
+
// convention, and Cordis disposes both with this fiber.
|
|
1668
|
+
var disposers = [];
|
|
1669
|
+
disposers.push(ctx.slots.register({
|
|
1670
|
+
name: "settings.section",
|
|
1671
|
+
id: "dsh-subagent-default-model",
|
|
1672
|
+
// After the shipped sections (account -10, general 0, models 10,
|
|
1673
|
+
// plugins 15, agent-presets 20) and alongside other third-party
|
|
1674
|
+
// pages; 30 keeps us last without colliding with a built-in.
|
|
1675
|
+
order: 30,
|
|
1676
|
+
label: function () { return ctx.locale.bind(SUBAGENT_ROW_LOCALE)("section.title"); },
|
|
1572
1677
|
locale: SUBAGENT_ROW_LOCALE,
|
|
1573
1678
|
inject: subagentRowInjected
|
|
1574
|
-
},
|
|
1679
|
+
}, SubagentModelSection));
|
|
1680
|
+
// Nav-rail glyph, addressed by the SAME id as the page: the shell
|
|
1681
|
+
// renders `renderSlot("settings.section.icon", …, { only: row.id })`,
|
|
1682
|
+
// so an unmatched id simply never appears and the default gear
|
|
1683
|
+
// stays. `inline: true` on this slot wraps the cell in a <span>,
|
|
1684
|
+
// hence an <img> sized to the owner's requested edge.
|
|
1685
|
+
// Same reasoning as the page: `inject` waits for the declaration,
|
|
1686
|
+
// so an unconditional call is safe and a probe is not.
|
|
1687
|
+
{
|
|
1688
|
+
var iconInject = null;
|
|
1689
|
+
try {
|
|
1690
|
+
iconInject = ctx.slots.inject("settings.section.icon", function () {
|
|
1691
|
+
var iconDisposer = ctx.slots.register({
|
|
1692
|
+
name: "settings.section.icon",
|
|
1693
|
+
id: "dsh-subagent-default-model",
|
|
1694
|
+
locale: SUBAGENT_ROW_LOCALE
|
|
1695
|
+
}, function (iconProps) {
|
|
1696
|
+
var edge = iconProps && typeof iconProps.size === "number" ? iconProps.size : 16;
|
|
1697
|
+
return React.createElement("img", {
|
|
1698
|
+
src: DSM_ICON,
|
|
1699
|
+
alt: "",
|
|
1700
|
+
width: edge,
|
|
1701
|
+
height: edge,
|
|
1702
|
+
style: {
|
|
1703
|
+
width: edge + "px",
|
|
1704
|
+
height: edge + "px",
|
|
1705
|
+
borderRadius: "3px",
|
|
1706
|
+
display: "block",
|
|
1707
|
+
objectFit: "contain",
|
|
1708
|
+
opacity: iconProps && iconProps.active === false ? 0.75 : 1
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
});
|
|
1712
|
+
disposers.push(iconDisposer);
|
|
1713
|
+
return iconDisposer;
|
|
1714
|
+
});
|
|
1715
|
+
} catch (_iconInjectError) {
|
|
1716
|
+
iconInject = null;
|
|
1717
|
+
}
|
|
1718
|
+
if (typeof iconInject === "function") disposers.push(iconInject);
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
return function () {
|
|
1722
|
+
for (var index = 0; index < disposers.length; index += 1) {
|
|
1723
|
+
var dispose = disposers[index];
|
|
1724
|
+
if (typeof dispose === "function") dispose();
|
|
1725
|
+
}
|
|
1726
|
+
};
|
|
1575
1727
|
});
|
|
1576
1728
|
} catch (error) {
|
|
1577
|
-
console.error('[dsh-subagent-default-model] settings
|
|
1729
|
+
console.error('[dsh-subagent-default-model] settings.section page failed to register (host provider unaffected):', error);
|
|
1578
1730
|
}
|
|
1579
|
-
}
|
|
1580
|
-
// 0.1.7 placement: register under Plugins config surfaces (the old
|
|
1581
|
-
// `settings.plugin.item` slot was removed in 0.1.7).
|
|
1582
|
-
registerCard("plugins.bundle.config", "dsh-subagent-default-model");
|
|
1583
|
-
registerCard("plugins.row.config", "dsh-subagent-default-model#dsh-subagent-default-model");
|
|
1731
|
+
}
|
|
1584
1732
|
});
|
|
1585
1733
|
}
|
|
1586
1734
|
|
package/lib/index.js
CHANGED
|
@@ -644,11 +644,6 @@ function routeContextText(provider, model) {
|
|
|
644
644
|
+ "This line is system-provided context about the runtime, not a user instruction.";
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
/** True when a message is this plugin's injected route line. */
|
|
648
|
-
function isRouteContextMessage(message) {
|
|
649
|
-
return message?.source?.kind === ROUTE_CONTEXT_SOURCE && message.source.form === ROUTE_CONTEXT_FORM;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
647
|
/**
|
|
653
648
|
* Has this agent built a request yet in the CURRENT run?
|
|
654
649
|
*
|
|
@@ -765,50 +760,70 @@ function installRouteContextInjector(ctx, state) {
|
|
|
765
760
|
// Inject on the pre-step, where the message list for the step about to run
|
|
766
761
|
// is still mutable and the agent's own route is already known.
|
|
767
762
|
//
|
|
768
|
-
//
|
|
769
|
-
//
|
|
770
|
-
//
|
|
771
|
-
//
|
|
772
|
-
//
|
|
773
|
-
//
|
|
774
|
-
//
|
|
775
|
-
//
|
|
776
|
-
//
|
|
777
|
-
//
|
|
763
|
+
// THE LINE MUST GO INTO `decision.messages`, NOT THE INBOX.
|
|
764
|
+
// `preStep()` claims (`inbox.claim()`) at its TOP, BEFORE this waterfall, and
|
|
765
|
+
// `claim()` DRAINS `next-step`. So a line prepended into the inbox here can
|
|
766
|
+
// only be claimed by the NEXT `preStep()`: it reached the model one step
|
|
767
|
+
// late. A subagent that finished in a single step therefore NEVER saw it —
|
|
768
|
+
// which broke this feature's whole promise ("the subagent can tell you which
|
|
769
|
+
// model it runs on"), and the pending line also kept the turn alive for one
|
|
770
|
+
// extra, pointless step.
|
|
771
|
+
//
|
|
772
|
+
// `decision.messages` is what `step()` sends, and `step()` appends every
|
|
773
|
+
// entry to the session as a `user/message`, so a line placed there is BOTH
|
|
774
|
+
// visible in the step it belongs to AND persisted into history for every
|
|
775
|
+
// later step. One delivery, both effects.
|
|
776
|
+
//
|
|
777
|
+
// WHAT THIS CANNOT DO: PUT THE LINE ON STEP 1.
|
|
778
|
+
// The route is only known after the step's request commits (`request/context`),
|
|
779
|
+
// and `preStep()` runs BEFORE that request — so on step 1 there is nothing
|
|
780
|
+
// trustworthy to report, and guessing from the dispatch-time `agent.options`
|
|
781
|
+
// is exactly the bug this file already fixed once (a subagent really on `ds41`
|
|
782
|
+
// was labelled `glm`). The line therefore lands on the first `preStep()` whose
|
|
783
|
+
// route is KNOWN, normally step 2. A subagent that finishes inside one step
|
|
784
|
+
// still gets no line — structurally, not by oversight.
|
|
785
|
+
//
|
|
786
|
+
// COST: because an injected message makes that step's list non-empty, a turn
|
|
787
|
+
// that was already finishing runs one more step (the loop breaks only on
|
|
788
|
+
// `turnEnds && decision.messages.length === 0`). The dedupe below makes that
|
|
789
|
+
// happen at most once per route, so it terminates — and this is what the
|
|
790
|
+
// previous inbox-based delivery already did, it just also delayed the line by
|
|
791
|
+
// one further step and never showed it to two-step subagents at all.
|
|
792
|
+
//
|
|
793
|
+
// DEDUPE IS STILL OUT-OF-BAND. The claimed list is drained by `claim()` before
|
|
794
|
+
// this runs, so "is a copy still pending?" is structurally always false; an
|
|
795
|
+
// earlier build asked exactly that and re-injected on EVERY step (a real
|
|
796
|
+
// 29-step subagent collected 28 identical lines). Track what was last injected
|
|
797
|
+
// for this agent instead.
|
|
778
798
|
const injectedRoute = new Map();
|
|
779
799
|
|
|
780
|
-
const disposePreStep = ctx.on("agent/pre-step", async ({ agent
|
|
800
|
+
const disposePreStep = ctx.on("agent/pre-step", async ({ agent }, next) => {
|
|
781
801
|
const decision = await next();
|
|
782
802
|
if (decision === void 0 || decision === null || decision.kind === "reject") return decision;
|
|
783
803
|
if (state.getSection()?.injectRouteContext === false) return decision;
|
|
784
804
|
if (!isSubagentAgent(agent)) return decision;
|
|
785
805
|
|
|
806
|
+
if (!Array.isArray(decision.messages)) return decision;
|
|
807
|
+
|
|
786
808
|
// The live session route wins; see `routeForInjection` for why the
|
|
787
809
|
// dispatch-time `agent.options` must NOT be preferred.
|
|
788
810
|
const route = routeForInjection(agent, resolvedRoute);
|
|
789
811
|
if (route === void 0) return decision;
|
|
790
|
-
// Defensive: only the loop's live Agent exposes an inbox. A test double
|
|
791
|
-
// or a future agent shape without one must not break the step.
|
|
792
|
-
if (agent.inbox === void 0 || !Array.isArray(agent.inbox.nextStep)) return decision;
|
|
793
812
|
|
|
794
813
|
const wanted = routeContextText(route.provider, route.model);
|
|
795
814
|
// Same route as last time => the line already placed in this session is
|
|
796
815
|
// still accurate; inject nothing (no duplicate, no churn).
|
|
797
816
|
if (injectedRoute.get(agent.id)?.text === wanted) return decision;
|
|
798
817
|
|
|
799
|
-
// Route moved (failover / config change): drop any not-yet-claimed copy so
|
|
800
|
-
// the stale route does not linger beside the fresh one.
|
|
801
|
-
for (const message of agent.inbox.nextStep.filter(isRouteContextMessage)) {
|
|
802
|
-
agent.inbox.remove(message.id);
|
|
803
|
-
}
|
|
804
|
-
|
|
805
818
|
const message = createUserMessage({
|
|
806
819
|
content: [{ type: "text", text: wanted }],
|
|
807
820
|
source: { kind: ROUTE_CONTEXT_SOURCE, form: ROUTE_CONTEXT_FORM }
|
|
808
821
|
});
|
|
809
|
-
agent.inbox.prepend("next-step", message);
|
|
810
822
|
injectedRoute.set(agent.id, { text: wanted });
|
|
811
|
-
|
|
823
|
+
// A new array, not a push: the decision object belongs to the loop, and a
|
|
824
|
+
// reader comparing identities should see a change rather than a surprise
|
|
825
|
+
// mutation of what it already handed over.
|
|
826
|
+
return { ...decision, messages: [...decision.messages, message] };
|
|
812
827
|
});
|
|
813
828
|
|
|
814
829
|
const disposeDisposed = ctx.on("agent/disposed", ({ agent }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-subagent-default-model",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "为 DeepSeek Harness 子代理配置默认模型:多模型顺序/随机分配、跨供应商连接失败故障转移,并在轨迹/对话视图显示当前供应商与模型,同时以一行真实提示词把当前路由注入子代理上下文。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -41,14 +41,11 @@
|
|
|
41
41
|
"files": [
|
|
42
42
|
"lib",
|
|
43
43
|
"icons",
|
|
44
|
-
"locale",
|
|
45
44
|
"cordis.patch.yml",
|
|
46
45
|
"LICENSE",
|
|
47
46
|
"README.md",
|
|
48
47
|
"README.en.md",
|
|
49
|
-
"CHANGELOG.md"
|
|
50
|
-
"docs/DETAIL.zh.md",
|
|
51
|
-
"docs/DETAIL.md"
|
|
48
|
+
"CHANGELOG.md"
|
|
52
49
|
],
|
|
53
50
|
"scripts": {
|
|
54
51
|
"test": "node --test",
|
package/docs/DETAIL.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Default models for DSH subagents: pooled ordering, cross-provider failover, live route display.
|
package/docs/DETAIL.zh.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
为 DSH 子代理指定默认模型:池内多个模型按顺序或随机分配,连接失败时自动切换到其他供应商的模型,并在轨迹与对话视图显示当前路由,同时把真实路由注入子代理上下文。
|
package/locale/en.json
DELETED