WeiYe6/dsh-session-handoff1

dsh-session-handoff

将长会话移交至新会话:/handoff 命令利用大模型总结近期对话,在同一工作区创建干净的新会话,并将总结作为首条消息自动打开,原会话保持不变。

AI 分析

核心用途是解决长对话导致的上下文臃肿和 Token 浪费问题。适合会话轮数过多、需要“瘦身”并继续在当前工作区开展任务的用户。通过总结无缝承接上下文。

套件
dsh-session-handoff
版本
0.2.0
授權
MIT
最近更新
2026年8月17日

安裝

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

Usage

Type in any conversation's input box:

/handoff          # summarize the last 8 user messages (default)
/handoff 20       # summarize the last 20 (same as turns=20)
/handoff all      # summarize every user message (same as turns=all)

What happens:

  1. A command card shows "summarizing…";
  2. An LLM produces the handoff document (goal / progress / decisions / files / next steps / open questions), which becomes the new session's first message;
  3. The new session auto-opens; the origin session stays intact and is linked back.

⚠️ Privacy: the recent conversation text (user + assistant messages in the requested window) is sent to the configured model to produce the summary.

Configuration

- id: handoff
  name: dsh-session-handoff
  config:
    turns: 8            # user-message rounds to extract (1–50)
    maxInputChars: 24000  # byte cap for the summary input (oldest dropped first)
    maxTokens: 2000     # summary output budget
    reasoningEffort: off  # off (default, fast/cheap) | high | max | inherit
    timeoutMs: 120000   # summary call timeout
    # provider: deepseek-official   # optional fixed model route
    # model: deepseek-v4-flash      # must be paired with provider

Without provider/model, the current session's latest logged model route (session.requestHeader()) is used.