Introduction¶
During the use of DeepSeek Harness (DSH), as sessions become longer, the context window gradually fills up, model processing becomes slower, and important information is more likely to be lost. Manually copying and pasting history into a new session is tedious and can easily disrupt the workflow. The dsh-session-handoff plugin aims to solve this problem: with a single command, it summarizes the current session and hands it over to a completely new session, while leaving the original session unchanged.
Plugin Introduction¶
dsh-session-handoff is a DSH plugin for smoothly handing off long sessions to a new session.
- Maintainer: WeiYe6
- License: MIT
- Core Value: It creates a clean new session + agent in the same workspace, generates a structured summary using an LLM, and automatically opens the new session.
Core Features¶
The plugin mainly provides the following capabilities:
- Single-command operation: Enter
/handoffto trigger it. You can specify the number of messages to summarize or useallto include the full history. - Clean handoff: The new session inherits the original workspace, model routing, and agent preset (including the system prompt, tools, and skills), but it does not copy the old historical context, avoiding context bloat.
- Structured summary: The generated handoff document contains clearly categorized sections, including task objectives, current progress, key decisions, relevant files, next steps, and outstanding issues.
- Automatic opening: The client waits for the new session to be ready and then navigates to it automatically. Each sub-session is opened automatically only once, with no repeated navigation.
- Robustness by design: Summarization has reasoning disabled by default (fast/cheap), oversized inputs are truncated to the latest messages instead of causing an error, and finish reasons are converted into actionable error messages.
- Zero core changes: It requires only a single-line
dsh.bundle.patchand depends only on public services.
Installation and Activation¶
Installation begins with obtaining the package file, then installing it via the DSH command line.
- Obtain the plugin package (for example,
dsh-session-handoff-0.2.1.tgz). - Use the DSH command to add it to the web profile:
dsh plugin --profile web add ./dsh-session-handoff-0.2.1.tgz
- Restart DSH and verify. In web mode, when viewing the configuration, you should see mount entries related to
dsh-session-handoff.
Usage Examples¶
In the input box of any session, enter one of the following commands:
/handoff: Summarizes the latest 8 user messages by default./handoff 20: Summarizes the latest 20 user messages./handoff all: Summarizes all user messages.
After execution, the interface displays “summarizing…”, and then the new session opens automatically. The first message is the generated structured handoff document.
Configuration¶
You can adjust summarization behavior in the configuration file. The default configuration is as follows:
- id: handoff
name: dsh-session-handoff
config:
turns: 8 # 抽取的用户消息轮数 (1-50)
maxInputChars: 24000 # 摘要输入的字节上限(超出则丢弃旧消息)
maxTokens: 2000 # 摘要输出的 token 预算
reasoningEffort: off # 思考模式:off (默认,快速/便宜) | high | max | inherit
timeoutMs: 120000 # 摘要调用超时时间
# provider: deepseek-official # 可选:固定模型路由
# model: deepseek-v4-flash # 必须与 provider 配对
If provider and model are not configured, the system uses the current session’s model routing.
Notes¶
- Privacy: To generate the summary, text from recent conversations (including user and assistant messages) is sent to the configured model for processing.
- Version compatibility: Supports DSH
0.1.0-rc.5throughrc.8and0.1.1-rc.2. DSH0.1.2-alpha.1is excluded due to architectural changes and is not supported. - Storage location: The handoff document exists only in session memory and is not written to disk (
HANDOFF.mdis a future enhancement).
Conclusion¶
dsh-session-handoff addresses a pain point in context management during DSH development. By automating session handoff, developers can keep sessions clean and efficient. For more details and source code, see the community directory or the GitHub repository.