stuarthu/dsh-hot-reload

Reloads an upgraded plugin inside the running dsh process instead of restarting it, and rolls back to the old version when a reload fails.

dsh-hot-reload closes the gap left by dsh's built-in cordis-plugin-hmr, which deliberately ignores node_modules: after dsh plugin add pkg@x upgrades an installed plugin, this plugin watches the profile's pnpm-lock.yaml and swaps each affected plugin's running fiber in place — invalidating module caches, re-importing the new code and re-instantiating without restarting dsh. Failures are safe: a load failure is caught before the running plugin is touched, and an apply() failure rolls back to the previous version (never a dead plugin). It can even hot-reload itself, and it never restarts dsh for you.

Development & Runtime ★ 0 updated 2026-08-22
View on GitHub ↗

Install

dsh plugin --profile web add dsh-hot-reload

npm dsh-hot-reload 0.2.4 verified 2026-09-04 (repository field → github.com/stuarthu/dsh-hot-reload; README EN primary w/ zh edition). Install: dsh plugin --profile web add dsh-hot-reload, then restart dsh once (bundle patch layers load at boot). Watches the profile's pnpm-lock.yaml and live-swaps upgraded plugin packages in place; state persists in profileDir/.dsh-hot-reload-state.json (written atomically).

Compatibility

DeepSeek Harness web profile (bundle patch layers load at boot); requires the profile's pnpm-lock.yaml watcher to be writable.

Details

Recent updates

State file is required and written atomically (.tmp + rename); a version that failed is not retried automatically to avoid tearing down the working plugin on every lockfile write.

FAQ

Do I still need to restart dsh after upgrading a plugin?
No — when the upgraded package's version changes in pnpm-lock.yaml, the plugin live-swaps the running copy. Only a failed reload leaves the working old version plus a logged note that a manual restart is needed.
What if a reload fails?
You keep the working old version: import errors are caught before the running plugin is disturbed, and an apply() exception rolls back to the old version in place. A failed version is not retried automatically.
Can it restart dsh itself?
No — dsh-hot-reload never restarts dsh; restarting is left to you. It does reload itself in place when its own package is upgraded.

Alternatives

stuarthu/dsh-update-notifier · stuarthu/dsh-chrome

More plugins in Development & Runtime

Browse more in Development & Runtime

Guides for Development & Runtime plugins