coding-agents
vectorize-io/hindsightHindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
为 DSH 智能体预设注入增强的自动压缩默认值:一键应用调优的触发阈值/保留比例与分模型策略,幂等执行、自动备份、可回滚。
English | 中文
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.
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_HOME/.agent-presets/ (default: ~/.dsh/.agent-presets/).
dsh-compaction-basic (a failed summary preserves the original history and never silently drops context)./compact and tool-result pruning remain available.dsh plugin --profile <profile-name> add songoao25/dsh-auto-compact
Restart DeepSeek Harness once afterward. On bundle load, the plugin runs the
same safe injector described below: it changes only user-installed presets,
creates a timestamped backup before every change, skips a preset that already
has its own compaction-basic configuration, and is idempotent on later
starts. Roll back with:
./uninstall.sh
The uninstaller restores the latest backup for each affected preset. Run it from a checkout of this repository; removing the DSH bundle alone does not discard the preserved preset configuration.
This tool only injects into user-installed presets under $DSH_HOME/.agent-presets/. The alpha.4 factory presets (standard, cordis, minimal, ptc) ship with their own default compaction settings and are read-only — this tool will not modify them.
If you want enhanced compaction for a factory preset:
cp -r "$(npm root -g)/@deepseek-ai/dsh/node_modules/@deepseek-ai/dsh-agent-presets/presets/<preset-name>" "$DSH_HOME/.agent-presets/"
./install.sh again to inject the enhanced configuration.agent.cordis.yml under $DSH_HOME/.agent-presets/.compaction-basic entry of each preset.agent.cordis.yml.bak-auto-compact.compaction-basic themselves (merge manually in that case).All values live in config.json. The generated block uses the alpha.4 compaction-basic fields; edit the JSON before running ./install.sh if you want different thresholds. Preview with:
node scripts/inject.mjs --dry-run
| Key | Default | Meaning |
|---|---|---|
thresholdRatio | 0.75 | Trigger compaction when estimated usage reaches this fraction of the model context window |
retainRatio | 0.20 | Keep the most recent fraction of the window verbatim |
modelPolicies | – | Per provider/model overrides |
./uninstall.sh.MIT © songoao25