dsh-step-governor
确定性步数治理——agent/pre-step reject 步级熔断与 tools/pre-execute deny 支线熔断(shadow 先行,fail-open) 适合需要对智能体进行确定性步数限制、防止无限循环的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JiewiW/dsh-step-governor安装与配置
dsh plugin --profile add github:JiewiW/dsh-step-governor#v0.1.3
host + client 双半边插件:加载后在 DSH 设置页出现「步数治理」卡片,14 项配置可直接改并持久化;也可用 GET/POST /plugins/step-governor/settings 读写(GET 返回完整 schema)。
环境变量只作为启动初始值,且优先级最高(env 显式设置的键,设置页保存不会覆盖):
| 环境变量 | 对应配置 | 默认 |
|---|---|---|
DSH_GOVERNOR_MODE | mode | shadow |
DSH_GOVERNOR_G1A_N | g1aZeroSteps | 4 |
DSH_GOVERNOR_G1B_K | g1bFingerprintSteps | 6 |
DSH_GOVERNOR_G1C_MAX | g1cMaxStepsPerTurn | 60 |
DSH_GOVERNOR_G2A_M | g2aSameTargetCalls | 3 |
DSH_GOVERNOR_G2B_F | g2bConsecutiveFailures | 2 |
加载成功时 stderr 打印一行:
[dsh-step-governor] {"mode":"shadow","at":"loaded","thresholds":{...}}
实验期间建议用独立 profile + 独立端口运行,不要直接在日常 profile 开启强制档。