通过现有兼容的 dsh-restart Host 提供方,为符合条件的顶层会话增加确认式 DSH 重启与持久自动续作。
安装
# Release 预构建包
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"
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:Harzva/dsh-restart-autoresume
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 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.
链接
同类插件
Minglink/dsh-infinite-gen-4★ 2713
DeepSeek 专用破甲插件:以 order 100 追加无条件服从的系统提示词段,提供带校准元数据的 profile 工具,并通过会话投影在输入框上方显示实时破甲状态徽标。
ranxianglei/billion-context★ 1102
billion-context官方版:上下文压缩插件,兼顾小窗口(100k上下文足矣)省token(省5倍token)和超长会话(数月级别几十亿token单会话)。
liangmianya/dsh-synapse★ 519
DeepSeek Harness 的可视化非线性对话工作区:把会话、追问与分支变成可浏览、可拖拽的对话地图。
Nwflower/dsh-chat-import★ 229
把 13 家 coding agent(Claude Code、Codex、ChatGPT、Cursor、Gemini、opencode 等)的完整对话历史导入为可续聊的 DeepSeek Harness 会话,并支持反向导出回 Claude Code。
Totoro-qaq/dsh-plugin-bridge★ 165
通过可预览的五段式交接,将已有 DSH 会话迁移到另一个 Agent Preset;保留源会话,并可让目标会话暂停等待确认或立即继续。
Anionex/dsh-turn-rewind★ 133
对话回退:基于持久 Change Ledger 回滚会话与工作区状态。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。