Introduction

In the DSH Web profile, there are two common continuity issues: after a turn is interrupted, empty submits are not recognized as a continuation; sessions and sub-agents marked as running at shutdown are also not automatically recovered after the process shuts down.

Upstream DSH provides resumeSessionId, interrupted-turn closers, checkpoints, and session persistence, but the behavior for empty-submit continuation and restoring sessions/sub-agents based on the shutdown set is incomplete. Below, I introduce dsh-resume.

What is this

dsh-resume is a DSH plugin maintained by xiaohj233, licensed under MIT. The current installation example uses version v0.2.1, status Feature Plugin with Compatibility Patch, tested against DeepSeek Harness 0.1.0-rc.6.

It mainly solves two things:

  • Interrupted DSH conversations can be continued via empty submits.
  • Sessions and sub-agents recorded as running during DSH process shutdown can be recovered upon the next start-up.

Core Features

Empty Submit Continuation

  • When a turn is interrupted, fold the received partial text and reasoning into the session history.
  • Supports continuing interrupted DSH conversations via empty submit without adding a visible “continue” message.
  • Uses the official agents.resume service, with partial-turn folding and empty-submit handling added via a compatibility patch.

Recovery after Shutdown

  • Record the active status of sessions and sub-agents to ~/.dsh/resume-state.json.
  • Only restore sessions and sub-agents recorded as running at shutdown; completed or user-aborted turns are not restored.
  • Successfully recovered sessions are atomically written and removed from the persistence set immediately; failed recovery keeps the record and retries on the next start-up.
  • Automatically retry recorded sub-agents on start-up; failed entries can be handled using resume_interrupted_subagents.
  • Recovery diagnostics are written to ~/.dsh/resume-state.log.

Compatibility Patch and Version Strategy

Compatibility patch targets include:

@deepseek-ai/dsh-agent-loop@0.1.0-rc.6
@deepseek-ai/dsh-session@0.1.0-rc.6
@deepseek-ai/dsh-client-ui-conversation@0.1.0-rc.6

Patch target hunks are idempotent and have explicit reverse operations. The adaptive version strategy is used by default; the programmatic strict option can restore exact-version-only apply behavior.

Installation and Enablement

First, add the plugin:

dsh plugin --profile web add "github:xiaohj233/dsh-resume#v0.2.1"

Restart the Web profile after installation.

If you need to override configuration, you can adjust the dsh-resume line in the profile patch:

- id: dsh-resume
  config:
    enabled: true
    restoreDelayMs: 2000

Uninstallation and Upstream Upgrade

Before uninstalling, restore the official package files, then remove the plugin:

pnpm --dir "$DSH_HOME/profiles/web" exec dsh-resume-restore
dsh plugin --profile web remove dsh-resume

After upgrading upstream, run dsh-resume-restore and verify:anchors once to confirm that each hunk was applied or intentionally skipped.

Test commands:

npm test
npm run check
npm pack --dry-run

Compatibility

  • Node.js: ^22.19.0 || >=24
  • pnpm: >=10

Use Cases and Notes

Suitable for users encountering the following situations in the DSH Web profile:

  • Want interrupted conversations to continue via empty submit.
  • Want to recover sessions and sub-agents marked as running at shutdown after process restart.
  • Want to keep recovery diagnostic logs instead of relying solely on upstream session persistence.

The plugin runs with the current DSH process permissions; you should check the source code, dependencies, and license before installing.

resume-state.json and resume-state.log contain session/subagent identifiers, model, recovery diagnostics, and failure messages; they do not intentionally store credential values but should be treated as private runtime data. Automatic recovery may initiate new model requests and generate provider usage.

The plugin does not handle the following:

  • Does not import sessions from other agents.
  • Does not rewind arbitrary turns.
  • Does not migrate workspaces.
  • Does not guarantee that remote providers can byte-for-byte reproduce interrupted streams.
  • Does not fix all upstream session-log races.

Upstream DSH Discussion #420 records a race that dsh-resume does not claim to eliminate.

Conclusion

If your primary need is to recover interrupted DSH turns and recover sessions and sub-agents marked as running at shutdown after process restart, dsh-resume can serve as a continuity patch for the DSH Web profile.

Repository URL: https://github.com/xiaohj233/dsh-resume