dsh-guardian
DeepSeek Harness task-protection plugin: plugin preflight scanner (catches missing `inject` declarations that crash the host), loop detection (repeated identical tool calls -> steer to a new approach), recursion guard (nested subagent depth cap), and interruption awareness (status route with safeToRestart). Never terminates tasks — only steers via injected messages. Zero npm dependencies.
AI Analysis
核心用途是防止 AI 任务陷入死循环、超深递归或因配置缺失导致崩溃。适合需要运行复杂、多步骤或自主 Agent 任务的用户,提供热生效的安全防护机制。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:akira399/dsh-guardianREADME
Read the full README ↗配置(settings.yaml 的 guardian 命名空间)
| 键 | 默认值 | 说明 |
|---|---|---|
enabled | true | 总开关 |
maxLoopRepeats | 5 | 同一工具+参数重复多少次判定循环 |
loopWindowSize | 8 | 循环检测滑动窗口(最近 N 次工具调用) |
maxSubagentDepth | 5 | 子代理/工作流嵌套深度上限 |
cooldownMs | 30000 | 引导消息冷却间隔(防止刷屏) |
policy | "auto" | auto(检测到即引导)/ report(仅记录) |
loopMessage | 内置默认 | 循环时注入的换方向提示 |
recursionMessage | 内置默认 | 递归超深时注入的收敛提示 |
示例:
guardian:
maxLoopRepeats: 4
maxSubagentDepth: 3
修改后热生效(无需重启)。