DSH Plugins Marketplace

DSH Plugins

Plugins

/

Development & Infrastructure

/

dsh-single-instance-guard

T

dsh-single-instance-guard

Manifest valid

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)

hasBundlePatch

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:

history unavailable for session "…": Error: corrupt session log: seq gap in committed region …

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:

dsh plugin --profile <profile> add dsh-single-instance-guard

Manual (any dsh install): add the row to the profile's cordis.patch.yml before session-related bundles:

- insert:
    - id: single-instance-guard
      name: 'dsh-single-instance-guard'

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_HOME>/.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 once.
  3. On process exit the lock is removed — only if still owned by this process.

DSH_HOME is resolved exactly like dsh itself: $DSH_HOME or ~/.dsh. Servers with different data roots never conflict.

Known limits

  • The unlink+retry path has a tiny race when two processes discover the same stale lock simultaneously; the atomic O_EXCL write still admits exactly one winner, and the loser fails correctly on the retry.
  • The lock protects against concurrent servers sharing one DSH_HOME. It does not protect against two dsh instances deliberately pointed at the same session file via different roots (unsupported anyway).

Development

npm test   # node --test

License

MIT

Comments

Loading…

Similar plugins

dsh-plugin-precheck

by BaqiF2

该仓库暂未提供项目说明。

Security & AuditDevelopment & InfrastructureTerminal & ClientsManifest valid

★ 1

↓ 217/wk

MIT

JavaScript

Oct 4, 2026

dsh plugin --profile web add dsh-plugin-precheck

by jwilson411

DeepSeek Harness plugin: fail-closed URL host/scheme allowlist that runs before a request is opened

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 21, 2026

dsh plugin --profile web add dsh-ssrf-guard

by deepseekv41flash

DeepSeek Harness plugin: makes a reverse-proxied (non-loopback) dsh web page count as a trusted host, so the Settings surface loads instead of reporting "settings are unavailable in this browser".

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 4

↓ 79/wk

MIT

JavaScript

Oct 8, 2026

dsh plugin --profile web add dsh-remote-trust

by NamesMT

DeepSeek Harness (dsh) plugin: start your dsh web server automatically at boot, and manage home-hosted's panel and servers from inside dsh.

Development & InfrastructureManifest valid

★ 1

MIT

TypeScript

Oct 25, 2026

dsh plugin --profile web add dsh-home-hosted

by taxueseek

Static-only plugin gate and clinic for DSH: audit before install, hash-and-capability lock after install, local fingerprint peer search over GitHub topic:dsh-plugin, and mechanical detox. Never execut

Security & AuditDevelopment & InfrastructureManifest valid

★ 2

↓ 128/wk

MIT

TypeScript

Aug 23, 2026

dsh plugin --profile web add dsh-plugin-guard

by n8guru

DSH hook plugin: a session may not stop the harness it runs inside

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Sep 2, 2026

dsh plugin --profile web add dsh-self-preserve