Hard stop for runaway turns: blocks repeated identical tool calls and ends the turn when per-turn step or time budgets are exceeded.
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/ikta2010/dsh-loop-breaker/releases/latest/download/dsh-loop-breaker.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ikta2010/dsh-loop-breaker
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
硬止损插件:同一工具 + 同一参数反复调用时,直接中断本轮。
为什么需要
2026-09-13 从真实会话日志实测:
- 单个 turn 最多跑出 337 步
- 同一条命令被重复调用 120 次 / 85 次
- dsh 自带的
repeat-tool-reminder只提醒、不中断 dsh-agent-loop只暴露maxParallelToolCalls,没有步数上限
结果就是"跑四小时 / 最后只能 /stop"。
实现
用两个上游扩展点:
| 钩子 | 作用 |
|---|---|
tools/post-execute(waterfall) |
计数;超限时返回 {kind:'block', feedback, additionalContexts} 否决该次结果并注入可见说明 |
agent/pre-step(waterfall) |
返回 {kind:'reject'} 让下一步不进入 → 本轮结束 |
判定键是「工具名 + 参数规范化后的 JSON」,所以正常干活(每次不同命令)不会误伤。
配置
- id: loop-breaker
name: 'dsh-loop-breaker'
config:
consecutiveLimit: 4 # 连续重复多少次硬止损
totalLimit: 12 # 单轮内累计多少次硬止损
include: [] # 只统计这些工具(空=全部)
exclude: [] # 排除这些工具
argumentsPreviewChars: 400
安装
bash /nas/dsh/工具/dsh-loop-breaker/install.sh
装完需要重启一次 dsh web 才会加载(会短暂断开网页,会话不丢):
dsh-restart
卸载
dsh plugin --profile web remove dsh-loop-breaker
rm -rf ~/.dsh/profiles/web/node_modules/dsh-loop-breaker
Links
More in this category
DayuanJiang/next-ai-draw-io#dsh-plugin★ 36599
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
Tencent/WeKnora#dsh-weknora★ 36302
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
superdesigndev/treg★ 7042
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 5074
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
sixtysevenlf/dsh-blender-plugin★ 1575
Lets a DSH agent drive a local Blender over a direct TCP channel with 15 tools: viewport frames, custom-angle renders, Python execution, headless and job offload, transaction rollback, and a planning layer of 228 ops across 34 families.
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1155
Tencent CloudBase backend for DeepSeek Harness — scaffold and deploy full-stack apps from chat, render query results as table cards with paging, sorting and CSV export, preview a deployment on its domain, and call the CloudBase MCP toolset (`mcp__cloudbase__*`) with device-code login.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.