Files
apes-sidebar/docs/plans/2026-09-28-dsh-0.2.0-rc.1-adaptation.md
T
Menghuan1918 b7825e1bd0 docs(dsh): 记录 profile overrides 必须与宿主同批抬版本的坑(0.2.0 升级实测)
升级 3080 后出现「加载提供商目录失败: settings service is absent」,根因是 profile 的
pnpm-workspace.yaml 里上一轮留下的 overrides '@deepseek-ai/dsh-settings': 0.1.7-rc.2——
它让 profile 顶层留住 0.1.7-rc.2 的 dsh-settings,后者用精确版本拉来 dsh-config-editor
0.1.7-rc.2 并遮蔽 bundle 自带的 0.2.0-rc.1,于是 0.2.0 的启动预检禁用 config-editor 行,
settings 行永远 pending (waiting for service: configEditor)。

已修:override 抬到 0.2.0-rc.1(profile 顶层全部收敛到 0.2.0-rc.1,.pnpm 里 0.1.7 副本归零)。
文档:适配记录新增 §5.1(含原始日志证据),AGENTS §3.0 增加「用户 profile 自己的 pin 也要
同批抬」一条。
2026-09-28 21:38:58 +08:00

8.9 KiB
Raw Blame History

DSH 0.2.0-rc.1 适配记录(v0.24.0)

状态:已实施。支持线从 ^0.1.7-rc.1 整体前移到 ^0.2.0-rc.1(单线:0.1.7 用户停在 v0.23.0)。 上游发布:dsh-v0.2.0-rc.1(npm dist-tag next;latest 仍是 0.1.7-rc.2)。

0. 结论先行

0.2.0-rc.1 对本插件所消费的全部宿主 API 是纯增量:19 个被用到的宿主包零值导出删除,会话格式与子代理描述符版本未动,CLI 与客户端运行时逐字节相同。因此本版没有为 0.1.7 写任何运行时兼容分支——唯一必须改的是 peer 下限(否则宿主启动预检会静默禁用整行)。

1. 硬阻塞:caret 跨 minor 不成立

packages/boot/app-boot/src/plugin-compatibility.ts(0.1.7-rc.1 起)遍历 profile 行的 peerDependencies,对名字为 @deepseek-ai/dsh / @deepseek-ai/dsh-* 的条目跑 semver.satisfies(宿主版本, 范围, { includePrerelease: true }),不满足就 row.disabled = true,只在 stderr 留一行 disabling profile plugin …。

实测(semver 7,includePrerelease: true):

range 对 0.2.0-rc.1
^0.1.7-rc.1 false(caret 上界展开为 <0.2.0-0)
^0.2.0-rc.1 true
>=0.1.7-rc.1 <0.3.0 true(显式比较器不带 -0 上界)
>=0.1.1-rc.2 <0.2.0 true(同上,dsh-whale-report 正因此仍能加载)

教训:AGENTS.md §3.4 第 12 条(c) 那条「includePrerelease 让判定更宽松(^0.1.6-alpha.2 也能满足 0.1.7-rc.1)」只在同一 minor 内成立;跨 minor 时必须同步抬 peer 下限。用户已选择单线方案,不做「同时覆盖两条线」的放宽范围。

2. 适配前实测证据(决定了「零运行时改动」)

检查面 方法 结果
值导出删除 对插件 import 的 19 个宿主包,提取 lib/*.js 里 export {…} / exports.x= 的名字集合做差 removed = none;唯一新增 ui-primitives 的 pointerModality
类型面变化 lib/types/** 逐文件 hash + diff 仅 3 处:ui-primitives(DisclosureRow / TextShimmer / Tooltip 新增可选 prop、overlay 顶部内距改用 frame overlay inset)、dsh-session(新增 ToolCallRecovery;interruptedTurnClosers 仍在)、dsh-api-remotes(新增 product-analytics remote 行)
会话格式 查 SESSION_FORMAT_VERSION 与 session-format-* 迁移包清单 仍 v4,无 session-format-v4-to-v5
子代理描述符 grep SUBAGENT_DESCRIPTOR_VERSION 仍 3
CLI 契约 diff dsh/lib/bin.js 字节相同(dsh plugin / dsh web / 就绪行 / --version 全不变)
客户端运行时 diff dsh-client-modules/lib/index.js、客户端包 provide(...) 名字、web-app 的 dsh.client.inject 全部相同
测试期依赖 对比 ui-primitives 产物的裸 import 集合 相同 → 无需新增 devDependency(不重演 0.1.7 §3.3 第 12 条)
agent-team 四个包的 lib/types hash 逐字相同
web profile 组成 web-app/cordis.patch.yml diff 新增 desktop-only product-analytics / desktop-product-telemetry(web 上 disabled);time-context / schedule / ui-schedule(本就 disabled)移入可选 dsh-experimental-schedule-bundle。挂载 lane 的「宿主 tab 恰 1 条(terminal)、browser 缺席」断言不受影响

3. 实施内容

  1. package.json:14 条 DSH peer → ^0.2.0-rc.1;27 个 @deepseek-ai/* devDependencies 精确钉版 → 0.2.0-rc.1(@deepseek-ai/cordis 4.0.4 / cordis-plugin-group 1.0.4 / cordis-plugin-include 1.0.9 不变);version → 0.24.0。
  2. dsh.plugin.json:engines.dsh → >=0.2.0-rc.1(零读者的元数据,但保持诚实)。
  3. scripts/e2e-common.sh:DSH_NPX_SPEC 与 DSH_EXPECT_VERSION → 0.2.0-rc.1。
  4. .github/workflows/ci.yml:npm install -g @deepseek-ai/dsh@0.2.0-rc.1 + 注释补「0.2.0 首个候选版只挂在 next 上」。
  5. tests/market-manifest.spec.ts:peer 形状正则钉当前基线 tuple(/^\^0\.2\.0-[a-z0-9.]+$/),并把「caret 跨 minor 必失效」写进注释。
  6. 文档:README.md / README_EN.md(支持线横幅、shields 徽章、安装对照表新增 0.2.0 行并保留 0.1.7 行的 v0.23.0 指引、最近更新新增 v0.24.0)、CHANGELOG.md / CHANGELOG_EN.md(v0.24.0 条目)、AGENTS.md(§2 钉版句、§3 改为「DSH 版本适配要点」并新增 §3.0 当前基线 + 0.1.7 历史分节)、docs/external-plugin-guide.md(当前版本与 peer 下限)。
  7. 未改任何 src/** 运行时代码——证据见 §2。

4. 已知残留(非本插件可解)

  • @huanlin/dsh-plugin-better-locale(可选集成;没有任何源码或测试 import 它,运行时靠 ctx.get('betterLocale') 结构化探测)的 peer 钉在 ^0.1.0-rc.8,其最新 0.4.3 也钉 ^0.1.5-rc.2 → 在 0.2.0 上都会被宿主预检禁用。因此 pnpm peers check 会报它的 5 条 unmet peer;本插件自身的 14 条 peer 全部满足。属上游未适配 0.2.0。
  • 本机 pnpm 的 registry 是 registry.npmmirror.com,对新预发布滞后(本次实测:镜像上 @deepseek-ai/dsh-attachment@0.2.0-rc.1 不存在 → ERR_PNPM_NO_MATCHING_VERSION)。安装用一次性覆盖:pnpm install --registry https://registry.npmjs.org。
  • @deepseek-ai/dsh-experimental-agent-team-web-profile 仍无 0.1.7 / 0.2.0 发布(停在 0.1.6-alpha.2)→ 本机实例升级时该行保持旧版,运行时兼容性属未验证(见 §5)。

5. 本机 3080 实例升级(与仓库适配分开执行)

升级前的 profile 预检(18 个依赖,按宿主同一套 semver 语义逐个判定):

依赖 DSH peer 0.2.0-rc.1
dsh-better-sidebar@0.23.0 ^0.1.7-rc.1 会被禁用 → 本版 v0.24.0 修复
dshmarket@1.35.0 ^0.1.0-rc.7 || ^0.1.1-rc.2(最新 1.66.3 的 dsh-settings peer 仍是 ^0.1.x) 会被禁用(上游未适配,无法绕过)
dsh-whale-report@0.5.4 >=0.1.1-rc.2 <0.2.0 可加载(显式比较器)
dsh-notification@0.1.4 * 可加载
dsh-feishu-notify / dsh-flowglass / dsh-lan-access / dsh-apollo / dsh-tauri* 无 DSH peer 不被预检拦(运行时未验证)
@deepseek-ai/dsh-experimental-agent-team-profile 无 DSH peer 升级到 0.2.0-rc.1
@deepseek-ai/dsh-experimental-agent-team-web-profile@0.1.6-alpha.2 无 DSH peer 保持旧版(无 0.2.0 发布),运行时未验证

5.1 实测踩到的坑:profile 自己的 pnpm-workspace.yaml overrides 必须与宿主同步

升级后 3080 出现「加载提供商目录失败: settings service is absent: mount @deepseek-ai/dsh-settings with @deepseek-ai/dsh-config-editor in the profile composition」。宿主日志给出了根因链路:

dsh: disabling profile plugin row "config-editor": Plugin @deepseek-ai/dsh-config-editor@0.1.7-rc.2
     is incompatible with dsh 0.2.0-rc.1: peerDependencies {"@deepseek-ai/dsh-hmr":"0.1.7-rc.2",
     "@deepseek-ai/dsh-app-boot":"0.1.7-rc.2"}
settings (@deepseek-ai/dsh-settings): pending (waiting for service: configEditor)

profile 的 pnpm-workspace.yaml 里有一条上一轮升级留下的 overrides: '@deepseek-ai/dsh-settings': 0.1.7-rc.2(它自己的注释就写着「Keep this in lockstep with the host version」)。这条 pin 让 profile 树里的 dsh-settings 停在 0.1.7-rc.2,而 dsh-settings 用精确版本声明 dsh-config-editor / dsh-util-values → profile 顶层出现 0.1.7-rc.2 的 dsh-config-editor,它遮蔽了宿主 bundle 自带的 0.2.0-rc.1,于是 0.2.0 的启动预检把 config-editor 整行禁用,settings 行永远等不到 configEditor,设置/模型页的 provider 目录随之失败。

修法:把该 override 与注释一起抬到 0.2.0-rc.1 → pnpm install(profile 内)→ 重启。修复后 profile 顶层全部收敛到 0.2.0-rc.1(dsh-atomic-write / dsh-brand / dsh-config-editor / dsh-util-values / agent-team 三包),.pnpm 里 0.1.7-rc.2 的副本归零。

教训(对宿主版本升级通用):升级 DSH 时,除了 launcher 的 npx 钉版与 profile 依赖,profile 自己的 overrides / pnpm-workspace.yaml 里任何 @deepseek-ai/dsh-* pin 都必须同批抬版本;否则 profile 树里会出现旧宿主包并遮蔽 bundle 自带的那一份,而预检只报「某行被禁用」,症状(设置服务缺失)与原因(一条 override)隔着好几层。

升级步骤(含回滚)见最终交付说明:备份 ~/.dsh/dsh-web.sh 与 profiles/web/package.json → launcher 的 npx 钉版 → 0.2.0-rc.1 → 升 agent-team profile → 装 v0.24.0 tarball → pm2 restart dsh-web → 核对路由与 pm2 logs 的 disabling profile plugin 行。