songoao25 / dsh-auto-compact

목록에 있음

Enhanced auto-compaction defaults for DeepSeek Harness agent presets

main도구 소스 보기

설치

npx -y @deepseek-ai/dsh plugin --profile web add github:songoao25/dsh-auto-compact

이 설치 명령은 GitHub 저장소 주소에서 생성된 확인되지 않은 시작점입니다.

README

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

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

dsh-auto-compact

English | 中文

License Release CI Last Commit Stars Dependabot

Enhanced auto-compaction defaults for DeepSeek Harness.

DeepSeek Harness ships automatic context compaction (dsh-compaction-basic), but the default trigger threshold is 80% of the model's context window — too late for large-context models. This tool lowers the threshold to 75% and adds per-route policies, so history is tidied up earlier and long sessions stay responsive.

How it works

DeepSeek Harness runs one compaction-basic instance per agent preset (per session). Profile-level patches cannot reach that subtree, so this tool directly injects configuration into the compaction-basic entry of every user-installed preset under ~/.dsh/.agent-presets/.

  • Default: trigger at 75% of the context window, keep the most recent 20% verbatim.
  • Per-route policies:
    • ChatGPT / Codex GPT-5.6 (272K context): trigger at 70%.
    • OpenCode Go DeepSeek V4 (1M declared context): trigger at 65%.
  • Keeps the existing summarization, retry, and safe-fallback behavior of dsh-compaction-basic (a failed summary preserves the original history and never silently drops context).
  • Manual /compact and tool-result pruning remain available.

Installation

cd dsh-auto-compact
./install.sh

Restart DeepSeek Harness afterward. Roll back with:

./uninstall.sh

Important: Factory Presets

This tool only injects into user-installed presets under ~/.dsh/.agent-presets/. The factory presets (standard, code, cordis, minimal) ship with their own default compaction settings (80% trigger, 16% retain) and are read-only — this tool will not modify them.

If you want enhanced compaction for a factory preset:

  1. Copy it to your user presets directory:
    cp -r /opt/homebrew/lib/node_modules/@deepseek-ai/dsh/presets/<preset-name> ~/.dsh/.agent-presets/
    
  2. Run ./install.sh again to inject the enhanced configuration.
  3. Select the copied preset in DSH's session setup.

What the installer does

  • Finds every agent.cordis.yml under ~/.dsh/.agent-presets/.
  • Injects the policy block into the compaction-basic entry of each preset.
  • Backs up each modified file as agent.cordis.yml.bak-auto-compact.
  • Idempotent: a marker comment prevents double injection.
  • Skips presets that already configure compaction-basic themselves (merge manually in that case).
  • Never touches the read-only factory presets in the DSH install directory.

Configuration

All values live in scripts/inject.mjs (the CONFIG_BLOCK). Edit them before running ./install.sh if you want different thresholds. Preview with:

node scripts/inject.mjs --dry-run
KeyDefaultMeaning
thresholdRatio0.75Trigger compaction when estimated usage reaches this fraction of the model context window
retainRatio0.20Keep the most recent fraction of the window verbatim
modelPoliciesPer provider/model overrides

Safety

  • A failed summarization preserves the original history and logs a warning.
  • Automatic recovery never loops indefinitely (bounded retries).
  • The tool contains no secrets and no personal paths.
  • Installation is fully reversible via ./uninstall.sh.

License

MIT © songoao25

프로젝트 파일 및 신호

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

테스트감지됨
보안 정책감지됨
기여 가이드감지됨
문서감지됨

저장소 정보

언어
JavaScript
라이선스
MIT
최신 릴리스
v0.2.0
마지막 업데이트
2026. 8. 16. 오전 7:58

신중하게 설치하기

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