dsh-autoupdater: Scheduled Updates for DSH and Plugins within Idle Windows

Introduction

When running DeepSeek Harness (DSH), the core and plugin versions change with npm releases. Manually running npm update on each package or monitoring changelogs is time-consuming and prone to restarting services while someone is actively using the Agent. The community has several “self-check upgrade” plugins with different focuses: some only care about the Harness core, others use session state to determine whether the system is busy — in practice, after a turn ends, agent.status may still remain running for a long time.

Below is an introduction to dsh-autoupdater (maintainer: niubi6668889595, SkillHub category: Workflow): it checks for updates to the DSH core and installed plugins at a configurable schedule, and only executes upgrades or staged notifications during idle windows determined to be “unused,” with a Web panel for configuration changes and activity log viewing.

What Is This

dsh-autoupdater is an automatic update plugin for DSH (npm package name dsh-autoupdater, version 0.6.0 in current documentation, MIT License). It solves two problems:

  1. When to check: Four scheduling modes to choose from (daily time / every N hours aligned to clock / every N days / every N minutes).
  2. When to act: After a scheduled task triggers, an idle threshold must also be met (session logs silent + no running Agents); manual “check now” only requires no running sessions at that moment.

The plugin embeds an Auto Update card within the Plugin Manager; configuration is written locally and hot-reloaded, taking effect without restarting the DSH process (if the core needs a restart, it is handled separately according to policy).

Directory page: https://www.skillhub.cn/plugins/niubi6668889595/dsh-autoupdater
Source code: https://github.com/niubi6668889595/dsh-autoupdater

SkillHub is a community plugin directory with no official affiliation with DeepSeek / HF (High-Flyer); please review the source code and license before installing. The plugin runs with the current DSH process’s user and permissions.

Core Features

Scheduled Checks

Four scheduleMode options:

  • daily: Triggers at dailyTime (default "04:30") every day.
  • everyHours: Every N hours, aligned to clock boundaries (default 6, range 1–168).
  • everyDays: Every N days, anchored to dailyTime (default 1, range 1–365).
  • everyMinutes: Every N minutes (default 60, range 1–10080).

Idle Threshold

The design borrows from the community project dsh-self-upgrade, using the mtime of files under $DSH_HOME/sessions to determine whether the system is working:

  1. Any session log no writes within 2 minutes, and no running Agent, is required before it is considered safe to update.
  2. For scheduled triggers, in addition to the trigger time, there must be continuous silence for idleSeconds seconds (default 300), using dual sampling to avoid misjudging transient idle periods.
  3. Manual “check now” from the panel: Only requires no running sessions at that moment, without waiting for additional silence.
  4. When detection fails, it conservatively treats the system as still busy, preferring to skip the update rather than interrupt usage.

Additionally, idleTimeoutMinutes (default 120) is configurable: the maximum time to wait for idle during a single check.

Batch Plugin Updates

Iterates over installed plugins and compares them with the latest versions on npm; when upgrading, it uses explicit package-name@version installation and reads back from disk to verify, avoiding “fake updates.”
Limitation: Only applies to npm-form plugins that declare dsh.bundle; plugins installed from GitHub source code are not version-compared.

Bidirectional Whitelist

Through the combination of pluginMode and whitelist (list of plugin package names), semantics include: whitelist only notify, others auto; or whitelist auto, others only notify; as well as fully auto, fully notify, off, etc. (default regexmode-ignore). See the README and panel for specific enumerations.

DSH Core Updates

harnessMode has three strategies (default notify):

  • off: Do not handle core updates.
  • notify: Stage and notify, do not auto-restart.
  • auto: After notification, auto-restart within a grace period of graceMinutes (default 30); any session activity during the grace period will postpone the restart.

After npm global installation completes, it verifies the existence of the dsh binary; if missing, it abandons the restart, reducing the risk of a bricked half-update. For core updates in git checkout form, the README recommends using dsh-updater instead.

Web Settings Panel and Activity Log

Configuration items can be modified in the Plugin Manager → Auto Update card, and take effect upon saving. Each check, update, and restart writes a readable record viewable in the panel; there is also ~/.dsh/autoupdater/history.jsonl on disk. The API only writes to local config.json and does not modify system-level configuration.

Security and Default Policy

  • Default harnessMode: notify; auto-restart requires explicitly changing to auto.
  • The panel does not provide an “ignore idle” switch.
  • Idle determination is based on the local machine’s $DSH_HOME/sessions; remote SSH sessions are not counted.

Installation and Enablement

Environment requirements: Node >= 20 (see engines in package.json).

Install from npm (from the original README):

dsh plugin --profile web add dsh-autoupdater

Or from GitHub (replace <owner> with the repository owner; the original README uses placeholder form):

dsh plugin --profile web add github:<owner>/dsh-autoupdater

After installation, restart DSH. If using systemd, for example:

sudo systemctl restart <your-dsh-service-name>

Then complete configuration in the Plugin Manager → Auto Update card.

Configuration Highlights

Initial default values come from cordis.patch.yml; the panel can override them and they take effect hot. Common fields are as follows:

Field Default Description
scheduleMode daily daily / everyHours / everyDays / everyMinutes
dailyTime "04:30" Anchor time for daily / every-N-days modes
everyHours 6 Every N hours (aligned to clock, 1–168)
everyDays 1 Every N days (anchored to dailyTime, 1–365)
everyMinutes 60 Every N minutes (1–10080)
idleSeconds 300 Seconds of continuous silence required to determine unused
idleTimeoutMinutes 120 Maximum time to wait for idle per check
harnessMode notify off / notify / auto
graceMinutes 30 Grace minutes after notification in auto mode
systemdUnit "" systemd service name for restart; empty means try auto-detection from cgroup
pluginMode regexmode-ignore Combination policy for whitelist and auto/notify
whitelist [] List of plugin package names; meaning depends on pluginMode

Typical Usage

  1. Daily maintenance: scheduleMode: daily, set dailyTime to business low-peak hours; harnessMode: notify, view notifications first before deciding whether to switch to auto.
  2. Plugins fully auto, individual packages only notify: Fill in package names in whitelist, set pluginMode to “whitelist only notify, others auto” or the reverse semantics (see panel/README enumerations).
  3. Core auto-restart: Configure systemdUnit or rely on auto-detection; the deployment user needs to configure passwordless sudoers for systemctl restart, for example:
youruser ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart your-dsh-service

If passwordless is not configured, sudo will fail, the log will record it, and the plugin will not repeatedly retry. If systemd is not detected, it will fall back to launching a detached child process using the original argv.

  1. Urgent check: Use “Check Now” in the panel — it can execute as long as there are no running sessions at the moment, without waiting for idleSeconds.

Use Cases and Notes

Suitable for: Deployments running DSH Web form long-term, with plugins installed as npm packages, wanting scheduled alignment with upstream versions without interrupting ongoing Agent sessions.

Notes:

  • Plugin updates do not cover plugins installed from GitHub source code; core updates depend on npm global installation form.
  • Restart and npm operations depend on host permissions and sudo policy; read through the repository source code before installing in production.
  • The design also references ideas from community projects such as dsh-updater and dsh-auto-update, which can be compared and selected as needed.

Conclusion

dsh-autoupdater separates “when to check for updates” from “when to actually modify disk/restart”: scheduling is configurable, execution is constrained by idle thresholds, the core defaults to notification only, plugins support bidirectional whitelist semantics, and configuration and log viewing are completed in the panel. If you are browsing workflow-type plugins on SkillHub, you can enter the details from the directory page, or directly open the GitHub README to verify installation commands and configuration tables.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye