easerlee/dsh-session-handoff ↗★ 0
dsh-session-handoff
DSH 插件:上下文压力到阈值时,把当前工作交接给一个新会话(文件式交接包 + handoff_now 工具 + HTTP 接口)。 适合进行超长对话的用户,在Token即将超限时平滑过渡,避免丢失关键上下文。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:easerlee/dsh-session-handoffREADME
Read the full README ↗配置
在 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
| 键 | 默认 | 说明 |
|---|---|---|
enabled | true | 关掉就只留 HTTP 接口与工具,不做自动交接 |
thresholdRatio | 0.6 | 压力到多少比例触发(0.6 = 60%)。与 compaction 一起用时调高,见下 |
maxCompactions | 2 | 本会话被 compaction 压过几次就触发交接(0 = 只看压力) |
cooldownMs | 300000 | 同一会话两次交接的最小间隔 |
handoffDir | .dsh/handoff | 交接包落盘目录(相对工作区;写绝对路径也行) |
recentMessages | 14 | 交接包里带多少条最近用户消息 |
maxChars | 24000 | 交接包字数上限 |
renameOldSuffix | [已交接] | 旧会话改名时加的后缀 |
dryRun | false | true = 只生成交接包,不建新会话(首次验证用) |
⚠️ patch 的 config 是整段替换,覆盖时必须把不想改的键一起写上。