dsh-loop-guard
多智能体监工:一个独立模型实时审阅推理文本与工具调用,检测死循环 / 空转 / 偷懒,并按 WARN / BLOCK / STOP 三档落地。 适合需要防止智能体陷入推理或工具调用死循环以节省 Token 的用户。
同名パッケージの別リポジトリ
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:MyRemme/dsh-loop-guardドキュメント
README 全文を読む ↗配置
cordis.patch.yml:
- id: dsh-loop-guard
name: dsh-loop-guard
config:
enabled: true
supervisor:
enabled: true
provider: commandcode
model: zai-org/GLM-5.3
temperature: 0
timeoutMs: 60000
detect:
reasoningLoop: true
textLoop: true
minRepeats: 4
hardAfterHits: 2
toolRepeatThreshold: 3
toolBlockAt: 5
stepStallThreshold: 30
punish:
cutStream: true
blockRepeatTool: true
steerOnStop: true
maxStrikes: 3
budget:
cooldownMs: 20000
maxConsultsPerTurn: 3
maxConsultsPerSession: 40
顶层扁平别名
以下几个旋钮同时提供顶层写法:
toolRepeatThreshold: 3
toolBlockAt: 5
stepStallThreshold: 30
hardAfterHits: 2
cutStream: true
blockRepeatTool: true
顶层优先于嵌套值。这不是冗余:浏览器的设置表单(dsh-client-ui-primitives 的 SettingsFormModel)写操作是 {op:"set", path:[field]}——单段路径,读也是平面取值,嵌套的 detect.* / punish.* 它既读不出也写不进。UI 改的就是这一层,手改 cordis.patch.yml 两种写法都生效。
监工必须走另一条路由:换了工人的模型,supervisor.provider / supervisor.model 也要跟着换。两个模型相同会让监工调用自己触发自己。