Adds confirmed DSH restart actions and durable automatic continuation for eligible top-level sessions through an existing compatible dsh-restart Host provider.
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/Harzva/dsh-restart-autoresume/releases/download/v0.1.0-alpha.1/harzva-dsh-restart-autoresume-0.1.0-alpha.1.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Harzva/dsh-restart-autoresume
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
@harzva/dsh-restart-autoresume adds a controlled Restart & resume running tasks flow to DeepSeek Harness (DSH). It records ordinary top-level sessions, flushes their durable state, delegates the actual restart to the existing dsh-restart Host service, and safely submits one auditable continuation turn per eligible intent after the new Host starts.
This public alpha targets DSH 0.1.1-rc.2, Cordis 4.0.1, and Node.js 22+. It is distributed through GitHub Releases and is not installed in a production profile by the release process.
Screenshots
Existing DSH restart service is available
One ordinary top-level task is captured
The original session continues after restart
Resume Ledger settles the intent
The screenshots come from a disposable local Web profile. They contain no credentials or machine-private paths and are repository documentation assets, not runtime dependencies.
What it provides
- one additive Host loader row and one Client sidebar Slot;
- Restart & resume running tasks and Restart only actions with explicit confirmation;
- existing
dsh-restartHost-service capability checks that fail closed; - Session flush before ledger commit and accepted restart acknowledgement before the delayed native restart request;
- a private, schema-versioned Resume Ledger with serialized atomic updates, corruption isolation, expiry, capacity cleanup, and
0600files; - startup recovery with stable intent/RPC provenance, leases, bounded concurrency, retry ceiling, and manual retry;
- live and cold Session evidence checks before dispatch and after durable persistence;
- automatic crash recovery only for registered, interrupted, ordinary top-level sessions;
- fiber-owned Agent listeners, startup work, timers, Remote service, Slot registration, styles, and cleanup.
User-stopped, completed, blocked, max-token, errored, and subagent sessions are excluded. A resumed turn is a new visible continuation request; it is not process-level checkpoint restoration.
Deployment contract
This package deliberately does not implement another DSH restart mechanism. The target profile must already mount dsh-restart@0.3.1 or another compatible provider of this small Host contract:
{
provider: 'dsh-restart',
requestRestart: () => Promise<void>
}
dsh-restart remains the sole owner of closing and reopening DSH. This package owns only the durable recovery orchestration around that action. If dshRestartRuntime is absent or malformed, restart requests return RESTART_RUNTIME_UNAVAILABLE before candidates are captured or Ledger state is written. No launchd/systemd/macOS helper configuration is accepted by this package.
Installation
Install only into a disposable or explicitly approved profile:
dsh plugin --profile web add https://github.com/Harzva/dsh-restart-autoresume/releases/download/v0.1.0-alpha.1/harzva-dsh-restart-autoresume-0.1.0-alpha.1.tgz --ignore-scripts
The compatible dsh-restart@0.3.1 provider is a prerequisite and must be installed and mounted first. Do not substitute the unrelated public npm package currently using the unscoped dsh-restart name unless it explicitly implements the dshRestartRuntime contract above.
The bundle contributes exactly one row, dsh-restart-autoresume. Configure that row in the profile patch layer; an id-targeted patch replaces the whole config, so restate every non-default field you need:
- id: dsh-restart-autoresume
config:
autoResumeCrash: true
maxAttempts: 3
claimTtlMs: 30000
intentTtlMs: 86400000
recoveryConcurrency: 1
startupSettleMs: 1000
restartDelayMs: 250
The dsh-restart bundle must be mounted in the same Host realm. Service lookup is live, so stopping or unloading the provider immediately disables the restart actions without affecting DSH startup or Ledger inspection.
Disable and rollback
The single loader row is the immediate recovery boundary. Keep the package installed but disable all Host and Client behavior with:
- id: dsh-restart-autoresume
disabled: true
Restart the profile and confirm stock DSH starts without the sidebar action. To remove the package dependency as well:
dsh plugin --profile web remove @harzva/dsh-restart-autoresume
The Resume Ledger contains only safe routing/status metadata. Disabling or removing the loader does not modify DSH Session history.
Safety semantics
- Operator restart snapshots only ordinary running roots, flushes each Session, atomically records one restart generation, acknowledges the request, and then calls the existing
dshRestartRuntimethrough a Cordis-owned timer. - Existing armed crash markers for the same sessions are atomically superseded by the operator generation, preventing duplicate recovery races.
- Crash recovery uses only valid plugin-owned intents and requires the durable Session boundary to be
interrupted. - Each intent uses
dsh-restart-autoresume:<intentId>as stable RPC provenance. Durable inbox and user-message evidence is checked before any redispatch. - The continuation prompt tells the Agent to inspect unknown external outcomes before retrying. The plugin does not promise exactly-once behavior for arbitrary tools or external systems.
- Automatic attempts are bounded. A terminal failed intent can be explicitly rearmed from the Client while retaining the same intent id and deduplication provenance.
Development verification
pnpm install --ignore-scripts
pnpm check
pnpm run pack:dsh
pnpm run verify:dsh-offline
The final isolated validation includes real Web loading, Client Remote activation, a closed-loop restart through the existing dsh-restart Host service, durable continuation of one running ordinary top-level task, prior no-task/single-task/multi-task and SIGKILL recovery drills, tool-result-unknown boundaries, user-stop protection, retry ceiling/manual retry, disconnect/reconnect, responsive light/dark UI, and disable-only stock cold start. See docs/05-验收报告.md for the evidence matrix and known limits.
Known limits
- The supported baseline is DSH
0.1.1-rc.2; other DSH release candidates require a fresh contract and runtime validation. - The first release never restores subagents directly. Their parent top-level Session may coordinate new subagents after recovery.
- DSH's atomic-write contract provides locked same-directory replacement but does not claim full directory-
fsyncdurability against sudden power loss. - An orphaned ledger lock is an operator remediation item after confirming that no writer is alive.
- The disposable Phase 6 process relaunch harness is test infrastructure used for crash/reconnect drills; it is not a production dependency or a second shipped restart implementation.
Links
More in this category
liangmianya/dsh-synapse★ 264
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
Totoro-qaq/dsh-plugin-bridge★ 163
Moves an existing DSH session to another agent preset through a previewable five-section handoff, preserving the source session and either pausing the target for confirmation or continuing immediately.
Nwflower/dsh-chat-import★ 125
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
Anionex/dsh-turn-rewind★ 106
Rewind conversation and workspace state, powered by a persistent Change Ledger.
Renzic-Stone/DSH-EasyRewrite★ 98
Inline-edit and recall your own user messages in dsh web — lazily and seamlessly, with a version pager and per-session draft persistence.
lamost423/dsh-trace-compare★ 60
Trace Compare & Live Maze: draw the agent's real exploration — main path, failed or dead-end detours, backtracks, and subagent branches — on one wall-clock timeline; upload 1–2 session logs for a same-axis compare, or watch it grow live in a session tab.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.