DSH Plugins Marketplace

DSH Plugins

Plugins

/

Sessions & Messages

/

dsh-subagent-cleanup

M

dsh-subagent-cleanup

Manifest valid

DSH Plugin: Sub-agent Session Cleanup —— Session Self-Cleanup + Operations-Side Cross-Workspace Deep Clean (Reversible Archive / Permanent Deletion)

hasBundlePatch

@momojie-s/dsh-subagent-cleanup

DSH 插件:子 agent 会话清理——长期自主会话收尾时清掉自己攒下的子 agent 对话,或从运维侧跨 workspace 清理冷记录堆积。默认归档(可逆),可选彻底删除。

一句话作用

DSH 官方没有会话删除能力(API 只有归档隐藏,不减少 session.list 负担;官方 README 明言删除是"later product decision")。长期自主会话持续产生子 agent 会话记录,几十上百个堆积后拖慢 Web GUI(实测 664 条 ≈ 1s/880KB)。本插件提供两个模型可调用的工具补上这块:

  • subagent_cleanup(会话自清):清理"本会话自己的"子 agent 及更深层后代。通过子 agent 服务枚举(listDescendants)确定归属与状态,只处置已停稳的(正在跑的、刚结算仍在写的、活祖先名下的都跳过),无闲置小时门槛。
  • subagent_cleanup_global(运维大扫除):跨 workspace 按目录形态扫描(裸 UUID = 子 agent,session- 前缀主会话绝不触碰),只处置"当前 DSH 进程启动后从未写入 && 闲置超阈值(默认 24h)"的冷记录;支持 workspace 子串过滤和 parent 点名。

环境要求

  • DSH 0.1.5-rc.1(验证基准);host 半部插件,无浏览器组件,任意 profile 可用
  • Windows / Linux / macOS(fs.rename 同卷移动;DSH home 与 sessions 同盘)

用法

装好后无需配置。对话里直接说:

  • "把这次任务攒的子agent会话清掉"(长期会话收尾)→ 模型调 subagent_cleanup
  • "清理 StarRail 的旧子agent会话" / "全局大扫除一下子agent记录" → subagent_cleanup_global
  • 工具结果返回:处置清单、跳过分类计数、释放空间、归档 manifest 路径

参数要点(两个工具同构):mode: archive(默认)/ delete(不可恢复),dryRun: true 只看清单;自清支持 ids: [...] 点名自己的后代;大扫除支持 workspace 子串 / parent 会话 id / minIdleHours。

安装

dsh plugin --profile web add <本仓库路径>   # 开发机本地
# 或
dsh plugin --profile web add github:Momojie-S/dsh-subagent-cleanup

安装后重启 DSH 生效(bundle 层启动时快照)。

配置

patch config 字段(全部可选):

字段默认说明
toolSelfsubagent_cleanup自清工具的模型可见名
toolGlobalsubagent_cleanup_global大扫除工具的模型可见名
homeDSH_HOME 环境变量,再退 ~/.dshDSH home 覆盖
archiveRoot<home>/sessions-archive归档目标根
defaultIdleHours24大扫除闲置门槛(小时)
settleBufferMs30000仅磁盘子级的写入缓冲(毫秒)
liveBufferMs600000在内存子级需静默多久才可处置(毫秒)

验证

插件加载成功后 DSH 日志出现一行:

subagent-cleanup: active (tools subagent_cleanup/subagent_cleanup_global, home C:\...\.dsh, idle gate 24h)

会话里让模型执行 dryRun: true 的大扫除,返回的 skippedByReason 有合理分布(正在跑的 possibly-live/attached-unknown 被跳过)即为判据生效。

机制总览、安全边界与决策记录见 docs/design/overview.md。

Comments

Loading…

Similar plugins

dsh-session-cleaner

by new-256

DSH 会话清理宿主插件:侧边栏原生「移入回收站」+ 回收站管理页 + HTTP API(两级可恢复删除、同名防删错、活跃会话保护)

Manifest valid

★ 0

↓ 296/wk

MIT

JavaScript

Sep 9, 2026

dsh plugin --profile web add @luchenglong/dsh-session-cleaner

by ShiraGawaAnri

DSH 会话/归档清理插件:在 **设置** 面板里新增两个页面,用来查看并清理 DSH 的残留会话与归档会话。

Manifest valid

★ 0

MIT

JavaScript

Aug 16, 2026

dsh plugin --profile web add @dsh-external/dsh-session-cleanup

by lanlandeli

DeepSeek Harness 会话管理插件|归档与恢复、批量操作、工作区分组、子代理关系、活动详情、记录目录与安全文件清理

Sessions & MessagesManifest valid

★ 2

↓ 20/wk

NOASSERTION

TypeScript

Aug 18, 2026

dsh plugin --profile web add dsh-conversation-manager

by lxchapu

DSH(DeepSeek Harness)插件:把会话从磁盘上彻底删除。任意会话的「…」菜单里可删单条,侧边栏切到「仅显示已归档」时可一键删除全部已归档会话;两者都先弹二次确认,正在运行的会话会被拒绝删除。

Development & InfrastructureManifest valid

★ 1

MIT

JavaScript

Oct 3, 2026

dsh plugin --profile web add @lxchapu/dsh-session-purge

by Momojie-S

DSH 插件: 归档会话定期清理 —— 物理归档堆与页面归档会话超保留期(页面可配天/小时,cron 调度)自动物理删除

Sessions & MessagesManifest valid

★ 0

MIT

TypeScript

Oct 16, 2026

dsh plugin --profile web add @momojie-s/dsh-archive-retention

by luckamuu

DeepSeek Harness 插件:提供删除已归档会话的入口(可以彻底删除不会在次出现)

Manifest valid

★ 0

MIT

JavaScript

Oct 8, 2026

dsh plugin --profile web add @local/archived-sessions