dsh-stall-guard
DeepSeek Harness watchdog plugin with a monitor → judge → continue/fix/redirect flow and NO task termination: in-flight operations are treated as progress (never steered), and only true silence triggers a diagnose → fix → redirect message ladder (repeats forever) plus a JSONL event log and loopback status route. Zero npm dependencies.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:akira399/dsh-stall-guard说明文档
阅读完整 README ↗dsh-stall-guard
DeepSeek Harness(DSH)任务看门狗插件:监控任务执行状态,判断是否真正卡死,并通过"排查→修复→换方向"的阶梯式引导帮助任务恢复——全程不终止任何任务。
核心流程(监控 → 判断 → 继续 / 修复 / 换方向)
agent/status (running/idle) ─┐
session/event (turn/step/tool/llm) ─┼─→ 追踪每个会话的"最后活动时间"与"在飞操作"
│
周期扫描(checkIntervalMs)──→ 运行中且 静默 > stallThresholdMs ?
│
├─ 有在飞操作(busy>0)或持续有事件 → 判定"推进中" → 继续执行,不干预
│ (超 busyTimeoutMs 仅记一条 LONG_RUNNING 日志)
│
└─ 真静默(无事件 + 无在飞)→ 阶梯式引导(注入提示消息):
第1级 诊断(DIAGNOSED) :请 Agent 排查当前状态、说明卡住原因(附看门狗诊断现场)
第2级 修复(FIXING) :请 Agent 针对卡点重试/完成/修复后继续
第3级+ 换方向(REDIRECTING):请 Agent 放弃当前方法、改用替代方案持续推进
(每级按冷却间隔推进,第3级后循环;任何活动事件都会重置回第1级)
│
事件写入 $DSH_HOME/stall-guard/events.jsonl
状态查询 GET /api/dsh-stall-guard/status
关键承诺:插件永不终止任务。 它只通过注入消息引导 Agent 自己排查、修复、换方向;没有 terminate 选项,也没有任何终止指令。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:akira399/dsh-stall-guard
安装后重启 DSH。插件默认启用。
配置(settings.yaml 的 stall-guard 命名空间)
| 键 | 默认值 | 说明 |
|---|---|---|
enabled | true | 总开关 |
stallThresholdMs | 120000 | 真静默阈值(毫秒):运行中、无任何事件、且无在飞操作时,静默超过该值判定卡顿 |
checkIntervalMs | 5000 | 扫描间隔(毫秒) |
busyTimeoutMs | 600000 | 在飞操作观察窗口(毫秒):有工具调用 / LLM 请求在飞 = 任务在推进,永不引导;仅静默超过该值后记录一条 LONG_RUNNING;0 关闭该记录 |
stallRecordIntervalMs | 60000 | STALL 记录节流间隔(毫秒),防止持续卡顿时日志刷屏 |
policy | "auto" |