dsh-sync: Syncing DSH Sessions and Configurations Across Multiple Machines with rclone Bisync

Preface

DeepSeek Harness (DSH) keeps the development environment, session records, and profile configurations under the user’s home directory at ~/.dsh. When switching machines or moving between home and office, relying only on USB copies or manual rsync can miss incremental sessions, and it also sidesteps rclone bisync filters, the ordering of the initial --resync seed, and interactive rclone config. The community plugin dsh-sync (maintainer Rosa42, category: workflow) adds a Settings → Sync page in DSH, synchronizing the DSH home directory from one machine to others with configurable sync scopes, using bidirectional sync over any rclone remote.

Below we describe what it does, how to install it, and the edge cases to be aware of before use.

What This Is

dsh-sync is an ordinary bundle plugin for DeepSeek Harness: it provides a sync UI in settings and performs rclone bisync bidirectional synchronization between the local DSH home directory (default ~/.dsh, overridable via $DSH_HOME) and a remote or local mirror directory, covering session logs and profile-related configuration. Which slices to sync, exclude rules, comparison method, and conflict handling are configurable on the page. The plugin also wraps non-interactive WebDAV remote creation (including a nutstore preset) and can run a connection self-test before the real seed sync.

The DSH ecosystem emphasizes “everything is a plugin”; community directories such as SkillHub are independent sites and have no official affiliation with DeepSeek / 幻方. Before installing third-party bundles, review the source and license yourself; the plugin runs with the permissions of the current dsh web process and will read and write settings and logs under ~/.dsh and the plugin’s working directory.

What the Page Can Do

The README organizes the UI into the following areas for easy reference:

Area Role
Current state Whether rclone is available, resolved local and working directories, generated rule file, last run, number of conflict copies
Sync target Choose a cloud remote from rclone listremotes plus a subpath, or specify an absolute local folder already synced by a cloud client
Connection self-test Before seed sync, check reachability, writability, and whether content and modification times are trustworthy
Sync scope Toggle slices to decide what to sync; add excludes, comparison mode, conflict policy, delete cap
Configure cloud storage Non-interactively create a WebDAV remote (including a nutstore preset)
Actions Preview (--dry-run), sync now, first-time seed (--resync)
Run output Full rclone output, also appended to logs/ui-<date>.log
Conflict copies Lists remaining *.conflictN for manual merging

Why the Connection Self-Test Matters

Before the first --resync, and after switching remotes, you should run the connection self-test first. The flow is: upload a temporary file via the configured remote, read back its metadata, then delete it; credentials stay only in rclone’s own configuration.

bisync compares using size,modtime with the previous listing by default. If the remote rewrites modification times to upload time, both sides will be considered changed every time, files will be transferred repeatedly, and conflict copies will pile up. The self-test probes modtime with a file pinned to a fixed past time; if the remote rewrites times, the result will explain the situation and suggest switching to size comparison—this choice should be deliberate: size cannot detect edits where “length stays the same but content has changed.”

Sync Targets: Cloud Remotes and “Local Mirror + Cloud Client”

Cloud remote: On the page, select a target from rclone listremotes with a subpath (in the example config, nutstore:dsh).

Local folder: Set Target type to Local folder, pointing to a directory already synced by the cloud provider’s desktop client. The data flow is:

~/.dsh  ──rclone bisync──▶  <mirror folder>  ──provider client──▶  cloud

Filters, conflict copies, preview, delete cap, and self-test logic are unchanged; the self-test runs against this folder. The README notes this is more suitable for cloud drives that rclone cannot directly connect to (such as Baidu Netdisk, Quark Cloud Drive), avoiding reverse-engineered WebDAV bridges, cookies, and write-permission issues. The cost is that bisync and the client are two layers in series, so failures need to be distinguished; cloud-side conflicts are decided by the client; if the client stamps downloads with “now”, bisync may take an extra pass with identical content, but when both sides are local file systems it usually stabilizes.

Why not point DSH_HOME directly at a cloud-synced directory: storages/, workspace.json, .credentials.yaml, session.lock, and append-only session logs are not suitable to be naively shared with consumer sync clients; going through a bisync mirror lets you apply safety rules like filters and delete caps before data enters the cloud client.

Installation and Enablement

The plugin is an ordinary DSH bundle: place the author’s directory or an extracted copy anywhere on disk, then install it into a profile:

plugin_manager install_bundle  target: <absolute path to this directory>

Installation links the directory and enables the bundle. You must restart the dsh web service afterwards: the Cordis loader caches module paths resolved from entries, so if you replace or move the plugin without restarting, the old JavaScript modules may still run.

rclone Visibility on Windows

The plugin executes rclone; if not found it reports not installed. On Windows, relying only on PATH may not be enough: processes started before a winget install, or new terminals opened from a long-running explorer.exe, may lack the WinGet command-shim directory. The plugin checks PATH in-process first, then tries %LOCALAPPDATA%\Microsoft\WinGet\Links; the status card shows the finally resolved executable path.

Configuration Notes

Settings are written by the page to <workDir>/settings.json. Example structure (fields per the README):

{
  "version": 1,
  "target": "nutstore:dsh",
  "sync": {
    "sessions": true,
    "attachments": true,
    "profiles": true,
    "homeConfig": true,
    "credentials": false,
    "workspaceState": false,
    "providerCache": false,
    "pluginModules": false
  },
  "extraExcludes": [],
  "compare": "size,modtime",
  "conflictResolve": "none",
  "maxDelete": 10
}

The config line in the loader needs known paths before the settings file is found:

- id: dsh-sync
  name: '@local/dsh-sync'
  config:
    localRoot: /home/me/.dsh   # default: $DSH_HOME, then ~/.dsh
    workDir: /home/me/.dsh-sync # default: ~/.dsh-sync

If the bundle is installed outside a profile, it cannot resolve the Config schema exported by @deepseek-ai/schemastery that the harness expects, so it uses a settings file plus page editing; deployments installed inside a profile can switch to a schema without changing the route contract.

Each sync-scope key maps to rclone filters: when a slice is disabled, a corresponding exclude rule is generated. Defaults enable sessions, attachments, profiles, homeConfig; credentials, workspaceState, etc. are off by default, consistent with the design of “don’t share plaintext API keys, don’t share workspace state that could overwrite each other across machines.”

Typical Usage

  1. Install the bundle and restart dsh web.
  2. In Settings → Sync, configure localRoot / workDir (if different from defaults), choose a cloud remote or a local mirror directory; use the page wizard to create WebDAV if needed (including a nutstore preset).
  3. Run Connection self-test; if modtime is unreliable, evaluate switching to size comparison per the page’s suggestion.
  4. Adjust Sync scope and extraExcludes, maxDelete, etc. as needed.
  5. For first use, run first-time seed (--resync); for daily use, run Preview (--dry-run) to see changes, then Sync now.
  6. If *.conflictN appears, locate them in the page’s Conflict copies and merge manually.

For development and regression testing, run in the plugin directory:

npm test   # includes both probe suites

Suitable Scenarios and Caveats

Suitable for: Multiple machines sharing the same set of DSH sessions and profile configurations; you already have an rclone remote or are willing to use a local mirror with the official cloud client; you want bisync filters, delete caps, and conflict-copy mechanisms instead of dumping the entire ~/.dsh into a sync drive.

Notes: The plugin depends on rclone being installed locally and findable by the process; bidirectional sync carries risks of conflicts and accidental deletion—always dry-run first and understand maxDelete. The plugin reads and writes the home directory and working directory with the dsh process’s permissions; read the source under the MIT license before installing. Community directory statistics such as star counts are as shown on the site (0 at fetch time).

Conclusion

dsh-sync brings multi-machine DSH home synchronization into the settings page: configurable sync scopes, guided WebDAV setup, connection self-test, and common bisync operations, reducing the burden of hand-writing rclone configs and remembering the --resync order. See SkillHub directory page and GitHub repo for details and updates.

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

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

Xiaoye