dsh-model-switch 0.4.68 → 0.4.70
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 +30 -0
- package/IMPLEMENTATION_PLAN.md +12 -1
- package/PRODUCT.md +3 -3
- package/README.en.md +16 -3
- package/README.md +16 -3
- package/cordis.patch.yml +9 -0
- package/lib/auto-review-CYvvootQ.js +1079 -0
- package/lib/auto-review.js +1 -1
- package/lib/automode-compat.js +1 -1
- package/lib/client.js +503 -47
- package/lib/compaction.js +1 -1
- package/lib/index.js +26 -7
- package/lib/prime-memory-compat.js +573 -1
- package/lib/prime-memory-route-DGUVfogE.js +117 -0
- package/lib/review-timeout-FB32BcnO.js +339 -0
- package/lib/review-timeout.js +1 -1
- package/lib/session-route-CRfpxarI.js +357 -0
- package/lib/session-title.js +17 -3
- package/lib/subagent-runtime-eNKrdb2H.js +424 -0
- package/lib/subagent-runtime.js +1 -1
- package/lib/tool-allowlist-cN9Z1XKn.js +489 -0
- package/lib/types/capabilities-rpc.d.ts +7 -0
- package/lib/types/client/ModelSwitchSettings.d.ts +6 -3
- package/lib/types/client/locales.d.ts +18 -2
- package/lib/types/client-contract.d.ts +33 -1
- package/lib/types/host-settings.d.ts +11 -0
- package/lib/types/prime-memory-compat.d.ts +14 -6
- package/lib/types/prime-memory-route.d.ts +22 -0
- package/lib/types/provider-group.d.ts +31 -3
- package/lib/types/session-route.d.ts +24 -3
- package/lib/types/session-title.d.ts +12 -0
- package/lib/types/tool-allowlist.d.ts +13 -0
- package/lib/types/vision-router-compat.d.ts +62 -0
- package/lib/types/vision-router-route.d.ts +94 -0
- package/lib/vision-router-compat-B9bkgJmh.js +312 -0
- package/lib/vision-router-compat-DP81VMLW.js +312 -0
- package/lib/vision-router-compat.js +2 -0
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
## v0.4.70
|
|
2
|
+
|
|
3
|
+
0.4.69 lab 实测两条遗留观察的插件侧改进(维护版):
|
|
4
|
+
|
|
5
|
+
- **适配行慢启动韧性**:记忆/识图适配行的重试预算从 8 次/约 18 秒扩到 **16 次/约 2.5–3 分钟**(`attempt >= 16`、间隔上限 10s)。慢启动宿主上目标 RPC/行可能在本行激活数分钟后才就绪——0.4.69 lab 实测 DVR 的网络探测把组合拖到分钟级,旧预算耗尽后适配行静默到下一次设置变更。静态 pin 门槛 `PIN_AFTER_ATTEMPTS` 4 → 8(保持预算一半,pin 不再过早压制 live 形态)。
|
|
6
|
+
- **skip 语义细分**:记忆适配行新增 `live-unavailable`(live 接口不可达/重试耗尽),`no-route` 仅表示路由未配置;表单写失败归入 `live-rejected`。
|
|
7
|
+
- **记忆卡状态行**:设置页记忆卡显示适配状态(已接管/未配置/让位/未装/live-unavailable/被拒),慢启动场景在页面直接可见,不再需要翻日志(镜像识图卡 0.4.69 的状态行模式)。
|
|
8
|
+
- **命名槽位冲突检测与指引**:session-titles bundle 排在 dsh-model-switch 之后时,本插件对 `optional-session-title-all-prompts` 的禁用无法命中后置层插入的行(Include 语义限制),官方命名行与接管行撞单注册位,并连带 prime-memory settings-set 把组合告警当内部错误回滚。0.4.70 起接管行检测到组合树中存在已启用的官方命名行时输出 `NAMING_CONFLICT_GUIDANCE`(两个修法:调整 bundles 顺序 / profile 补丁显式禁用);README(zh/en)新增同款故障排查小节;`docs/seam-gap.md` 归档两条上游观察(跨层 disable 缺失;settings-set 对无关组合告警的严格回滚)。
|
|
9
|
+
- **打包卫生**:`package.json` 增加 `prepack: pnpm run build`——`pnpm pack` 此前不触发任何构建,直接打包现存 lib/(0.4.69 lab 首轮因此装到修复前的旧构建,浪费一整轮排查)。
|
|
10
|
+
- **测试**:新增 `live-unavailable` 用例、`NAMING_CONFLICT_GUIDANCE` 内容用例、记忆状态行交互用例。
|
|
11
|
+
- **验证(virtual / 零真实额度)**:DSH `0.2.1-rc.5` lab(`D:\dsh-lab`,3082/4731,本地 0.4.70 构建 + `dsh-vision-router@3.4.0` + `dsh-prime-memory@0.26.24`):
|
|
12
|
+
- **慢启动零触碰收敛(本轮核心主张)**:lab 预置与 0.4.69 相同的实验配置(apigoto 组 memory/vision pin + effort、孪生默认供应商、DVR 种子链),并预先禁用 `optional-session-title-all-prompts` 保持组合干净。启动后**不做任何设置变更**等待慢启动完成:`status.primeMemory = {installed:true, route apigoto/mimo-v2.6-flash, replays:0}`、`status.visionRouter = {installed:true, replays:0}`——0.4.69 同场景记忆适配行需要手动触发一次设置变更(replays 1-2)才收敛,扩展预算(16 次/约 2.5–3 分钟)覆盖了 DVR 网络探测拖慢的组合窗口。记忆 live 读回 effort=high(全局 + l1 逐层);DVR 行 providers 首行写入 `apigoto/mimo-v2.6-flash`、种子链保留(0.4.70 回归无退化)。
|
|
13
|
+
- **组合冲突与告警**:热重载移除 optional 行禁用后,组合回到冲突态(settings-set 再次以 "1 entry did not activate" 回滚——复证 0.4.69 的观察)。该宿主的插件 warn 不落 stdout/文件日志(仅 DVR 自带文件日志可见),告警的发出改由单元测试直接断言:`tests/session-title.spec.ts` 新增聚焦用例(启用官方行的 bench 装置 → apply 后 warns 含 "official naming row is enabled" 与 "optional-session-title-all-prompts"),既有两例精确断言同步滤除这条一次性启动诊断。50/50 通过。
|
|
14
|
+
- 证据:`D:\dsh-artifacts\lab-0470-final-patch.yml`(终态补丁快照,含 DVR 首行写入与 effort 推送持久化)、`lab-0470-host.log`、`probe-0470.jsonl`(零模型调用,全部为配置面验证)。宿主与探针已停止,3082/4731 已释放,lab 恢复为 npm 0.4.62(DVR 卸载、补丁还原)。
|
|
15
|
+
|
|
16
|
+
## v0.4.69
|
|
17
|
+
|
|
18
|
+
四项用户请求的能力一次落地(2026-11-20):**识图路由适配 dsh-vision-router**、**孪生供应商配置组合并**、**记忆蒸馏思考强度**、**纯读免审查白名单校准**。
|
|
19
|
+
|
|
20
|
+
- **识图模型(Vision Router compat,PRODUCT.md 范围修订)**:新增第六项能力路由。`visionProvider`/``visionModel` 平铺对 + 供应商分组 pin;解析与记忆蒸馏同构(部署默认供应商——`agent-default-model` 行,经 canonical 化——的分组 → 平铺对)。语义为**托管首行(managed head)**:配置对成为 DVR `providers` 链首行(主路由),用户自有链路原序保留为降级后备;清空两字段 = `no-route` 不动链;DVR 未装 = no-op。**写入走核心公开服务 ConfigEditor**(`ctx.configEditor.edit(entry, change)`——与 DVR 自己的设置门面同一边界;其 HTTP `local-settings` 端点有 BrowserAuth 围栏,进程内不可用,已否决):文件锁、DVR 自身 Config schema 校验(`providers` 在其 schema 中声明)、原子写、按条目热重载——改路由无需重启。新模块 `src/vision-router-route.ts`(纯规划器:前插/去重/替换会话内 adopted 旧首行/无效行过滤/32 行上限镜像)+ `src/vision-router-compat.ts`(适配行:loader/patch-context + loader/entry-init + internal/service('configEditor') + 1.5s sweep + 指数退避;**先比较后写**防 recompose 环——prime-memory 实测过的 ~6s 环教训;读回验证才置 installed)。cordis.patch.yml 新增 `model-switch-vision-router-compat` insert 行;package.json exports/`tsdown` 同步。RPC `status.visionRouter` 与客户端解码对齐 primeMemory。设置页新增「识图模型」卡(含分组 pin 提示与适配状态行)与分组编辑器第六行「识图」;选型不过滤模型能力(与记忆卡一致,文案提示应选支持图片输入的模型)。
|
|
21
|
+
- **孪生分组合并**:DVR 为每个启用的文本供应商注册 ${provider}-vision` 孪生路由(会话开「👁 识图」即切到 twin),此前同一供应商会存出两个配置组(桌面实测 `yijia925` 与 `yijia925-vision` 并存)。现在:`normalizeProviderGroups` 读取时折叠 twin → 基座(基座字段优先、twin 补空、无基座则改键),下次组保存即从存储清除;`groupOfCanonical`(基座优先、回退原键)用于全部能力解析与 subagent effort 读取——twin 会话按基座组路由;部署默认供应商读取(`deploymentDefaultProviderOf`,从 prime-memory-compat 提取共享)同样 canonical 化(桌面 `agent-default-model` 就是 twin);分组下拉不再单列有基座的 twin(孤儿 twin 保留可见)。已知耦合:`-vision` 后缀是 DVR 保留命名约定(其自身同步按 `endsWith('-vision')` 跳过),DVR 改名则折叠失效(可见不静默),compat-watch 新增条目监控。
|
|
22
|
+
- **记忆蒸馏思考强度**:`memoryReasoningEffort` 平铺 + 分组 pin,`memoryRouteOf` 返回 `MemoryRoute`(分组 effort → 扁辅 effort,镜像 subagentRouteOf)。适配行推送扩展:`distillLayerChains` 每层条目与顶层 `reasoningEffort` 同时携带(prime-memory 运行时按 `entry.reasoningEffort || globalEffort` 解析;`''` = 自动);`memoryLiveMatchesRoute` 幂等比较扩展到 effort。设置页记忆卡与分组「记忆蒸馏」行各加 effort 下拉(选项 = 所选模型 `reasoning.efforts` + 「自动(跟随模型)」,`Field` 组件新增 `emptyLabel`;值域为 prime-memory `EFFORT_CHOICES` 子集,其发送侧自带「模型声明支持才发」钳制)。客户端新增独立 `saveMemory` 保存通道(ops 含 effort 字段)。
|
|
23
|
+
- **纯读免审查白名单 84 → 126 条**(按当前桌面全工具清单校准 + 用户 2026-11-20 明示放行):纯读新增 16(core `schedule_view`;DVR 本地像素/呈现 8:`vision_colors/crop/trace/extract_foreground/materialize/pixel_diff/html_screenshot/present`;univer 只读 4:`univer_status/inspect/lint/api`;mineru 只读 3:`get_task_progress/get_recent_logs/wait_for_task`);**用户放行 26**(DVR 模型调用 6:`vision_describe/bootstrap/ground/detect/ocr/long_screenshot_ocr`——耗额度/图片出网,用户接受;`mcp__mineru-mcp__document_parse`;core 3:`todo_write/update_goal/list_subagent_models`;prime-memory 写类 16:现行 9 + 旧名兼容 7,按名匹配惰性)。`schedule_edit` 经用户同日复核后**保持送审**(可修改/删除其他会话所建任务)。委派类(`subagent/subagent_fork/spawn_teammate`)维持硬排除——放行会使子会话丢失 auto 预设(无审查子代理),技术不变量。来源目录新增 `dsh-vision-router`(github ysr666)、`dsh-univer-office`(github dream-num)、`mcp:mineru-mcp`(**gitee** vandoor2——repo 断言放宽为 github|gitee);前缀规则 `vision_`/`univer_`、MCP 映射 `mineru-mcp`;`CORE_TOOLS` 标注补 `run_code/schedule_view/schedule_edit/list_subagent_models`。放行仅免审、不扩权。
|
|
24
|
+
- **测试**:新 `tests/vision-router-compat.spec.ts`(规划器全语义/visionRouteOf/install 生命周期 8 例:edit 落地且 current 其余键原样、幂等不写、换路由原位替换、no-route/no-row/no-seam/rejected、deploymentDefaultProviderOf canonical 化);`provider-group.spec`(entryOf 新字段 + 折叠/canonical 6 例)、`prime-memory-compat.spec`(effort 载荷/幂等/优先级)、`tool-allowlist.spec`(126 条 + 放行/排除断言 + gitee repo)、`client-controller.spec`(twin 去重 3 例)、`settings-ui.client.spec`(识图卡/分组第六行/记忆 effort 下拉;face 拆分 memory/vision 独立快照)、`search-patch.spec`(新 insert 行组合断言)。**730/730 全绿**(71 文件)。
|
|
25
|
+
- **验证(virtual / 零真实额度)**:DSH `0.2.1-rc.5` lab(`D:\dsh-lab`,3082/4731,本地 0.4.69 构建 + `dsh-vision-router@3.4.0` + `dsh-prime-memory@0.26.24`,探针供应商 apigoto→4731):
|
|
26
|
+
- **识图路由**:lab 预置 apigoto 组 vision pin(apigoto/mimo-v2.6-flash)、孪生默认供应商(`agent-default-model=apigoto-vision`)与 DVR 种子链(probe/deepseek-flash)。启动后适配行经 ConfigEditor 把 DVR 行 `providers` 首行写为 `apigoto/mimo-v2.6-flash`、种子链原序保留为降级(lab `cordis.patch.yml` 读回为证);RPC `status.visionRouter = {installed:true, route apigoto/mimo-v2.6-flash}`;两次 settings-update 重放幂等(replays 1→2,无重复写入)。该路由经孪生规范化命中——`apigoto-vision` 默认供应商 canonical 化为基座 `apigoto` 后取到组 pin,孪生合并在路由层同步得证。
|
|
27
|
+
- **记忆 effort**:以适配行 exact-payload 直推 `/dsh-memory/rpc/settings-set`(`ok:true`),live 读回 `reasoningEffort=high`(全局字段 + l1/l2/l3 逐层条目);改配置触发热重载后 `status.primeMemory = {installed:true, route apigoto/mimo-v2.6-flash, replays:2}`——分组 effort(high)优先于扁平(low),与单测口径一致。
|
|
28
|
+
- **lab 实测发现并修复**:① 适配行 `editor.edit` 方法提取未绑定 `this`,真实类实现的 ConfigEditor 上调用即抛 TypeError(单测 fake 用箭头函数未暴露)——首轮实测表现为 `rejected`;已改为 `.bind(editor)` 并让测试 fake 校验 receiver 防回归,第二轮实测通过。② lab 组合里 `optional-session-title-all-prompts` 与本插件命名接管行撞单注册位("1 entry did not activate"),该组合告警使 prime-memory settings-set 的持久化路径以内部错误回滚——在 lab 补丁显式禁用该可选行后写入恢复(既有环境冲突,非本版引入;告警会阻断该 RPC 写入,值得上游关注)。另:慢启动宿主上记忆适配行的有界重试可在 prime-memory RPC 注册前耗尽,首次 settings 变更触发的重放会收敛(本轮实测行为)。
|
|
29
|
+
- 证据:`D:\dsh-artifacts\lab-0469-final-patch.yml`(终态补丁快照,含 DVR 首行写入)、`lab-0469-host3-utf16.log`(宿主日志)、`probe-0469-vision.jsonl`(探针记录,本轮全部为配置面验证、零模型调用)。宿主与探针已停止,3082/4731 已释放,lab 恢复为 npm 0.4.62(DVR 已卸载、补丁还原)。过程教训:`pnpm pack` 不触发构建(无 prepack 脚本),本地装机 tgz 必须先 `pnpm run build` 再打包;发布序列的 `pnpm run check` 含构建,不受影响。
|
|
30
|
+
|
|
1
31
|
## v0.4.68
|
|
2
32
|
|
|
3
33
|
`list_subagent_models` 现在同时报出「未点名 spawn 的实际默认路由」(按用户 2026-11-19 要求)。
|
package/IMPLEMENTATION_PLAN.md
CHANGED
|
@@ -25,7 +25,7 @@ Known seam constraints from alpha.1 inspection:
|
|
|
25
25
|
- Search routing owns only provider id `model-switch`; the deployment profile pins `web.searchProvider: model-switch` while preserving its existing `fetchProvider`. The official `web_search` and `web_fetch` tools are untouched.
|
|
26
26
|
- `generate_image` is unique, so existing provider-specific image tools remain enabled and require no owner suppression.
|
|
27
27
|
- Codex and Grok register Search and Image adapters. The DeepSeek bridge reuses the official public search implementation and existing settings/credential service. Optional Cordis injection preserves standalone provider behavior and disposal; only Host-projected search metadata reaches the UI.
|
|
28
|
-
- Vision remains outside runtime delivery and must not register or shadow `read_image`.
|
|
28
|
+
- Vision remains outside runtime delivery and must not register or shadow `read_image`. (Amended 2026-11-20: third-party dsh-vision-router backend-chain routing is in scope — see Milestone 6. No vision tool is registered and `read_image` stays unshadowed.)
|
|
29
29
|
|
|
30
30
|
## Milestone 3 — settings surface
|
|
31
31
|
|
|
@@ -38,3 +38,14 @@ Keep the launcher-pinned `agent-presets` row and official web tools. Add clean o
|
|
|
38
38
|
## Milestone 5 — pack/profile/lab acceptance
|
|
39
39
|
|
|
40
40
|
Run the full composition matrix from packed artifacts under `DSH_HOME=~/.dsh-lab` on port 3082. Validate boot, HTTP, profile composition, and artifact hashes; leave browser-only visual checks to the human because the managed browser must not open DSH itself.
|
|
41
|
+
|
|
42
|
+
## Milestone 6 — dsh-vision-router compat, twin group merge, memory effort, allowlist recalibration (2026-11)
|
|
43
|
+
|
|
44
|
+
Four coordinated changes, user-requested 2026-11-20:
|
|
45
|
+
|
|
46
|
+
1. **Vision Router compat** (scope amendment; PRODUCT.md Routes updated): a new `model-switch-vision-router-compat` row fills the third-party plugin's backend-chain head from the provider-group vision route through the released ConfigEditor seam. Managed-head semantics; idempotent compare-before-write; no-op without the plugin.
|
|
47
|
+
2. **Twin group merge**: `<provider>-vision` twin routes (dsh-vision-router's per-provider image-capable routes) key their base provider's group. Read-side fold in `normalizeProviderGroups`, canonical lookups in session routing, and a deduped group picker. The `-vision` suffix is the plugin's reserved naming convention; a rename upstream breaks the merge (fail-visible: groups simply stop folding) and is tracked by the compatibility watch.
|
|
48
|
+
3. **Memory distillation reasoning effort**: a flat `memoryReasoningEffort` plus per-group pin rides the existing memory route layering and is pushed with the route (per-layer entries and the global field; `''` = the plugin's auto resolution).
|
|
49
|
+
4. **Pure-read allowlist recalibration** (84 → 126): new read tools from dsh-vision-router (local pixel tools), dsh-univer-office (inspection), and the mineru-mcp bridge; plus the 2026-11-20 explicit user release of the vision model-invoking tools, `document_parse`, `todo_write`/`update_goal`/`list_subagent_models`, and the prime-memory write set. `schedule_edit` was reviewed the same day and deliberately kept out (it can modify other sessions' tasks). Delegation spawns stay excluded as a technical invariant.
|
|
50
|
+
|
|
51
|
+
**Completion:** `pnpm run check` green and the lab matrix (virtual, zero quota) recorded in the CHANGELOG entry for the release carrying it.
|
package/PRODUCT.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
- **Session model:** the active conversation's provider, model, and optional effort, switched through the official Model Directory and session-local by nature. The deployment default for new sessions belongs to DSH itself: the Host persists the last session switch as the default, and since 0.4.23 this plugin no longer configures, restores, or protects it (its Main-default card was removed; a fixed default is configured on DSH's own Models page).
|
|
8
8
|
- **Default Subagent:** one optional deployment-wide provider/model/effort plus optional per-provider group pins, derived into the route a spawn receives. A child spawn that names no provider, model, or effort is routed with the DELEGATING session's derived route: the group saved for that session's provider (subagent pair and effort), else the fixed card pair in `fixed` mode. When the setting is off, stored `follow-main` is read as unset and Model Switch injects nothing; Official inherit (parent live request, then creation snapshot) and the official Allowlist remain DSH's. A spawn that already supplies provider, model, or effort is never overridden, and a provider whose capability is not `agentOptions` (for example a one-shot process adapter) is never reinterpreted as an Agent-capable route. The default is not an Allowlist and need not be a member of one. Local spawn, fork, continuable, and workflow children use this policy unless the spawn already supplies provider, model, or effort. Remote Codex/Claude children are outside unified routing.
|
|
9
9
|
- **Search Router:** does not register or replace `web_search`. Model Switch registers one public `WebSearchProvider` with id `model-switch`; the existing official `web_search` continues through `ctx.web`, whose configured search provider must be `model-switch`. The thin provider selects the configured backend adapter and model at execution time and returns the official `WebSearchResult` unchanged. v0.2.0 supports Codex Search only. `web_fetch` and its configured provider remain unchanged.
|
|
10
|
-
- **Vision:**
|
|
10
|
+
- **Vision Router compat:** routes the third-party `dsh-vision-router` plugin's backend chain. One optional deployment-wide provider/model plus per-provider group pins; the resolved route becomes the chain's FIRST row (the managed head) with the user's own rows kept below as fallbacks, written through the released ConfigEditor seam (hot reload, no restart). Both fields empty leaves that plugin on its own chain; a missing plugin is a no-op. Model Switch still registers no vision tool, does not shadow `read_image`, and does not preprocess chat attachments; DSH-native vision stays excluded.
|
|
11
11
|
- **Image Router:** owns a new, uniquely named stable `generate_image` tool. It selects the configured Codex or Grok adapter/model at execution time, rejects backend-incompatible fields, and returns normalized image metadata. Existing provider-specific image tools remain available as rollback paths.
|
|
12
12
|
- **Composer Picker:** replaces the composer model seat with a suffix-grouped Model / Effort / Context / Fast / Thinking picker and submits through the official Model Directory. Variant changes preserve an effort only when the target catalog row supports it, otherwise they use the target default or omit effort. Picker changes are session-local. A submitted prompt reserves the selected runtime immediately (composer submitting, pending first turn, or running). Native Antigravity keeps its models and effort; DSH keeps LLM-provider choices and disables Agent providers. After a successful native binding, other groups stay disabled. Cancel without a binding releases the reservation; existing DSH history still cannot convert onto an External Agent. The deployment default write a Host performs alongside a Session switch is left to DSH (since 0.4.23 the plugin no longer restores a pre-switch default).
|
|
13
13
|
- **Plan Review:** intercepts the official `plan-review` composer takeover with a header execution-model picker and right-aligned Discuss in chat / Reject / Set as goal and run / Confirm actions. Confirm commits the selected model before answering; a refused commit leaves the review pending and retryable. Reject carries optional human feedback as the answer's own `custom` text, which plan mode reports to the model. **Set as goal and run** arms this Plan as the session's goal through the released `remote.goals.create` — replacing an unfinished goal with `get` + `clear` first so the new Plan receives a fresh round cap — and only then answers, so `dsh-goal-round-driver` carries the Plan after plan mode exits. The goal is set before the answer, a refusal keeps the review pending and retryable, and a deployment that mounts no goal service disables the action with an explicit reason; the plugin stores no goal state, schedules no rounds, and owns no part of the goal domain. The card body carries only the official two-part summary (first line, first paragraph); the full plan opens in the right sidebar through ui-plan's registered preview opener, which this card drives because a composer-takeover entry cannot declare the official actions slot. Discuss in chat withdraws the takeover through the Host's own verb — `dismiss()` where the Host publishes it, `cancel()` on the older generation — and names the Host when neither seam exists, so a settled review is never a dead end. The same runtime reservation applies.
|
|
@@ -23,7 +23,7 @@ Official `agent-presets` stay in the process. A nested `ctx.plugin(AgentPresets)
|
|
|
23
23
|
|
|
24
24
|
## Settings and lifecycle
|
|
25
25
|
|
|
26
|
-
The settings surface aggregates public Settings namespaces, reads and mutates with optimistic revisions, and saves rows independently. Changing a fixed Subagent model applies only the target catalog row's default effort, so an effort never leaks across providers or models. The Subagent card is a RouteCard with an instant on/off for the Default Subagent route; turning it off keeps the last provider/model on disk. The Auto review, Compaction, and Session naming cards are RouteCards with instant switches defaulting **off = follow the session/conversation model**; turning a switch on pins the catalog head as an editable starting point, and the switch stays disabled until the async model catalog has loaded (or while any row save is in flight) so clicks are never silently dropped. The settings page hosts
|
|
26
|
+
The settings surface aggregates public Settings namespaces, reads and mutates with optimistic revisions, and saves rows independently. Changing a fixed Subagent model applies only the target catalog row's default effort, so an effort never leaks across providers or models. The Subagent card is a RouteCard with an instant on/off for the Default Subagent route; turning it off keeps the last provider/model on disk. The Auto review, Compaction, and Session naming cards are RouteCards with instant switches defaulting **off = follow the session/conversation model**; turning a switch on pins the catalog head as an editable starting point, and the switch stays disabled until the async model catalog has loaded (or while any row save is in flight) so clicks are never silently dropped. The settings page hosts eight route cards — Subagent, Web search, Image generation, Auto review, Compaction, Session naming, Memory distillation, and Vision Router — plus the Provider groups card. Provider groups store one compaction / auto-review / session-naming / memory-distillation / vision / subagent route group per provider in the shared `model-switch` namespace as a DERIVED policy, never a write: each session and each request resolves those routes from its own provider (`pending` selection preferred over `lastUsed`, then logged routes) — group pair → flat deployment-wide pair → official default — so switching a session's provider writes nothing, parallel sessions on different providers never overwrite each other, and mid-session provider switches take effect on the very next call. A dsh-vision-router twin route (a session with vision on) resolves its base provider's group; twin-keyed groups saved earlier fold into their base on read and clear out on the next save. Every row save is one atomic, revision-fenced mutation through the official ConfigForm `mutate`.
|
|
27
27
|
|
|
28
28
|
## Exclusions
|
|
29
29
|
|
|
@@ -33,4 +33,4 @@ Official `settings.section` has no icon field. The Settings nav glyph is a label
|
|
|
33
33
|
|
|
34
34
|
## Delivery architecture
|
|
35
35
|
|
|
36
|
-
The package foundation and pure deep modules remain the policy/test surface. Runtime delivery disables the independent Subagent Loader row with its official name and inserts a uniquely identified replacement; the experimental auto-review row is disabled the same way and replaced by `dsh-model-switch/auto-review`, which mounts the official gate's `apply` unchanged as a plugin under a scoped `llm` shadow — the Host resolves the gate's own `inject` list (including 0.2.1's `workingDirectory`), one `registerAuto` runs, and only when the profile started with the optional auto-review bundle. Session naming replaces the official `session-title-llm` row and owns the service's single provider slot; it mirrors the official cadence the profile declares — first-prompt by default, and the all-prompts cadence whenever the experimental session-titles bundle inserts its row — so enabling that bundle keeps both the per-prompt title refresh and this plugin's configurable naming route, while disabling it restores the first-prompt cadence. The takeover only uses released loader seams (the `loader/patch-context` waterfall, `Entry.update`, and `sessionTitle.register` plus its disposer) and degrades to the official provider with one explicit log line if a future Host changes activation timing. Official AgentPresets stay mounted so they share the process `dsh-scope` identity. Search uses the released `ctx.web.registerSearchProvider()` seam so official tool ownership is preserved. Image uses a unique tool name and provider-owned authenticated adapters. Self-maintained Codex/Grok plugins register optional adapters through the public Model Switch service when present; standalone provider behavior is unchanged. Vision remains
|
|
36
|
+
The package foundation and pure deep modules remain the policy/test surface. Runtime delivery disables the independent Subagent Loader row with its official name and inserts a uniquely identified replacement; the experimental auto-review row is disabled the same way and replaced by `dsh-model-switch/auto-review`, which mounts the official gate's `apply` unchanged as a plugin under a scoped `llm` shadow — the Host resolves the gate's own `inject` list (including 0.2.1's `workingDirectory`), one `registerAuto` runs, and only when the profile started with the optional auto-review bundle. Session naming replaces the official `session-title-llm` row and owns the service's single provider slot; it mirrors the official cadence the profile declares — first-prompt by default, and the all-prompts cadence whenever the experimental session-titles bundle inserts its row — so enabling that bundle keeps both the per-prompt title refresh and this plugin's configurable naming route, while disabling it restores the first-prompt cadence. The takeover only uses released loader seams (the `loader/patch-context` waterfall, `Entry.update`, and `sessionTitle.register` plus its disposer) and degrades to the official provider with one explicit log line if a future Host changes activation timing. Official AgentPresets stay mounted so they share the process `dsh-scope` identity. Search uses the released `ctx.web.registerSearchProvider()` seam so official tool ownership is preserved. Image uses a unique tool name and provider-owned authenticated adapters. Self-maintained Codex/Grok plugins register optional adapters through the public Model Switch service when present; standalone provider behavior is unchanged. Vision stays limited to the dsh-vision-router compat row: no vision tool is registered, and DSH-native vision remains untouched. Replacement modules preserve the official public interfaces and fail closed when compatibility or capability validation fails.
|
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.md)
|
|
4
4
|
|
|
5
|
-
Choose one explicit route for the active session, Subagents, Web Search, image generation, Plan execution, automatic session naming,
|
|
5
|
+
Choose one explicit route for the active session, Subagents, Web Search, image generation, Plan execution, automatic session naming, memory distillation, and vision (dsh-vision-router) in DeepSeek Harness. Model Switch uses public DSH services and provider-owned adapters; it does not patch DSH Core or manage provider credentials.
|
|
6
6
|
|
|
7
7
|
<p align="center"><img src="docs/screenshots/composer-picker.png" alt="Composer Picker with Model and Reasoning effort controls" width="304"></p>
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ The existing 3082 lab replay probe is `node scripts/check-lab-runtime-lock.mjs [
|
|
|
27
27
|
|
|
28
28
|
## Configure Subagents and capability routes
|
|
29
29
|
|
|
30
|
-
Open **Settings → Model Switch**. The page hosts route cards for Subagent, Web search, Image generation, Auto review, Compaction, Session naming,
|
|
30
|
+
Open **Settings → Model Switch**. The page hosts route cards for Subagent, Web search, Image generation, Auto review, Compaction, Session naming, Memory distillation, and Vision, plus the "Review bypass" (pure-read allowlist) and Provider groups cards. Subagents may follow the delegating session's derived route or a fixed provider, model, and effort. The "Review timeout" card was removed and frozen in 0.4.67 (see Compatibility).
|
|
31
31
|
|
|
32
32
|
Since 0.4.23 this plugin no longer configures or protects the deployment default ("Main model"). That default is DSH's own: the Host persists the last session switch as the default (including switches made through this plugin's picker or the TUI), exactly like native switching — so a new session starts on whatever was last used. To pin a fixed default, use DSH's own **Settings → Models** page. Official DSH makes ConfigForms memory-only in non-loopback browsers, so the Settings page shows an unavailable message there; open Settings on the Host loopback URL instead. As a side effect of the removal, model switching is never blocked by settings state (previously the picker waited for a writable Main ConfigForm).
|
|
33
33
|
|
|
@@ -128,9 +128,22 @@ Since 0.4.29 the row also coexists with the experimental "titles that update wit
|
|
|
128
128
|
Since 0.4.30 the Auto review row also survives a degraded permission service. DSH's Auto gate reads `permissionPresets.current(session)` before every tool call, and when that service has gone inactive the read throws `cannot get required service "sessionProjections" in inactive context` outside the gate's own reviewer-error handling — so every tool call died before its body ran. The row shadows that service inside its review scope: a failed probe reports "not on Auto", the tool call runs normally, and one log line states that review was skipped. Since 0.4.31 the shadow is **always on** and resolves the service lazily per call (so it protects even while the service is still activating), and its one degradation line carries the exact fiber chain (`uid/state/name/inject` per fiber) that failed resolution — because the upstream cause is a loader lifecycle window: `internal/get` walks the whole caller fiber chain and twenty-four released rows declare `sessionProjections`, so any one of them mid-reload can break an unguarded probe (recorded in `docs/seam-gap.md` with the upstream proposal). The Auto registration itself is brokered — handed over and reclaimed around displacements without unmounting the gate, since unmounting is what flips live `auto` sessions to `danger-full-access` — and a gate re-mounted after a profile reload unloads its previous registration first, so the `auto` preset cannot disappear from the permission picker.
|
|
129
129
|
|
|
130
130
|
|
|
131
|
+
**Troubleshooting: a naming row "did not activate".** When the session-titles bundle sits **after** dsh-model-switch in the profile's bundles list, this plugin's patch cannot disable `optional-session-title-all-prompts` (an Include disable cannot reach a row a later layer inserts), so the official naming row fights this plugin's takeover row for the single naming slot — the log shows "already registered / 1 entry did not activate", and unrelated profile-persisting writes (prime-memory's settings-set among them) can be blocked by the composition warning. From 0.4.70 the startup log carries the same guidance. Two fixes: move the session-titles bundle before dsh-model-switch, or add an explicit disable to the profile's cordis.patch.yml:
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
- id: optional-session-title-all-prompts
|
|
135
|
+
disabled: true
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Memory distillation & Vision Router
|
|
139
|
+
|
|
140
|
+
The "Memory distillation model" card pins the distillation route for the third-party `dsh-prime-memory` plugin and may carry a **reasoning effort** (empty = the plugin's auto resolution from model capability). Saving writes that plugin's own live settings immediately — the per-layer chains and the global field both carry the effort — with no restart; only when the live attempts keep failing does the static route fall back to the next start. The route resolves from the deployment default provider's group, else the flat pair.
|
|
141
|
+
|
|
142
|
+
The "Vision model" card pins the vision backend for the third-party `dsh-vision-router` plugin: the configured provider/model becomes the chain's **first row** (the managed head) while the rows you configured yourself stay below in their own order as fallbacks; clearing both fields hands the chain back to that plugin (the last injected head can be removed manually in its settings). The write crosses the official ConfigEditor seam — the same boundary the plugin's own settings facade uses — and hot-applies without a restart; without that plugin installed the card is a no-op. Pick a model that accepts image input. The route resolves from the deployment default provider's group, else the flat pair.
|
|
143
|
+
|
|
131
144
|
## Provider groups
|
|
132
145
|
|
|
133
|
-
The "Provider groups" card stores one route group per provider — the compaction, auto-review, session-naming, and subagent routes saved together — and a group saved for provider X applies to the sessions whose own provider is X. Groups are **derived, not written**: switching a session's provider writes nothing, so two sessions on different providers can never overwrite or redirect each other's auxiliary routes.
|
|
146
|
+
The "Provider groups" card stores one route group per provider — the compaction, auto-review, session-naming, memory-distillation, vision, and subagent routes saved together — and a group saved for provider X applies to the sessions whose own provider is X. **Vision on/off shares one group per provider:** `dsh-vision-router` registers a `<provider>-vision` twin route per provider, and a session with vision on runs on that twin, but the group key is always the base provider; twin-keyed groups saved earlier fold into their base on read and clear out on the next save. Groups are **derived, not written**: switching a session's provider writes nothing, so two sessions on different providers can never overwrite or redirect each other's auxiliary routes.
|
|
134
147
|
|
|
135
148
|
Every request derives its own route from durable state: the session's provider (its model selection — a just-made pending selection counts — else its latest logged request route), then the group pair for that provider, then the flat deployment-wide pair, then the official default (the conversation target for compaction; the session's own model for auto review and naming; official inherit for subagents, where the fixed card applies only in `fixed` mode). Because nothing is written, this works for sessions this browser never opened and for switches made from the TUI or another client, with no watcher and no residual boundary; a session with no observable provider simply resolves to the deployment default. Mid-session provider switches take effect on the very next compaction, review, title, or subagent call. In the editor, a provider's draft seeds from the currently active routes the first time you configure it, each row's off state means "no pin — fall through to the card, then the official default", and **Delete group** removes the provider's entry entirely (clearing the stored field when the last group goes).
|
|
136
149
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
中文 | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
在 DeepSeek Harness 中为当前会话、Subagent、Web Search、图像生成、Plan
|
|
5
|
+
在 DeepSeek Harness 中为当前会话、Subagent、Web Search、图像生成、Plan 执行、自动会话命名、记忆蒸馏与识图(dsh-vision-router)配置明确路由。Model Switch 只使用 DSH 公开服务和 Provider 自有 Adapter;不修改 DSH Core,也不管理 Provider 登录凭证。
|
|
6
6
|
|
|
7
7
|
<p align="center"><img src="docs/screenshots/composer-picker.png" alt="包含模型与推理等级的 Composer Picker" width="304"></p>
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ Picker 在切换页面或关闭搜索时保留键盘焦点,不覆盖搜索框
|
|
|
25
25
|
|
|
26
26
|
## 配置 Subagent 与能力路由
|
|
27
27
|
|
|
28
|
-
打开 **设置 → Model Switch**。设置页的能力路由卡片覆盖 Subagent、Web
|
|
28
|
+
打开 **设置 → Model Switch**。设置页的能力路由卡片覆盖 Subagent、Web 搜索、图像生成、自动审查、压缩、会话命名、记忆蒸馏与识图,外加「审查豁免」(纯读工具免审查名单)与「供应商配置组」卡片。子代理可以使用委派会话推导出的路由,也可以使用固定的 provider、model 和 effort。「审查超时」卡片已于 0.4.67 移除并冻结(见下文兼容性一节)。
|
|
29
29
|
|
|
30
30
|
自 0.4.23 起本插件不再配置、也不再保护部署默认模型(原「主模型」卡片)。默认模型归 DSH 自己:Host 会把最后一次会话切换写成默认值(包括经本插件选择器或 TUI 的切换),与原生切换行为一致——新会话从"上次用过的模型"开始。需要固定默认值时,请使用 DSH 自带的 **设置 → 模型** 页面。官方 DSH 在非本机浏览器将 ConfigForms 设为仅内存模式,设置页会明确显示不可用;请在 Host 的 127.0.0.1 页面打开设置。移除主卡片的附带收益:模型切换从此不再依赖设置可写状态(此前选择器要等 Main 表单可写才允许切换)。
|
|
31
31
|
|
|
@@ -126,9 +126,22 @@ DSH 会自动为新会话起名;命名的触发节奏由 profile 的官方命
|
|
|
126
126
|
0.4.30 起 Auto 审查行还能在许可服务降级时保住工具调用:DSH 的 Auto gate 在每次工具调用前读取 `permissionPresets.current(session)`,一旦该服务失活,这次读取会在 gate 自己的审查错误包装之外抛出 `cannot get required service "sessionProjections" in inactive context`,导致每个工具调用都在执行前失败。本行在审查作用域内遮蔽该服务:探测失败即按「不在 Auto」处理,工具调用照常执行,并只记一行日志说明审查被跳过。0.4.31 起该遮蔽**常开**且按调用惰性解析服务(服务尚未激活时也受保护),并把失败的解析链(每级 fiber 的 `uid/state/name/inject`)记进唯一那行降级日志——因为上游成因是 loader 生命周期窗口:`internal/get` 会沿调用方 fiber 链整链查找,而有 24 个已发布行在 `inject` 里声明了 `sessionProjections`,其中任何一行处于重载中都可能打断无防护的探测(连同上游建议一并记录在 `docs/seam-gap.md`)。Auto 注册本身改为**托管**:位移时同步交出、事后收回而不卸载 gate(卸载会把在用 `auto` 的会话翻成 `danger-full-access`);配置重载后重新挂载的 gate 会先卸载上一个注册,因此 `auto` 预设不会再从许可选择器里消失。
|
|
127
127
|
|
|
128
128
|
|
|
129
|
+
**故障排查:命名行「did not activate」。** 当 profile 的 bundles 里 session-titles bundle 排在 dsh-model-switch **之后**时,本插件补丁对 `optional-session-title-all-prompts` 的禁用无法命中后置层新插入的行(Include 语义限制),官方命名行会与本插件的接管行争夺唯一的命名槽位——日志出现「already registered / 1 entry did not activate」,并可能连带阻断 prime-memory 等插件的 settings-set 持久化写入。0.4.70 起启动日志会给出同样指引。两种修法:把 session-titles bundle 移到 dsh-model-switch 之前;或在 profile 的 cordis.patch.yml 显式加一行禁用:
|
|
130
|
+
|
|
131
|
+
```yaml
|
|
132
|
+
- id: optional-session-title-all-prompts
|
|
133
|
+
disabled: true
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 记忆蒸馏与识图模型(Memory distillation & Vision Router)
|
|
137
|
+
|
|
138
|
+
「记忆蒸馏模型」卡片为第三方 `dsh-prime-memory` 指定蒸馏路由,并可附带**思考强度**(留空 = 该插件按模型能力自动解析)。保存后立即写入该插件自己的 live 设置(逐层链与全局字段同时携带强度),无需重启;仅当反复写不进去时才回落静态路由(下次启动生效)。路由按部署默认供应商的配置组解析,无组时用平铺对。
|
|
139
|
+
|
|
140
|
+
「识图模型」卡片为第三方 `dsh-vision-router` 指定识图后端:配置的 provider/model 成为该插件后端链的**首行**(托管首行),你自己配置的其余链路原序保留为降级后备;清空两个字段即把链路交还该插件自己管理(此前注入的首行可在该插件设置里手动删除)。写入走官方 ConfigEditor 接缝(与该插件自己的设置门面同一边界),热生效、无需重启;未安装该插件时本卡无操作。应选择支持图片输入的模型。路由同样按部署默认供应商的配置组解析。
|
|
141
|
+
|
|
129
142
|
## 供应商配置组(Provider groups)
|
|
130
143
|
|
|
131
|
-
|
|
144
|
+
「供应商配置组」卡片为每个供应商保存一组路由——压缩、自动审查、会话命名、记忆蒸馏、识图与子代理一起存;为供应商 X 保存的组,作用于自身供应商就是 X 的会话。**同一供应商开/关视觉共用同一个组**:`dsh-vision-router` 为每个供应商注册 `<provider>-vision` 孪生路由,会话开「👁 识图」即切到孪生,但分组键始终是基座供应商;历史上保存过的孪生组会在读取时并入基座、下次保存时收敛清除。组是**推导出来的,而不是写进去的**:切换某个会话的供应商不写任何东西,因此不同供应商上的多个会话并行时再也不会互相覆盖、互相改写对方的辅助路由。
|
|
132
145
|
|
|
133
146
|
每次请求都从持久状态推导自己的路由:先取该会话的供应商(它的模型选择——刚做出、尚未被请求消费的 pending 选择优先——其次最近一次已记录的请求路由),再取该供应商的组对,再取部署级的平铺对,最后是官方默认(压缩用会话目标模型;自动审查与命名用会话自身模型;子代理用官方继承,且平铺卡片仅在 `fixed` 模式下生效)。因为什么都不写,本浏览器从未打开过的会话、以及来自 TUI 或其他客户端的切换同样生效——没有 watcher,也没有剩余边界;观察不到供应商的会话直接落到部署默认。会话中途切换供应商后,下一次压缩、自动审查、命名或子代理调用都会立即跟随新供应商的配置组。编辑器里首次配置某供应商时,草稿从当前生效的路由种子化;每行的关闭态表示"不固定——先落到卡片、再落到官方默认";「删除该组」彻底移除该供应商的条目(删掉最后一组时同时清掉存储字段)。
|
|
134
147
|
|
package/cordis.patch.yml
CHANGED
|
@@ -81,6 +81,15 @@
|
|
|
81
81
|
- id: model-switch-prime-memory-compat
|
|
82
82
|
name: 'dsh-model-switch/prime-memory-compat'
|
|
83
83
|
|
|
84
|
+
# Fill the third-party dsh-vision-router row's backend-chain head from this
|
|
85
|
+
# plugin's provider-group route through the released ConfigEditor seam (the
|
|
86
|
+
# same boundary the plugin's own settings facade crosses). The write lands
|
|
87
|
+
# in that row's config and hot-reloads it; no-op when that plugin is not
|
|
88
|
+
# installed. The user's own chain rows stay below the managed head as
|
|
89
|
+
# fallbacks, and an empty route leaves the chain untouched.
|
|
90
|
+
- id: model-switch-vision-router-compat
|
|
91
|
+
name: 'dsh-model-switch/vision-router-compat'
|
|
92
|
+
|
|
84
93
|
# 2026-11-19 冻结:审查超时适配行已移除,本插件不再写 reviewer provider 的
|
|
85
94
|
# streamIdleTimeoutMs。源码保留一个版本(src/review-timeout.ts 标注
|
|
86
95
|
# deprecated),下个大版本删除。
|