Injects conclusions already established in the previous reasoning block after each tool result, so the model continues from them instead of re-deriving the same conclusions.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-cot-anchor
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:JiewiW/dsh-cot-anchor
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.
做这个插件的起因很直接:想弄清楚人不介入代码细节时,模型靠什么机制约束自己的思考,以及怎么验收它确实做对了。它盯生成途中那些「看着在忙、其实没往前走」的信号——原地重复、伪工具调用、无意义的数字流、过长的思维链,命中就切断当前生成、让回合从断点接着跑。判据全部落在本地能机械计算的字符串信号上,不额外调模型;判定阈值和误拦截是我反复调的部分,早期词典太宽会误截断正常思考,后来靠收紧词典、滑窗长度和匹配次数缓解。成本在一个约 924 万 token 的真实长会话上复算过,口径和复算方法都写在文档里;代码借助 AI 协作完成,装机实测由我逐版做。
DeepSeek Harness(DSH)插件,治的是一类特定的模型毛病:思考着思考,但没在推进。表现为反复重新推导已经得出的结论、把工具调用写成纯文本、原地重复同一段话、输出无意义的递增数字流。
它做的事是在生成途中盯着这些信号:每生成一小段就按本地规则检查一次,命中就切断这一次生成,把已经写出来的部分作为正常消息落盘,让回合从断点续跑,不会因为一次误判丢掉整轮工作。判定不调用模型,也不改写会话里已有的内容。外部插件也可以向它请求软切,过长的思维链同样能触发。
它不解决一切长任务问题,只解决「单流内思考链极度冗余、结论反复重新发现」。跨步骤的折返跑(同一结论在十几步里重推)不在能力范围内,那是姊妹插件 dsh-step-governor 的职责。
快速开始
dsh plugin --profile <你的profile> add github:JiewiW/dsh-cot-anchor#v0.4.2
重启实例后设置页出现「COT 锚点」标签即生效。软切需要内核支持,见兼容性。
成本
判定本身是本地字符串计算,不额外调模型。少数需要写回上下文的消息采用尾部追加,不改写已有内容,因此不会打穿前缀缓存。
早期版本在一轮约 924 万 token 的真实长会话上复算过注入占比,那是旧机制下的历史数据;字符换算 token 用的是启发式估算,不是 tokenizer 实测。口径、修正与限定见 docs/cot-anchor-prefix-cache-claim-correction.md 与 RELEASE-NOTES.md,不代表当前版本的开销。
能力边界
- 软切只看当前一次生成流,进入下一步计数归零。治得了单流内退化,治不了跨步骤折返跑。
- 软切不减少回合步数。长任务账单的大头是「步数 × 每步膨胀的上下文重读」,步数治理请用 step-governor。
- 模型可能知道自己在空转却停不下来——实测出现过思考中自述「I'm burning turns, let me stop」之后继续生成下一条探索路线。软切的前提是能机械识别出打转,自知不构成刹车。
- 每回合的软切次数有内核侧预算上限,打满后启发式判定不再触发,高置信的重复仍照常拦截,避免误判把一次正常生成反复掐断。预算事件在会话日志里可观测。
兼容性
0.1.5-rc.3 起内核移除了软切所需的 agent/soft-cut 钩子,这一能力会静默失效;插件在启动日志和设置页顶部明确提示当前内核是否支持,以设置页显示为准,不要凭开关是开的就认为在生效。
新版内核可以用随包工具把软切机构移植回去,带版本与哈希自检,幂等、可回滚,不符自动还原:
node node_modules/dsh-cot-anchor/tools/apply-softcut-port.mjs --check # 查看状态
node node_modules/dsh-cot-anchor/tools/apply-softcut-port.mjs # 应用
移植后重启实例。完整步骤与风险见 docs/softcut-kernel-port.md。
设置
设置页「COT 锚点」按用途分组,常调的是几项软切判定的开关和阈值:伪工具调用、原地重复、反复重新分析、转折句、数字流,以及各自的匹配次数与滑窗长度。每项在页面里有内联说明,键名、默认值和分组以设置页与源码为准。
打断太频繁时,先关转折句判定,其次调高重复判定的阈值。
隐私
- 软切与相关判定都在本地完成,不向外部服务发送数据。
- 开启 CoT 采集或自动归纳后,思考文本会留在本地;自动归纳还会把样本发给你指定的 provider(留空则跟随当前会话),启用前请自行评估隐私。
开发
仓库根目录所有 test-*.mjs 都是独立可执行脚本(无测试框架、无 npm test),逐个 node test-*.mjs 运行,退出码 0 即通过。
许可
MIT
Links
More in this category
Clearailhc/clearai-dsh★ 696
An agent preset for evidence-checked research: every step advances only through system-verified observations, L3+ claims go to an independent evaluator, and the session folds into a replayable ledger that grows into a browsable domain ontology. Requires DSH >=0.1.7-alpha.1.
FuRongJun-1999/dsh-memory★ 672
White-box AGI architecture exploration: metacognition (self-cognition loop), continual learning (knowledge flywheel), world model (condition space, spatiotemporal memory graph), self-improvement (bootstrap discipline), zero-LLM white-box pipeline, and auditable trust guardrails.
icyaaaww/dsh-soul★ 85
Records recurring task corrections and tool failures locally, then compiles them into changes to eight harness components through explicitly started evolution, paired baseline/candidate checks, trial activation and rollback. Includes a budget and audit ledger; requires Node.js 24+ and a compatible DSH 0.2.1-rc.2 or later 0.2.x host.
MichengAI/dsh-pua★ 72
Adds /pua to steer the agent to try another approach and verify results before claiming completion, with 15 company styles, persona modes, global and per-conversation settings, and an optional loop that continues until a verification command passes, the iteration limit is reached, or the user cancels.
kenz1117/dsh-engram★ 70
Cross-session long-term memory as a local SQLite store: dual scopes (user + per-git-origin project), hybrid FTS5 + local-vector retrieval fused with RRF, an evidence gate that forces an explicit sufficiency judgement, provenance audit chains, SM-2 spaced-repetition review, consolidation distillation and decay forgetting, and a nine-view "Memory Palace" sidebar panel. 22 narrow-parameter tools, no external service, no API key, no Docker.
pk14742952-AD/dsh-host-rsi★ 39
Reflective self-evolution plugin for local Qwen3.8 27B/3.8 Flash and online APIs: a coding-loop convergence steerer curbs Qwen3.8 27B/Flash repeated-verification deep-thinking to converge faster and cut thinking time; a five-state delivery guard detects and corrects stuck turns and infinite loops; model-agnostic host logic, mostly compatible with online APIs; per-use continual self-improvement with counter-reason self-checks, critic escalation, inverted-index memory retrieval, coding-loop convergence steering, and a five-state delivery guard.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.