ethanwong-hk/dsh-thinking-guard ↗★ 0

@ethanwong-hk/dsh-thinking-guard

防止智能体陷入纯思考死循环的熔断保护插件 适合使用推理模型时,需要防止因重复或超时导致 Token 额度异常消耗的用户。

包名
@ethanwong-hk/dsh-thinking-guard
兼容性
待验证
Cordis 依赖范围
^4.0.1
版本
1.0.2
许可证
MIT
最近更新
2026年9月26日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ethanwong-hk/dsh-thinking-guard

配置

在 ~/.dsh/cordis.patch.yml 的 thinking-guard 条目 config 下调整,重启 DSH 生效:

- insert:
    - id: thinking-guard
      name: "dsh-thinking-guard"
      config:
        enabled: true
        # 只思考、零 text/tool-call 的持续时长上限(毫秒)
        thinkingOnlyMs: 45000
        # 单次尝试 reasoning 字符总量上限
        maxThinkingChars: 80000
        # 退化循环:重复次数阈值
        repeatThreshold: 3
        # 熔断后自动注入「继续当前任务」指令
        autoContinue: true
        notify: true
        verbose: false

环境变量可临时覆盖(无需改配置):

变量作用
DSH_THINKING_GUARD_DISABLED=1停用
DSH_THINKING_ONLY_MS纯思考停滞阈值
DSH_MAX_THINKING_CHARS思考容量阈值
DSH_THINKING_REPEAT_THRESHOLD重复次数阈值
DSH_THINKING_GUARD_VERBOSE=1打日志