orangelightening / dsh-plugin-anti-rot

목록에 있음

DeepSeek Harness plugin: compresses verbose tool error payloads before they reach model context

master모델도구 소스 보기

설치

pnpm dsh plugin --profile web add /path/to/dsh-plugin-anti-rot

이 명령은 GitHub 저장소 주소에서 생성됩니다. 실행 전에 업스트림 README와 소스를 검토하고 재현성이 필요하면 release 또는 commit을 고정하세요.

README

유지 관리자가 작성한 문서 스냅샷입니다.

GitHub에서 보기 ↗
커밋 8e59807동기화 2026. 8. 18.

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 isError result (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

FieldTypeDescription
maxLinesnumberMaximum 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

프로젝트 파일 및 신호

표시된 항목은 디렉터리 스냅샷에서 감지된 공개 저장소 신호입니다.

테스트감지됨

저장소 정보

언어
TypeScript
라이선스
MIT
최신 릴리스
v1.0.0
마지막 업데이트
2026. 8. 18. AM 3:31

신중하게 설치하기

소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.