插件目录 / Knowledge / dsh-plugin-anti-rot
dsh-plugin-anti-rot
已验证 · 实测可装 orangelightening
功能简介
DeepSeek Harness plugin: compresses verbose tool error payloads before they reach model context
可用 — 实测通过,早期项目
DeepSeek Harness plugin: compresses verbose tool error payloads before they reach model context 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-plugin-anti-rot
A DeepSeek Harness plugin
developed to remove a common source of context rot in long-running agent
sessions: verbose tool error payloads piling up in the context window. When a
child process dies mid-traceback, its raw stack dump would otherwise spend the
whole error — often dozens of noise lines — against the session's context
budget, and repeated failures compound over hours of work. This plugin
compresses those payloads before they reach model context and the session log. A failed call's text is reduced to its first maxLines message
lines, indented at … stack-frame lines are dropped, and an elision marker names
what was removed:
Error: boom
[…anti-rot: dropped 8 stack-frame lines, omitted 0 of 8 message lines…]
How it works
The plugin hooks the tools/post-execute waterfall and rewrites error text in
place. It recognizes two failure signals and nothing else:
- an
isErrorresult (infrastructure failures — spawn errors, aborts), or - a trailing non-zero
[exit code: N]marker per the shell tools' shared
rendering contract (failing commands are model-interpreted SUCCESS results,
so the marker is the only failing-command signal).
A clean exit leaves the result untouched. The exit marker is always re-appended
as the final line of a compressed payload, because the model is instructed to
check it and the terminal UI parses it from the end of the text.
Bounding oversized successful text is a different concern, owned by@deepseek-ai/dsh-spill-policy; both plugins delegate through next() and
compose.
Install
From a checkout of this repository:
pnpm dsh plugin --profile web add /path/to/dsh-plugin-anti-rot
Or run it transiently with an overlay:
pnpm dsh web --patch /path/to/dsh-plugin-anti-rot/overlay.yml
Configuration
| Field | Type | Description |
|---|---|---|
maxLines |
number |
Maximum message lines kept in a compressed error payload. Must be a positive integer; load fails loudly otherwise. |
Example entry in cordis.patch.yml:
- insert:
- id: anti-rot
name: dsh-plugin-anti-rot
config:
maxLines: 15
Development
npm install
npm run build # tsc → lib/
node --import tsx/esm tests/anti-rot.smoke.ts # keyless smoke tests
npx tsc -p tsconfig.json # strict typecheck
License
MIT © Orangelightening
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-plugin-anti-rot」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:orangelightening/dsh-plugin-anti-rot Headless(CLI)profile:
dsh plugin --profile headless add github:orangelightening/dsh-plugin-anti-rot 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。