Repository navigation
【Bug】桌面端 desktop profile 无法安装任何插件:dsh: profile reload requires the root Include entry #9750
Replies: 1 comment
|
报错本身你抓得准,测试也把它固化了。但你引的那条调用链不对——真正调进来的不是 报错出处
if (entry === undefined) throw new Error(`${binName}: profile reload requires the root Include entry`)这是唯一来源( 那个 你引的链条要改你写的是
没经过 有一个现成的 workaround,而且源码里写着
也就是说 HMR 不在的组合下这条路根本不会走到那个 throw,代价是装完要重启。你可以在 profile 里把 hmr 关掉试试——这能同时验证"是不是 HMR reconcil 这一层的问题"。 一处我没法替你定的"为什么这个 Context 上取不到 root Include"——静态看代码判不出来。可能是 Context 身份不同(例如重载时换了新的 root),也可能是 不过如果是后者,你这份报告的价值会大很多——因为那正好跟"profile 里有重复的 dsh 包副本"是同一类问题。建议你在报告里把这两种可能都列出来,并附上你那份 边界我核的是
|
Uh oh!
There was an error while loading. Please reload this page.
【Bug】桌面端 desktop profile 无法安装任何插件:
dsh: profile reload requires the root Include entry环境
0.2.0-rc.244.0.0v24.21.0;resources/runtime/versions.json仍记录"node": "24.18.1"(疑似版本漂移)v11.7.0desktopdsh-cost-meter@1.8.26(npm)profile 已加载 bundle:
@deepseek-ai/dsh-base、@deepseek-ai/dsh-web-app、dshmarket、dsh-office-tools、@weibaohui/skills-management、dsh-skill-hub、@klarkxy/dsh-dev-index、billion-context、dsh-agents-md、@noob-stupid/dsh-plugin-console、dsh-batch-tool-calls、@nonamelego/dsh-catppuccin、dsh-context、dsh-claude-style。复现步骤
desktop)。dsh-cost-meter,1.8.26 稳定复现)。结果载荷:
{"code":"operation-error","diagnostic":"dsh: profile reload requires the root Include entry"}pnpm 尾部输出:
注意:pnpm 已经解析并写入依赖(
+ dsh-cost-meter 1.8.26),随后操作失败并整体回滚(Packages: -27)。回滚后 profile manifest 不写依赖,但node_modules/dsh-cost-meter残留目录不被清理。期望行为
安装应当完成,并走官方已支持的降级路径:热重载不可用时报告
restart-required(「文件已写入,重启 DSH 后生效」),而不是抛operation-error并回滚。实际行为
desktop profile 上任何管理操作都返回
operation-error与该 root-Include 诊断,已装上的包又被移除。代码级分析(基于随应用发布的 asar)
该诊断串在整个应用里只有一个来源:
@deepseek-ai/dsh-app-boot的lib/index.js。bootstrapIncludes只在mountRootInclude()内写入一次,键是 boot 期的根 ctx 对象:同一文件的
boot()在该 ctx 上挂载 root Include:失败调用点在
@deepseek-ai/dsh-plugin-manager的lib/index.js:即:只要
ownerContext.get("hmr")非空,reload()就会走到这个必然抛错的调用;而 desktop profile 确实启用了hmr(base bundle 中该行为disabled: !!js "!ctx.get('profileContext')")。于是bootstrapIncludes.get(this.ownerContext.root)取不到值——从 plugin manager 能拿到的 ctx 不是 boot 期mountRootInclude()注册的那个对象。同一个抛错入口还被
@deepseek-ai/dsh-hmr自己的 profile 监听器使用:因此手工改 profile 的
package.json/cordis.patch.yml也会触发同样错误。已确认 / 尚未确认
已确认(读随包发布代码):
reconcileProfilePatches。bootstrapIncludes是模块级WeakMap,以 boot 期 ctx 为键。ownerContext.get("hmr")为真时走到该调用;desktop profile 确实启用hmr与plugin-manager。@deepseek-ai/dsh-app-boot在 asar 中只有一份(profile 自身node_modules/@deepseek-ai仅有cosmokit、schemastery),不是两份模块各持一个 WeakMap。尚未确认(需运行时信息,非静态代码可判):
isolate:子树、host runner 另建的 kernel,还是 ctx 归属错误),以及因此ownerContext.root为何不等于 boot 期 root。修复建议
reconcileProfilePatches()/ HMR refresh 把「未注册 root Include」当成诊断降级为restart-required,使 desktop 上不可能成功的热重载不再回滚安装。另建议:安装失败回滚时清理
node_modules残留,或在错误文案中明确提示本次为「已回滚」。已验证的临时规避
在 profile 的
cordis.patch.yml顶部覆盖 base bundle 的hmr行:依据:
PluginManager.reload()本身就有if (this.ownerContext.get("hmr") === void 0) return [];,change()也有restart-required分支,因此重载被跳过、安装以restart-required落地,重启桌面端后生效。代价:该 profile 失去配置/bundle 热重载。实测结果:有效。 重启后同一安装成功:manifest 写入
dsh-cost-meter: ^1.8.26、dsh.profile.bundles含dsh-cost-meter、node_modules就位,且不再出现该报错。All reactions