Resumes turns interrupted by a DSH host restart: hooks agent activation (once a session is live), reads the crash-repair turn/end, and sends a continuation that requires verifying real-world state first rather than assuming a side effect succeeded or failed. Permanent failures (AUTH, QUOTA, context overflow) are skipped, with a cross-restart budget, adaptive backoff and a minimal-context payload.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-recovery-resume
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/flandre2233/dsh-recovery-resume/releases/download/v0.1.3/dsh-recovery-resume-0.1.3.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:flandre2233/dsh-recovery-resume
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
A plugin for DeepSeek Harness (dsh):
when DSH restarts, it picks up the task that got cut off and finishes it.
中文 | English
The problem
You ask the agent to do something, and halfway through DSH restarts (a crash, an upgrade, or a manual restart). Your session comes back, but the interrupted task does not continue on its own — nothing happens until you send another message.
With this plugin installed, DSH sends that message for you after the restart.
The message is not just "continue". A restart can land in the middle of a download or a push, so the message asks the agent to check how far it actually got first, then carry on from the right place — without assuming the last step succeeded, or that it failed.
Install
dsh plugin --profile web add github:flandre2233/dsh-recovery-resume
Then restart DSH once so the plugin is loaded.
No dependencies to install, nothing to build.
When it resumes
Only when all of these are true — otherwise it does nothing:
- the last task was cut off (interrupted, errored, or hit the output limit) rather than finishing normally
- you haven't sent a new message or started a new task since
- the interruption happened within the last 15 minutes
- the session has been opened again
It does not resume when retrying can't help — an invalid API key, no balance left, or a conversation that has grown past the context limit. Retrying those only costs money. Which errors count as worth retrying comes from DSH's own official list.
If the session has an active goal, the plugin also lets it keep going — the same as pressing "continue" in the UI. Goals you paused yourself are never touched.
Runaway protection
The thing to avoid is "restart → resume → crash → restart → resume…" burning money forever. There are three safeguards:
| Safeguard | Rule |
|---|---|
| 1 | at most one resume per session each time DSH starts |
| 2 | after 3 resumes in a row with no progress, it stops and waits for you (tracked in $DSH_HOME/recovery-attempts.json, so restarts don't reset it) |
| 3 | a wait between resumes: 10 minutes after the first, 20 minutes after the second |
As soon as a resume actually moves the task forward, these counters reset — the safeguards only kick in on repeated failure. When a limit is hit, the plugin just logs it.
Checking it works
Is the plugin loaded?
dsh --profile web --dump-config | grep -A2 recovery-resume
The plugin logs to the terminal running dsh web. If you start DSH through a launcher
(such as a desktop app), the log is wherever that launcher saves it — commonly
~/.dsh/host.log. That file is created by the launcher, not by DSH, and won't exist if you
run DSH by hand.
grep dsh-recovery-resume ~/.dsh/host.log # if your launcher writes one
A resume looks like this:
dsh-recovery-resume: agent 创建 id=session-… status=idle
dsh-recovery-resume: ★ 发现未处理的中断(reason=interrupted turnSeq=8451 lastTool=bash)
dsh-recovery-resume: 续跑消息已入队 session-…
dsh-recovery-resume: 已重新武装 goal …
Most of the time nothing happens, and that's normal. The Chinese README lists the other log lines and what each one means.
Tests
npm test # 85 cases, no dependencies, DSH does not need to be running
You can also run a single file, e.g. node tests/logic.test.mjs (works on Windows too).
Limitations
- Only verified on DSH
0.1.6-alpha.1with macOS 13 (Intel). The plugin relies on DSH internals, so re-run the tests after upgrading DSH. - The 15-minute window is fixed and can't be configured yet.
- It doesn't check whether the task was actually finished just before the restart. If it was, the agent spends one extra round checking — expected, since the message asks it to.
- Subagent sessions are skipped.
Design notes, DSH source references and real-world test records are in docs/notes.md (Chinese).
License
MIT — see LICENSE.
Links
More in this category
ranxianglei/billion-context★ 5262
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Minglink/dsh-infinite-gen-4★ 4041
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 688
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
MichengAI/dsh-archive-manager★ 318
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 294
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.
SiriLee/dsh-rewind★ 246
Conversation rewind: one click back to any earlier user message, in the same window — no new branch, no leftover copy; the target message is refilled into the composer, with optional workspace-file restore — the full Claude Code /rewind semantics.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.