easerlee/dsh-session-handoff ↗★ 0

dsh-session-handoff

在上下文压力达到阈值时自动交接至新会话 适合进行超长对话的用户,在Token即将超限时平滑过渡,避免丢失关键上下文。

包名
dsh-session-handoff
兼容性
待验证
Harness 依赖范围
*
版本
0.1.2
许可证
MIT
最近更新
2026年10月1日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:easerlee/dsh-session-handoff

配置

在 profile 的 cordis.patch.yml 里:

- id: dsh-session-handoff
  config:
    enabled: true
    thresholdRatio: 0.85     # 出厂默认 0.6;与 compaction 一起用时调高
    maxCompactions: 2        # 本会话被 compaction 压过几次就交接(0 = 只看压力)
    cooldownMs: 300000
    handoffDir: .dsh/handoff
    recentMessages: 14
    maxChars: 24000
    renameOldSuffix: " [已交接]"
    dryRun: false
键默认说明
enabledtrue关掉就只留 HTTP 接口与工具,不做自动交接
thresholdRatio0.6压力到多少比例触发(0.6 = 60%)。与 compaction 一起用时调高,见下
maxCompactions2本会话被 compaction 压过几次就触发交接(0 = 只看压力)
cooldownMs300000同一会话两次交接的最小间隔
handoffDir.dsh/handoff交接包落盘目录(相对工作区;写绝对路径也行)
recentMessages14交接包里带多少条最近用户消息
maxChars24000交接包字数上限
renameOldSuffix [已交接]旧会话改名时加的后缀
dryRunfalsetrue = 只生成交接包,不建新会话(首次验证用)

⚠️ patch 的 config 是整段替换,覆盖时必须把不想改的键一起写上。