Introduction¶
DeepSeek Harness (DSH) frequently releases multiple versions (such as 0.1.x-rc.x), and dsh itself does not have self-update capability. After installing a new version, users must manually restart it, and the restart command must exactly match the original startup command (the port, configuration file, working directory, and Node path may have changed). In addition, multiple DSH installations may exist on a single machine; the directory pointed to by npm config get prefix, the first directory in PATH, and the directory resolved from process.argv[1] may differ from one another, causing a simple npm i -g to update the wrong target.
What It Is¶
dsh-updater is a workflow plugin maintained by zhengjy01. It tracks DSH versions through npm dist-tags (latest / next / alpha) and GitHub releases (tags dsh-v*), displays the full changelog and risk report between the currently running version and the target version, and achieves automatic rollback via atomic rename backups.
Core Features¶
Version Tracking and Checking¶
The plugin supports selecting one of three channels via the channel parameter (latest, next, or alpha). Background checks are performed by setting checkIntervalMinutes (default 180 minutes; set to 0 to disable) and checkOnBoot (check 8 seconds after startup), keeping the cache active. Upstream failures (for example, inability to connect to GitHub or npm) do not cause an update failure; instead, cached data is used and a warning is displayed. If no update is available in the current channel, it will automatically look for a pre-release version in the same channel or a higher version. The panel displays newerElsewhere to confirm whether a newer version exists in another channel.
Change Display¶
Displays the available version on npm and the changes published on GitHub. It shows the changes for each version in the (current, target] interval, extracting the title from the GitHub release notes for each version. The content is bilingual (Chinese preferred); if a version exists on npm but has no corresponding GitHub release, it is marked as notesMissing.
One-Click Update¶
Update operations are triggered via the DSH-update settings card, sidebar entry, or the dsh_update tool. The update process is executed independently by helper/update-helper.mjs:
1. Writes pending-spec.json and starts a helper process.
2. Waits for the old process to release the port (using SIGKILL if necessary).
3. Uses the mv command to rename the current installation directory into a backup (atomic operation).
4. Runs npm install to install the specified version.
5. Verifies the installation result (checks the package.json version, entry script, and node_modules).
6. Restarts the process using exactly the same parameters as at startup (process.execArgv, argv[1:], working directory).
7. If the new version fails to start, it automatically renames the backup directory back to its original location and restarts the old version.
Update Risk Report¶
Generates risk levels (high / warn / info) based on the version number, installation topology, plugin contract, etc. The checks include: pre-release versions, breaking-change keywords, version span (>=2 minor versions or a major version), missing release notes, and plugin compatibility.
Typical Usage¶
- Trigger an update from the settings card or sidebar.
- Select the update channel (
latest,next, oralpha). - Set
checkIntervalMinutesto enable scheduled checks. - Check
newerElsewherein the panel to determine whether a new version is available.
Notes¶
- DSH has no self-update mechanism; a manual restart is required after updating.
- The plugin only updates the currently running DSH instance; multiple installations on a single machine do not affect each other.
- npm versions and GitHub releases may be out of sync; the plugin handles this automatically.
- Unauthenticated GitHub requests are limited to 60 times/hour; using
githubTokencan increase the limit. - Updates use atomic renames (
mv) for backup instead of copying files. - Restarting requires exact command parameters (port, configuration file, working directory, etc.).
Installation¶
Plugin repository: https://github.com/zhengjy01/dsh-updater