DSH Plugins Marketplace

DSH Plugins

Plugins

/

Development & Infrastructure

/

dsh-resume-on-restart

n

dsh-resume-on-restart

Manifest valid★ 1

Auto-wakes the main agent after a DSH service restart: compares last-run timestamps, posts a recovery notice with humanized downtime, and delivers it so interrupted work picks itself back up. Runs on

hasBundlePatch

dsh-resume-on-restart

DSH 插件:检测 DSH 服务重启后,自动向主 agent 投递一条信息性消息(含中断时长、上次活跃会话等状态摘要),让 agent 自主决定是否继续之前的工作或启动新任务。

解决"DSH 重启后会话中断、工作丢失"的问题——重启后 agent 收到提示,可自行恢复。

特性

  • 🔄 重启检测:通过 marker 文件(记录上次 pid / 启动时间)判断是否发生重启
  • 💬 信息性消息:重启后投递"检测到重启 + 中断时长 + 上次活跃会话"摘要,由 agent 自主决定下一步(而非命令式强制"继续")
  • 🎯 活动追踪:运行期间通过 cordis 事件(agent/session-start、agent/pre-step)追踪最近活跃会话,供重启后参考
  • ✅ 兼容 DSH Desktop:只依赖 cordis ctx 的 agents 服务,不 import 任何 @deepseek-ai/dsh-* 内部包,可在 DSH Desktop 打包环境(app.asar)运行

安装

# 用 dsh CLI 装到桌面 profile(DSH Desktop 默认用 desktop)
dsh plugin --profile desktop add <本目录路径>
# 重启 DSH Desktop 生效

运行逻辑

每次 DSH 启动时:

  1. 读取 marker 文件(~/.dsh/.resume-on-restart/marker.json),记录上次的 pid / lastBootAt
  2. 判断是否重启:当前进程 pid ≠ marker 的 pid → 判定发生重启
  3. 写入新的 marker(更新为当前 pid / 时间)
  4. 若判定为重启,轮询等待主 agent 出现(最长 20 秒),投递信息性消息:
    [resume-on-restart] 检测到 DSH 服务已重启。
    上次运行于 ...,本次于 ... 重启完成。
    中断约 X 秒。
    重启前最近活跃的会话:<session-id>
    如需继续之前的工作,或启动新任务,请自主决定下一步。
    

运行期间通过 agent/session-start 和 agent/pre-step 事件持续记录最近活跃会话,下次重启时消息会包含它。

配置(cordis.patch.yml)

配置项默认说明
enabledtrue插件开关
stateDir.resume-on-restartmarker/状态文件存放目录(相对 DSH_HOME)
targetprimary唤醒目标(primary=主 agent,或指定会话 id)
wakeuptrue是否真正唤醒(false 则只注入不唤醒)
notice''附加到消息末尾的自定义提示
shutdownGraceMs600000关闭前"活跃即视为任务相关"的宽限窗口
ignoredSessionPrefixes['head-']不追踪的会话 id 前缀(如多代理团队的根会话)

开发 / 测试

# 运行单元测试(重启检测、消息构建)
npm test

测试覆盖 lib/detect.js 中的纯函数(重启判定、信息性消息构建),不依赖 DSH 运行时。

License

MIT

Compatibility

DSH 0.2.0-rc.2: failedDSH 0.2.1-alpha.1: failedDSH 0.2.1-alpha.2: failed

Versions

Latest versionPublishedSize
0.1.0——

Comments

Loading…

Similar plugins

dsh-smart-restart

by edusrez

Wakes the main agent after any DSH restart so interrupted work resumes automatically — adds a restart tool and an optional canary that validates the boot and warns instead of breaking.

Tools & CapabilitiesManifest valid

★ 8

↓ 184/wk

MIT

JavaScript

Sep 22, 2026

dsh plugin --profile web add dsh-smart-restart

by Harzva

Adds confirmed DSH restart actions and durable automatic continuation for eligible top-level sessions through an existing compatible dsh-restart Host provider.

Terminal & ClientsSessions & MessagesManifest valid

★ 0

MIT

JavaScript

Aug 29, 2026

dsh plugin --profile web add @harzva/dsh-restart-autoresume

by Eason-22

DeepSeek Harness plugin: restart without losing work, with an idle-aware graceful restart and automatic session resume after the host comes back. Built-in restart supports the Windows desktop app only

Sessions & MessagesManifest valid

★ 0

MIT

JavaScript

Oct 28, 2026

dsh plugin --profile web add dsh-autorestart

by flandre2233

Auto-resumes DSH turns interrupted by a host restart

Tools & CapabilitiesDevelopment & InfrastructureSessions & MessagesManifest valid

★ 1

↓ 352/wk

MIT

JavaScript

Sep 24, 2026

dsh plugin --profile web add dsh-recovery-resume

by jiang12345-code

DSH self-restart plugin (Windows): reliable elevated restart via schtasks, transparent front-end recovery, auto-detect and resume in-progress sessions across reboots, business gate prevents wake self-

Manifest valid

★ 0

MIT

JavaScript

Sep 3, 2026

dsh plugin --profile web add dsh-self-restart

by zhengjy01

One-click restart for DeepSeek Harness: a web button (plus a dsh_restart agent tool) hands the relaunch to a detached helper, the page reconnects by itself, and a recovery console shows the boot error

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 29, 2026

dsh plugin --profile web add @zhengjunyao/dsh-restart