Tang-mm95/dsh-single-instance-guard

Tang-mm95★ 0JavaScript最后同步: 2026-08-16

在 GitHub 打开

DSH_HOME single-instance lock plugin for DeepSeek Harness: aborts startup loudly when another dsh server uses the same data directory (prevents session-log corruption)

README 摘要

dsh-single-instance-guard A zero-dependency DeepSeek Harness plugin that takes an exclusive lock on the DSH HOME data directory at startup and aborts loudly when another live dsh server already uses it. 中文说明 Why The JSONL session persistence backend documents "One live writer per session" and has no cross-process defense. Two dsh servers sharing one DSH HOME (a desktop wrapper spawning its own server, or two dsh web processes) append batches with stale sequence cursors, corrupting session logs: See this report for the full diagnosis, a read-only scanner, and a manual repair procedure. This plugin turns the silent corruption into a loud startup failure. Install After publishing to npm: Manual (any dsh install): add the row to the profile's cordis.patch.yml before session-related bundles: The guard is a profile bundle: its manifest declares the same patch, so the CLI installs it as a patch layer. How it works 1. Creates /.dsh-server.lock atomically ( O EXCL ), holding { pid, startedAt, hostname } . 2. On conflict, probes the holder's pid liveness: a live holder aborts startup with a clear bilingual error; a stale lock (dead pid or unparsable file) is removed and acquisition retried o…

在 GitHub 查看完整 README →
工具/开发deepseek-harnessdshdsh-plugin

分类