DeepSeek Harness plugin

dsh-hot-reload-sipengxi

Hot-reload installed out-of-tree DSH plugins without restarting the host: /reload <package> evicts the module cache and remounts the loader entry (out-of-tree plugin)

Jump to install

Source facts

Repository
SipengXie2024/dsh-hot-reload
Latest update
Aug 15, 2026
Category
Development & Runtime
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/SipengXie2024/dsh-hot-reload
Plugin: dsh-hot-reload-sipengxi
Author: SipengXie2024

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-hot-reload

Hot-reload installed out-of-tree plugins for dsh (DeepSeek Harness) — no host restart, no lost sessions.

不重启 DSH host、不丢会话,把已安装的第三方插件从磁盘重新装载。

用法

  • 对话框:/reload dsh-session-topics(无参数列出可 reload 的包)
  • HTTP:GET /hot-reload?name=dsh-session-topics(无参返回 usage + 候选列表)

典型工作流

改插件代码 → bump version + npm pack + dsh plugin --profile web add <tgz> → /reload <包名>

开发期更快的环路(跳过 pack/add):直接改 $DSH_HOME/profiles/web/node_modules/<包名>/ 里的文件后 /reload必须先删后写(unlink 再写新文件):pnpm 的文件是全局 store 的硬链接(实证两链接),原地覆盖会污染 store。

client 半边(浏览器那半)不归本插件管也不需要管:船载 client-hmr 对 bundle 文件做 500ms stat 轮询,内容一变自动推送。

原理(一句话)

/node_modules/<包名>/ 前缀清空 Node 内部 ESM loadCache(Map.prototype.delete 直调,应对 Node 24 槽语义)与 require.cache,然后对该包的每个 loader entry 做 _dispose()(disposer 逆序自动回收)+ refresh()(重新 import → 新代码 → fiber 挂回原 entry,配置树不脱钩)。清缓存后先预检 import,构建坏了就中止、旧插件继续跑。

边界

  • 拒绝 reload @deepseek-ai/* 共享框架包(类身份风险:RPC 类、调度 Symbol 跨副本断裂)与自身。升级这些 = 重启。
  • 目标插件的副作用必须全部经 ctx.effect/ctx.on/ctx.provide 注册(裸 webServer.register 会在 reload 时泄漏路由)。
  • disabled 的行保持不启(refresh() 语义)。
  • 两类插件均已实测:单文件纯 ESM 插件(dsh-session-topics,改代码 → reload → 生效 → 可回滚),以及多文件构建产物 + client 半边 + 持久状态的插件(dsh-memory-hermes,reload 后设置页面板 RPC 与 storage sidecar 均存活)。
  • reload 后模块级内存缓存(WeakMap 等)清零重建,属预期的缓存失效。

安装

npm pack
dsh plugin --profile web add dsh-hot-reload-<version>.tgz

已在运行的实例:往 $DSH_HOME/profiles/web/cordis.patch.yml 追加下面几行即热挂载(实证三实例零重启装载;与重启后 bundle 层自带的同 id 行幂等收敛):

- insert:
    - id: hot-reload
      name: dsh-hot-reload