Skip to content

fix: 适配 DSH 0.1.2+(客户端运行时包已下线、settings.section 注册时序) - #2

Open
Romantoscalion wants to merge 1 commit into
chidaic:mainfrom
Romantoscalion:fix/stale-client-runtime-require
Open

Romantoscalion wants to merge 1 commit into
chidaic:mainfrom
Romantoscalion:fix/stale-client-runtime-require

Conversation

@Romantoscalion

Copy link
Copy Markdown

在 DSH 0.1.5-rc.x 上装上本插件后,WebUI 整页只剩一个报错页

根因一:require('@deepseek-ai/dsh-client-runtime/client') 依赖的包官方已下线 —— dsh-web-app@0.1.1-rc.2
还有,0.1.2-rc.1/0.1.5-rc.2 已移除;npm 上停在 0.0.1-rc.1 是死包;当前平台 seed 表里也没有它。这个 require
会让整棵插件树 boot 失败,不是本插件单独不显示。

根因二:settings.section 由 settings entry 的 children 表声明、比插件更晚 apply,直接 register() 必抛错,改走
ctx.slots.inject(...)(wallpaper-engine 在同版本的写法)。

附改动表、验证结果(0.1.5-rc.1 实跑 + npm test 40/21 全过)、以及「未动 package.json version」的说明。

Two drifts against current DeepSeek Harness (0.1.5-rc.x), both fatal to the
web GUI in different ways:

1. The bundle required '@deepseek-ai/dsh-client-runtime/client' as a
   dependency sanity check. That package is a 0.1.1-rc.2-and-earlier client
   runtime; DSH dropped it in 0.1.2-rc.1, so the require threw
   "client-modules: require(...) missed the module table". A throwing client
   bundle does not degrade that one plugin — it fails the whole plugin tree
   boot, and the GUI renders nothing but "Failed to load plugins". The
   require's value was never used, so it is gone, along with the stale
   dsh.client.inject entry naming the same package (an inject edge to a
   package that ships no row is dead weight).

2. The settings page never appeared: 'settings.section' is declared by the
   settings entry, which applies after this plugin, so the direct
   slots.register() threw `slot "settings.section" is not declared (a parent
   entry's children table must declare it)`. Registration now goes through
   ctx.slots.inject('settings.section', ...) — the same call
   dsh-plugin-wallpaper-engine makes on this DSH version — falling back to
   immediate registration when the host has no slots.inject.

Bundle 1.0.7 -> 1.0.8.

Tests: fake require no longer resolves the dropped package, and
card.test.cjs covers the deferred path (asserting nothing registers before
the declaration lands, and that _declare('settings.section') records the
section) plus the immediate fallback path.

Verified on DSH 0.1.5-rc.1: GUI boots, console shows "[dsh-agent-notify]
bundle v1.0.8 loaded" with no slot error, and Settings shows the 任务提示
nav entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant