
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-self-restart
Advanced tools
DSH 自助重启:把「提权计划任务强杀进程树→端口释放确认→拉起服务」固化为插件能力;agent 或本机脚本一键调度重启,前端断线自动探测、服务恢复后自动刷新页面——让重启对用户近乎无感。v0.3.0 零登记自动发现:重启前扫描进行中任务写入账本,重启后错峰自动续跑。v0.3.4 业务门防自激:会话最后一次业务输入晚于其上次自动唤醒才登记,终结「已完成任务被反复唤醒自检」的连环空转。loopback 围栏防远程误触。
DSH 自助重启插件:把「提权强杀进程树 → 端口释放确认 → 拉起服务 → 存活探测」固化为随时可调用的能力,并让前端自动恢复——用户几乎感受不到重启的存在。
DSH 的 host 跑在进程内,改插件/改配置后必须重启进程。而 DSH 进程往往运行在提权上下文,普通权限的 Stop-Process 杀不掉它且会静默失败。2026-08-26 实战验证的唯一可靠路径:
schtasks /create /rl HIGHEST 注册一次性计划任务(提权上下文由系统提供)taskkill /F /T /PID 树杀端口监听进程Start-ScheduledTask dsh-web-service 拉起服务本插件把这条链路参数化、自动化。
自动发现(log-active 信号)存在自激环:checkpoint 唤醒后的自检回复本身会写会话日志刷新 mtime,且旧去重只看 pending 队列(已 resumed 的任务脱离视野)→ 同一会话在活跃窗口内被连环登记、连环唤醒自检(实证:单会话 15 分钟内三连发,其余会话同批空转)。纯浪费 token 与用户注意力。
修复 = 登记判据从「日志新鲜」升级为「上次自动唤醒之后有新的业务输入」:
latestBusinessInputMs(logPath):逐帧解压会话 zstd 日志,从尾部取最后一条业务 user/message 的时间戳。排除一切系统自注入:本插件唤醒消息(source.plugin==='dsh-self-restart')、每 turn 伴随指令注入(form==='instructions',如 dsh-mnemon reminder)、运行时上下文快照与 checkpoint 摘要(固定文本前缀)。autoWakeWatermark():账本里各会话 auto-scan 任务的最近 resumedAt 水位线。wake >= biz → 丢弃(活跃是自检刷的,任务早已闭环);日志不可读 / 软 Deadline(6s)超时 → 保守放行(宁可误醒一次,不可漏掉真中断)。config.json 置 "verifyBusinessActivity": false 恢复 v0.3.0 行为。scan 干跑返回 gate/dropped 字段(含 wakeAgeMin/bizAgeMin),可直接观察门效。已知边界:wake>=biz 对从未唤醒、从未业务输入的纯系统会话(biz=null→0、wake=0)也成立 → 不登记,符合预期(无人在等它)。
重启最大的次生灾害不再是"起不回",而是重启前正在跑的任务全断、要逐个人工通知继续。v0.3.0 把这件事自动化:
schedule 触发时、进程还活着):自动扫描三路信号,把"重启会打断的工作"写入任务账本(source:'auto-scan'):
agents.list() 中 status==='running' 的内存 agent(最强信号)session.jsonl.zstd 的 mtime 在活跃窗口内(默认 15 分钟)jobs.list() 中 running 的后台作业(防御式字段读取)maxAutoResume(默认 5)上限,逐个错峰(staggerMs,默认 8s)followup 回原会话;auto 任务的消息自带"先自查恢复点再继续"指令,防止凭记忆瞎续。autoResume / activeWindowMs / maxAutoRegister / maxAutoResume / staggerMs / excludeSessions(子串匹配排除名单)。POST {method:'scan'} 只发现不登记,验收/调参用。session-<uuid> 与 bare <uuid> 两种磁盘/内存形态都接受(2026-08-28 动态探针实测两种并存)。诚实边界:中断瞬间的模型流无法断点续流(续跑=让 agent 自查后从断点继续,可能重复少量已做工作);后台命令类 job 进程无法复活,只能语义重发;goal 自动续轮重启后保持挂起,需用户人工恢复(续跑消息会提醒)。
/__dsh-restart/api,body {method,args})| method | 说明 |
|---|---|
ping | 探活;返回 {ok, t, pending}(不限 loopback) |
status | 当前待执行重启与配置 |
schedule | 调度一次重启(先自动扫描登记任务)。⚠️ 仅限 loopback(127.0.0.1/::1),远程一律 403 |
scan | 干跑自动发现(只看不登记) |
task.add / task.done / task.list | 手动任务账本(sessionId 建议带 session- 前缀) |
schedule 参数:delayMs(默认 12000,最小 3000——给触发方的响应留出落地时间)、reason(写入日志)。
重复调度有防抖:已有排队中的重启时返回 already:true。
安全说明:host-auth 准入守卫只包
/api前缀,自定义前缀路由不在守卫内;本插件对危险操作自建 loopback 围栏。
每 4 秒 ping 一次 host:
location.reload() 自动刷新于是:agent 触发重启 → 用户看到遮罩 → 页面自己回来 → 继续对话验证。
~/.dsh/self-restart/config.json:
{ "port": 3080, "startTask": "dsh-web-service", "delaySec": 12,
"autoResume": true, "activeWindowMs": 900000,
"maxAutoRegister": 12, "maxAutoResume": 5, "staggerMs": 8000,
"excludeSessions": [] }
port:DSH 监听端口(用于定位要杀的进程)startTask:拉起 DSH 的 Windows 计划任务名delaySec:默认延迟秒数日志:~/.dsh/self-restart/restart.log
Invoke-RestMethod http://127.0.0.1:3080/__dsh-restart/api -Method Post `
-ContentType 'application/json' `
-Body '{"method":"schedule","args":{"delayMs":15000,"reason":"host 插件更新"}}'
npm 包形态:npm i dsh-self-restart 后把包目录复制进 profile 的
node_modules\dsh-self-restart\(或按 DSH 插件管理器流程装载),在 profile package.json
的 dsh.profile.bundles 追加 "dsh-self-restart",重启 DSH 一次(最后一次手动重启 🎉)。
Git 形态:git clone https://github.com/jiang12345-code/dsh-self-restart.git → 同上复制 +
登记 bundle + 重启。
依赖环境:Windows + 已配置拉起任务(默认计划任务 dsh-web-service,端口 3080,可在
~/.dsh/self-restart/config.json 覆写)。
MIT
FAQs
DSH 自助重启:把「提权计划任务强杀进程树→端口释放确认→拉起服务」固化为插件能力;agent 或本机脚本一键调度重启,前端断线自动探测、服务恢复后自动刷新页面——让重启对用户近乎无感。v0.3.0 零登记自动发现:重启前扫描进行中任务写入账本,重启后错峰自动续跑。v0.3.4 业务门防自激:会话最后一次业务输入晚于其上次自动唤醒才登记,终结「已完成任务被反复唤醒自检」的连环空转。loopback 围栏防远程误触。
We found that dsh-self-restart demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.