Introduction¶
In DSH (DeepSeek Harness), the longer a session works, the more events it accumulates, the larger the live event tree becomes, leading to increased memory usage and lag. In the past, handling this was done entirely manually: first summarizing the history into a summary, creating a new session to paste the summary as an opening, and finally archiving the old session to free memory—each step requiring manual operation.
dsh-fresh-start merges this closing workflow into a single /fresh command. Below is an introduction to its flow, installation method, and usage notes.
What is it¶
dsh-fresh-start is a DSH plugin maintained by orangeofcarl0-sys. Its core is the /fresh command: one-click summary of the current conversation → open a new conversation (auto-redirect) → archive the old conversation, alleviating memory and lag for very large sessions. License: MIT.
Complete flow of /fresh¶
A single /fresh goes through five stages in order:
- Compact-First: Forcefully compress the current session;
- Conversational Summary: Let the LLM generate a natural language summary;
- Creating a seeded new session: The summary serves as the opening message;
- Archiving the old session: Release the memory occupied by the live event tree;
- Client-side auto-redirect.
Let’s break it down step by step.
Compact-First: Compress before summarizing¶
If the current preset has a host compression engine mounted (standard/code/cordis), /fresh will first call compactNow to forcefully compress the current session before entering the summarization stage, so the summary faces a tightened context.
Compression is not required to succeed: when the engine is unavailable (minimal), the agent is busy, there is no compressible range, or the engine throws an error, it silently degrades to a pure conversational summary without blocking the process.
Conversational Summary¶
The plugin extracts the system from session.requestHeader(), adds all messages returned by session.deriveMessages(), and uses a simple instruction to ask the LLM to summarize this content into a natural language summary.
Creating a seeded new session¶
After obtaining the summary, the plugin creates a new session via ctx.agents.create:
- Inherits the
cwdand agent preset of the old session; - The summary serves as the opening message (seed) of the new conversation;
- The new session’s
header.parentSessionpoints to the old session.
Archiving and Auto-Redirect¶
Subsequently, the plugin archives the old session via ctx.workspaceRegistry, releasing the memory occupied by the live event tree.
The redirect is handled by the accompanying client plugin: it listens for the host/archived-sessions-changed event, finds the corresponding new session via parentId, and calls ctx.sessions.open to automatically redirect there. If the new session has not yet synced to the list when the archive broadcast occurs, it is placed in pending first, waiting for the session list update before jumping.
Independence and Non-blocking Degradation¶
Each stage is independent; if one step fails, it degrades but does not block subsequent steps. A typical scenario is summary failure: in this case, a new conversation will still be opened and the old session archived, but the new conversation will not include a summary.
Host + Client Dual Architecture¶
The plugin’s unique functional path is the host-side lib/index.js along with the mount manifest cordis.patch.yml; the client-side lib/client.js enters the browser manifest via the dsh.client declaration and is responsible for the auto-redirect mentioned above.
The plugin also comes with a dsh-std Community v0.15 manifest dsh-plugin.json. By default, it is completely lazy: the native DSH loader will not read it; it is only discovered and validated after explicitly installing @dsh-std/adapter-dsh. Its host entry point is the placeholder implementation lib/std/host.js, and contributes.commands is deliberately left empty—this avoids projecting a second /fresh into the native registry in an environment with @dsh-std/adapter-dsh installed, which would cause a conflict.
Installation and Enabling¶
Installation command:
dsh plugin --profile web add github:orangeofcarl0-sys/dsh-fresh-start
After a new version of the plugin is released, update it with the following command:
dsh plugin --profile web update dsh-fresh-start
Restart dsh web; if the log appears with [fresh-start] installed: /fresh command registered, the installation is successful.
A note: if you have already manually mounted this plugin in your profile’s cordis.patch.yml, please delete that line before installing, otherwise a duplicate instance will occur.
Typical Usage¶
Enter /fresh in the chat input box, optionally with a preset parameter:
/fresh # Inherits the preset of the current session
/fresh standard # Start a new session with the specified preset (Standard mode)
Supported target presets:
/fresh standard— Standard mode;/fresh ptc(Old inputcodemaps toptcfor compatibility) — PTC mode (Code Mode SDK);/fresh minimal— Minimal mode;/fresh createor/fresh creator— Creator mode (cordis).
If an invalid preset is specified, the command will report an error directly and will not silently fall back to the inherited value.
Version and Compatibility¶
The above content is based on dsh 0.1.2-rc.1 (verified on 2026-09-04, plugin version 1.3.1). The plugin depends on DSH internal APIs, including ctx.agents.create, ctx.workspaceRegistry, ctx.sessions.open, session.deriveMessages(), etc. Upgrading DSH may lead to compatibility issues.
Regarding dependency declarations, peerDependencies are @deepseek-ai/cordis ^4.0.2, @deepseek-ai/dsh-agent-presets ^0.1.2-rc.1, @deepseek-ai/dsh-llm ^0.1.2-rc.1. According to semver pre-release rules, ^0.1.2-alpha.5 does not include rc.1, so the declaration must be raised to ^0.1.2-rc.1.
Use Cases and Considerations¶
Suitable scenarios: DSH users who work for a long time in the same session, where the session size has grown large enough to affect memory and response speed.
A known limitation: Summarization depends on session.deriveMessages(). If the context of a very large session exceeds the model’s window, summarization may fail—at this point, the workflow will still continue: a new conversation will be created and the old session archived, but the new conversation will not include a summary.
Security needs to be clearly stated: The plugin runs with the permissions of the current dsh process. Before installing any community plugins, it is recommended to read the source code first to confirm that the behavior matches expectations. This project uses the MIT license; the source code and license files are in the GitHub repository.
Summary¶
dsh-fresh-start compresses the “summarize current conversation → open new session → archive old session → auto-redirect” workflow for very large sessions into a single /fresh command, with each step independently degrading and presets explicitly specifiable. If your DSH session has started to lag, you can install and try it following the steps above.
- Plugin directory page (Community directory, standalone site): https://www.skillhub.cn/plugins/orangeofcarl0-sys/dsh-fresh-start
- GitHub repository: https://github.com/orangeofcarl0-sys/dsh-fresh-start