The DSH ecosystem uses a plugin-based architecture. In long-conversation scenarios, models can easily forget earlier context. The dsh-session-summarizer plugin provides a native solution: it reads session content and generates a Chinese summary to help the model quickly recover context.

Plugin Role

This plugin is a native Cordis plugin in the DSH ecosystem, maintained by developer KhalilYamber. It uses the official DSH runtime to read sessions and generate summaries, without relying on any external services.

Core capabilities include:
* Read a specified, current, or recent session and generate a Chinese context summary.
* Register the model-visible tool session_summarize.
* Use the official DSH runtime @deepseek-ai/dsh-session (session reading) and @deepseek-ai/dsh-llm (summary generation) throughout.
* Support limiting the number of user message turns summarized via the lastTurns parameter.

Installation and Activation

The plugin is installed into the profile’s node_modules as a bundle patch and is completed via the dsh plugin command.

dsh plugin --profile <profile名> add dsh-session-summarizer

After installation, start the profile; the session_summarize tool is registered along with the plugin. The summary model, transcript budget, and other behaviors can be adjusted in the configuration file.

Typical Usage

Ask the model in the session to call the session_summarize tool.

Parameter Description

Parameter Required Description
sessionId No Session id to summarize; when omitted, prefer the current session, then fall back to the most recently active persisted session
lastTurns No Summarize only the last N user message turns; no limit by default (counted in “user messages,” not assistant messages)

Invocation Examples

  1. Text instruction invocation: Enter the following content in the session to ask the model to call the tool.
    > Please use session_summarize to summarize the last 20 turns of the current session and help me recover context.

  2. Tool invocation: The model directly calls the session_summarize tool while generating a response and specifies the sessionId parameter.

Output Format

When the tool executes successfully, it returns JSON. The fields are described as follows:

Field Type Description
ok boolean Whether it succeeded
summary string The summary text
sessionId string The id of the session actually summarized
source string Session source: explicit / current-agent / recent-active / none / error
readPath string Read path: live-sessions / persistence-inspect / none / error
chars integer Number of transcript characters sent to the summary model (after truncation)
message string (optional) Error message when failed

Limitations and Notes

Transcript Strategy

  • The transcript is based on derived messages or persisted event logs, retaining only user / assistant text and excluding internal details of tool calls.
  • Long session transcripts use a “keep the beginning and end, truncate the middle” strategy, with a default budget of transcriptChars: 12000 characters; overflowing content is replaced by a notice line.
  • lastTurns counts “user messages”; assistant messages do not count toward the turn limit.

Dependency Environment

  • Summary generation depends on the deepseek-official route of ctx.llm.stream and the default model deepseek-v4-flash (can be overridden in configuration).

Summary

dsh-session-summarizer provides DSH users with a tool set for recovering context in long sessions. After installation, the model can proactively request a summary via the session_summarize tool.