dsh-auto-compact
by wangxiang0605qvq
dsh-auto-compact — DeepSeek Harness 自动压缩插件 Auto Compaction Plugin
安装
dsh plugin --profile web add github:wangxiang0605qvq/dsh-auto-compactGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
让模型可以主动调度 DeepSeek Harness 会话上下文的自动压缩。注册模型工具 compact_now:模型在回合中请求压缩当前会话历史,插件在**回合结束后(agent 空闲时)**自动执行压缩,并写入会话日志。
Allows the model to schedule automatic compaction of its session context. Registers the compact_now tool: when called, the plugin runs compaction after the current turn ends (once the agent is idle) and records the result in the session log.
为什么需要它 | Why
- DSH 内置了按压力触发的自动压缩(
compaction-basic)和人类手动的/compact命令。 - 但模型自己无法触发压缩:
compaction.compactNow要求 agent 空闲,而工具在回合内执行时 agent 必然处于运行中(会抛busy)。 - 本插件的
compact_now用agent.whenIdle()把压缩推迟到回合结束后的空闲时刻执行,绕开 busy 限制。
安装 | Install
将本仓库复制到 DSH profile 的 node_modules 下:
Copy-Item -Recurse . "$env:USERPROFILE\.dsh\profiles\node_modules\@deepseek-ai\dsh-auto-compact"
在 profile 补丁(如 ~/.dsh/profiles/web/cordis.patch.yml)中插入:
- insert:
- id: auto-compact
name: "@deepseek-ai/dsh-auto-compact"
inject: ["tools", "agents", "timer"]
config: {}
重启 DSH 生效。
使用 | Usage
模型直接调用 compact_now 工具即可:
- 返回
{ ok: true, status: "scheduled" }:压缩已排队,回合结束后自动执行; - 返回
{ ok: false, reason }:压缩服务不可用(如 minimal 预设未挂compaction-basic); - 压缩结果(
compaction/start标记、摘要等)记录在会话日志中,模型可从后续上下文中看到。
依赖 | Dependencies
@deepseek-ai/dsh-compaction:压缩服务契约(agent 预设需挂载compaction-basic实现)。@deepseek-ai/dsh-tools、@deepseek-ai/cordis:工具注册与运行时。
License
MIT
原始 README: https://github.com/wangxiang0605qvq/dsh-auto-compact/blob/main/README.md ↗
同类插件
查看全部 →
mnemon
LLM监督持久内存插件 — 基于图的召回,跨会话知识,单二进制。与DeepSeek Harness、Claude Code、OpenClaw及任何代理运行时兼容。

memtrace-public
面向 AI 编码 agent 的结构化记忆:双时态图谱、MCP 原生、零 LLM 调用;支持 Cursor · Claude Code · Codex · DeepSeek Harness · Hermes · VS Code · Windsurf

dsh-flowix-memory
将本地 flowix-cli 注册为 MCP 服务,让 agent 可以搜索、读取、创建和编辑 Flowix 备忘与思维导图产物。

flowix
笔记助你,记忆助你的代理。

engramory
AI代理的便携式内存协议 — 以静态规则加载;整理学科 + 参考规范 + 可选的钩子API

dsh-memory-evolve
为 DeepSeek Harness 提供纯插件实现的跨会话长期记忆与后台自我进化能力:五轨记忆、Git 分支感知、回合内自我审查、技能自我进化与技能管理器、四轨待办、COI 调度、会话广播、会话搜索、提示词管理器和临时信息便签;零核心修改、零运行时依赖,安装即用,卸载即净。