xiaoliang2/dsh-compact-after-task0

dsh-compact-after-task

Auto-compact a DSH conversation after the current task finishes, at a user-set context threshold.

AI 분석

核心用途是在任务结束且上下文达到设定比例时自动触发压缩,避免重发过多 Token。适合需要控制 API 费用、优化长对话性能的用户。

패키지
dsh-compact-after-task
버전
0.1.0
라이선스
MIT
최근 업데이트
2026. 8. 18.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗

Configuration

KeyTypeDefaultMeaning
enabledbooleantrueMaster switch.
thresholdRationumber (0.05–1)0.5Compress when pressure reaches this fraction of the routed model's context window (0.5 = 50%).
onlyRootsbooleanfalseOnly compress top-level conversation agents (skip background subagents).

Picking a threshold

Set it from "the max per-turn re-send you can tolerate ÷ the model's context window":

  • DeepSeek's default 1M window: 0.3–0.6 is the sweet spot; 0.5 is a conservative default.
  • Want each turn to re-send ≤ 400K tokens → 0.4; ≤ 250K → 0.25.
  • Don't go ≥ 0.8: the built-in compaction already fires at 0.8 at a step boundary, so a higher threshold here is meaningless.
  • Small-window models (128K/64K): raise to 0.6–0.8, or you'll squeeze out useful working context.
  • Too low (below ~0.1) means compressing after every small task, and the summary swallows details that were still useful.

Tune by feel after a couple of long tasks: compressing after every little task / summaries getting coarse → raise it; still re-sending hundreds of thousands of tokens per turn → lower it. Edit thresholdRatio in cordis.patch.yml and restart.