orangeofcarl0-sys/dsh-fresh-start

Plugin插件 Native原生 ⭐ 2 MIT Sessions & Context会话与上下文

DSH /fresh 命令:总结对话,开始新会话,归档旧会话。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH), that adds the /fresh command to DSH. Users can install it directly from this GitHub repository via the DSH CLI with the command dsh plugin --profile web add github:orangeofcarl0-sys/dsh-fresh-start. After installation, you just need to restart dsh web to activate the plugin, and you will see a log entry confirming the /fresh command is registered. The plugin solves performance issues caused by large sessions with hundreds of thousands of events, which slow down context building and increase memory usage.

When you have been working on a large project in DSH, your session will accumulate many historical events that bloat the live event tree. To trigger the workflow, you just type /fresh in the chat input box, and can optionally add a preset name to override the current preset when creating the new session. The full workflow compacts the current context, generates a natural language summary with the LLM, creates a new session with the summary as opening, archives the old session, then jumps automatically to the new session. Every step supports failure fallback, so even if the summary fails, the plugin will still create a new session and archive the old one.

This plugin is currently verified compatible with DSH version 0.1.5-rc.2, and relies on DSH internal APIs, so breaking changes in future DSH versions may cause compatibility issues. The only known limitation is that if the context of an extra large session exceeds the model's context window, the summary may fail. Even if the summary fails, the plugin will still complete the new session creation and old session archiving steps. The plugin is released under the open source MIT license, so it can be used, modified, and distributed freely for any purpose, commercial or non-commercial.

这是一个专为DeepSeek Harness(DSH)开发的原生插件,为DSH添加了/fresh命令。用户可通过DSH CLI直接从GitHub仓库安装该插件,安装后重启DSH即可使用。它的核心功能是一键总结当前对话,创建继承当前工作环境的新会话,归档旧会话释放内存,并自动跳转到新会话继续工作。它解决了超大会话(数十万事件)导致的上下文构建卡顿、内存占用过高的问题。

当用户在DSH中处理大型项目,会话积累了大量历史事件后,只需在对话输入框输入/fresh即可触发完整流程。流程分为四步:先压缩当前上下文,再让大模型生成对话式总结,接着创建带摘要开场的新会话,最后归档旧会话并自动跳转。每一步都支持失败降级,不会阻断整个流程,即使总结失败也会创建新会话并归档旧会话。

该插件当前兼容DSH 0.1.5-rc.2版本,依赖DSH内部API,若DSH大版本升级可能出现兼容性问题。它的已知局限是如果超大会话的上下文超出模型窗口,总结可能失败,但不影响创建新会话和归档。该插件采用MIT许可证开源,可免费使用和修改。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:orangeofcarl0-sys/dsh-fresh-start

把 orangeofcarl0-sys/dsh-fresh-start 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-fresh-start

Version dsh License: MIT

DSH(DeepSeek Harness)/fresh 命令:一键总结当前对话 → 开启新对话(自动跳转)→ 归档老对话。

为什么需要它

超大会话(数十万事件)工作一段时间后,live 事件树越滚越大,每次构建上下文都更慢、更占内存—— 在一个 67 万事件的会话里继续工作,卡顿和内存压力会持续恶化。

/fresh 把这个收尾动作变成一键操作:把历史压缩成一份自然语言摘要,开一个继承当前工作环境 的新会话并把摘要作为开场消息,然后归档老会话释放内存、自动跳转到新会话继续工作。

快速开始

安装

dsh plugin --profile web add github:orangeofcarl0-sys/dsh-fresh-start

插件源为 GitHub 仓库(不走本地路径)。之后插件发新版,同步仓库后更新:

dsh plugin --profile web update dsh-fresh-start

重启 dsh web,日志出现 [fresh-start] installed: /fresh command registered 即成功。 client 插件会随 dsh.client 声明自动进入浏览器清单(/plugins/dsh-fresh-start/client.js 返回 200)。

若 profile 的 cordis.patch.yml 里已有本插件的手工挂载行,请先删除,否则会双实例。

使用

在对话输入框输入 /fresh,可选带 preset 参数:

/fresh            # 继承当前会话的 preset
/fresh standard   # 用指定 preset 开新会话
输入 目标 preset 模式
/fresh standard standard 标准模式
/fresh ptc(或旧输入 code) ptc PTC 模式(Code Mode SDK)
/fresh minimal minimal 极简模式
/fresh create / /fresh creator cordis 创造模式

dsh 0.1.2-alpha.5 把内置 code preset 更名为 ptc 且不留别名;本插件将 ptc 直接作为 preset id 使用,code 仅作旧输入兼容映射到 ptc。

指定不存在的 preset 时命令直接报错,不会静默回退到继承值。

/fresh 的完整流程

/fresh ──▶ ① 压缩(Compact-First)──▶ ② 对话式总结 ──▶ ③ 创建 seeded 新会话
                                                        │
              自动跳转 ◀── ⑤ client 侧匹配 ◀── ④ 归档老会话

① 压缩(Compact-First)

若当前 preset 挂载了宿主压缩引擎(standard/code/cordis),先 compactNow 强制压缩当前 会话——deriveMessages() 跟随 surface shadow 收紧,后续总结请求体显著缩小,并直接复用 压缩摘要。引擎不可用(minimal)、agent busy、无可压缩范围或引擎抛错时安静降级为纯对话式 总结,不阻断流程(spec:docs/COMPACT_FIRST_SPEC.md)。

② 对话式总结

直接提取 dsh 上传给 LLM 的当前上下文(session.requestHeader() 的 system + session.deriveMessages() 的全部消息,已压缩时为收紧后的上下文),用一条简单指令让 LLM 总结成自然语言摘要。

区别于 dsh 原生 /compact(用工程 checkpoint 指令 + token 比较,普通对话上常失败): 本实现把 compact 作为前置收紧、对话总结作为最终 seed 生成器。

③ 创建 seeded 新会话

ctx.agents.create 创建新会话:继承老会话的 cwd 与 agent preset(/fresh <preset> 可覆盖),摘要作为新对话的开场消息(seed),新会话的 header.parentSession 指向老会话。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-session-robustness 下一个 Next dsh-plugin-host →