TZHR-invest/dsh-plugins--packages-dsh-auto-archive ↗★ 3
dsh-auto-archive
将闲置指定天数的会话自动加入归档集合并隐藏 适合会话列表冗长的用户,自动清理冷会话,支持dry-run预览以防误归档。
同名包的其他仓库
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:TZHR-invest/dsh-plugins#a1cfb655f3116fa93361d1550eaa65a1c9c8769c&path:packages/dsh-auto-archive说明文档
阅读完整 README ↗安全边界(默认值,均可配置)
- 跳过错开运行中的会话(agent running);
- 跳过错开已归档会话(幂等,重复归档是 no-op);
- 跳过错开 subagent 子会话(归父会话管理,单独归档会破坏子代理面板);
- 错开 blank(从未开过 turn)会话;
- 默认只归档冷会话(
archiveAttached: false)——内存中挂载的会话意味着有界面正打开,归档会把使用者从该会话踢出; - 单次扫描上限
maxArchivePerRun(默认 100),防止阈值误配一次性误归档。
配置
配置写在 ~/.dsh/profiles/web/cordis.patch.yml 中 - id: dsh-auto-archive 的 config: 段,修改后重启 dsh 生效:
- insert:
- id: dsh-auto-archive
name: 'dsh-auto-archive'
config:
idleDays: 7 # 闲置天数阈值(默认 7)
scanIntervalMinutes: 60 # 扫描间隔分钟(默认 60)
dryRun: false # true 时只打印将归档的会话,不实际操作
archiveAttached: false # true 时也允许归档内存中挂载(正在被界面打开)的会话
skipBlank: true # 跳过从未开过 turn 的 blank 会话
maxArchivePerRun: 100 # 单次扫描归档上限