DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Auto Compact — DSH Plugin for DeepSeek Harness
← Plugins

auto-compact

Auto Compact

Session-level automatic context compression plugin: checks context usage before each step during a turn and at the end of the turn; automatically compacts when the session threshold is exceeded, then injects the summary into the context and continues naturally (DeepSeek Harness / DSH)

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add auto-compact@1.3.0
READMECompatibilityVersions

Compatibility and provenance

Auto Compact is published as auto-compact and currently resolves to version 1.3.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
npm
Registry updated
9/20/2026

Versions

1.3.0stable
8/14/2026
1.2.0stable
8/14/2026

Related plugins

Loading related plugins…

Latest
1.3.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
24 kB
Files
6
Surface
web
License
MIT
Source
npm
GitHub
★ 3
Weekly downloads
43
Last push
8/25/2026
View source ↗Project homepage ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in

Related plugins

More verified plugins in memory-context.

Memory Plugin@openviking/dsh-memory-pluginOpenViking memory and context bundle for DeepSeek HarnessContextdsh-contextA DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.Weknora@wxg-prc-cpg/dsh-weknoraWeKnora knowledge retrieval tools for DeepSeek Harness (dsh): semantic search, document reading and RAG/agent answers over your own knowledge bases.Mnemondsh-mnemonComposable three-tier memory control plane for DeepSeek Harness: persistent runtime context, searchable project documents, pluggable long-term memory, guarded strategies, WebUI, and headless tools.

README

auto-compact

会话级自动上下文压缩插件(DeepSeek Harness / DSH)

在输入区右侧显示一个阈值圆环:当前会话上下文用量实时显示,拖动滑杆设置该会话的压缩阈值(1%–90%,默认 50%)。每当用量超过阈值,插件自动触发上下文压缩(compact)——回合中每走一步之前检查一次,回合结束时再检查一次——压缩摘要注入上下文后会话自然继续,全程无需手动干预,也不发送任何「继续」消息。

特性

  • 🔴 会话级阈值:每个会话独立设置,互不影响(按 sessionId 持久化)
  • 📊 实时用量:与自带 ContextMeter 同源(useProjection("contextPressure")),面板打开即实时刷新,无需轮询
  • 🎚️ 1%–90% 细腻调节:步进 1%,适合精细控制(未设置时默认 50%)
  • 🤖 全自动:回合中每步前 + 回合结束自动检测 → 超阈值自动 compact → 摘要注入后自然继续
  • 🛡️ 零崩溃风险:所有检查都在 agent/pre-step(waterfall 中间件)与 agent/turn-stopping(串行事件)里做,全程 try/catch,绝不抛出
  • 💾 持久化:阈值存于 settings.yaml 的 auto-compact 命名空间,重启不丢
  • 🧊 与内置安全网并存:DSH 自带的 compaction-basic(默认 80% 压力阈值)保留为兜底,互不干扰

安装

前置:已装好 DSH(dsh web 能正常运行),Node.js ≥ 20、pnpm ≥ 10。

一键安装(推荐,复制粘贴即可)

macOS / Linux(Windows 装 Git Bash 或 WSL 也可):

curl -fsSL https://raw.githubusercontent.com/JohnathonYe/auto-compact/main/scripts/install.sh | bash

脚本自动完成全部步骤:安装 npm 依赖 → 注册官方挂载(dsh.profile.bundles)→ 清理旧版残留的挂载行。你只需要:

  1. 跑上面这一条命令
  2. 重启 DSH(装完后脚本会提示命令;也可以加上 --restart 让它自动重启:curl ... | bash -s --restart)
  3. 强刷浏览器(macOS Cmd+Shift+R / Windows·Linux Ctrl+Shift+R),输入区右侧出现阈值圆环 ✅

脚本内部已自动处理:dsh 命令通常不在全局 PATH(DSH 一般经 npx 安装,直接敲 dsh 会报 command not found),脚本会自动改用 npx 调用,无需用户手动处理。

或者用

npx -y --package @deepseek-ai/dsh dsh plugin --profile web add auto-compact

装完同样需要重启 DSH + 强刷浏览器。

更新 / 卸载

  • 更新:重跑一键安装命令(或手动命令),装完重启 DSH + 强刷浏览器
  • 卸载:npx -y --package @deepseek-ai/dsh dsh plugin --profile web remove auto-compact,卸载后重启生效;若曾手动在 cordis.patch.yml 写过挂载行,一并删除,避免双挂载(两个 Host 半、两个圆环)

使用

  1. 点击输入区右侧的圆环,打开面板
  2. 面板显示当前会话的实时上下文用量(百分比)
  3. 拖动滑杆设置阈值(1%–90%,会话级独立;未拖动过的新会话默认 50%,仅当前会话生效,不影响其他会话)
  4. 之后每当用量超过阈值(回合中某一步之前,或回合结束时),插件自动执行 compact 并继续

工作原理

  • Host 半(lib/index.js):监听 agent/pre-step(回合中每步之前,waterfall 中间件)与 agent/turn-stopping(回合结束,串行事件)两个事件,读取当前会话阈值与用量(tokenMeter.measure() / contextPressure 投影),超阈值时调用 agentPresets.serviceFor(agent, 'compaction').compactIfNeeded(agent, 'context-overflow', signal) 执行压缩 —— 走 context-overflow 分支,绕过引擎自身的 0.8 阈值检查,完全由滑杆决定。
  • Client 半(lib/client.js):在 conversation.input.right 槽注册圆环 UI;阈值经自定义 webServer 路由 /auto-compact/api(host 侧直写 settings 服务,绕过 DSH api.settings 的官方命名空间白名单)读写(auto-compact.thresholds[sessionId]);用量来自 useProjection("contextPressure") 实时投影。

依赖

  • 需要 DSH 的 compaction-basic(@deepseek-ai/dsh-compaction-basic)处于启用状态 —— 默认预设(standard / code / cordis)均已内置,minimal 预设除外
  • 所有 peer 依赖随 DSH 自带,无需额外安装

许可证

MIT