akira399/dsh-guardian0

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 任务的用户,提供热生效的安全防护机制。

Package
dsh-guardian
Version
1.0.0
License
MIT
Last updated
Aug 14, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:akira399/dsh-guardian

配置(settings.yaml 的 guardian 命名空间)

默认值说明
enabledtrue总开关
maxLoopRepeats5同一工具+参数重复多少次判定循环
loopWindowSize8循环检测滑动窗口(最近 N 次工具调用)
maxSubagentDepth5子代理/工作流嵌套深度上限
cooldownMs30000引导消息冷却间隔(防止刷屏)
policy"auto"auto(检测到即引导)/ report(仅记录)
loopMessage内置默认循环时注入的换方向提示
recursionMessage内置默认递归超深时注入的收敛提示

示例:

guardian:
  maxLoopRepeats: 4
  maxSubagentDepth: 3

修改后热生效(无需重启)。