xiaoshenming/dsh-session-surgeon
修复拒绝加载的DeepSeek Harness会话。修好打不开的DSH会话文件。
Project Overview项目介绍
This is a DSH-native plugin built exclusively for DeepSeek Harness (DSH) to add two key features missing from the core DSH distribution. You can install it with a single terminal command: dsh plugin --profile web add "github:xiaoshenming/dsh-session-surgeon#main", then restart dsh web to activate it. The first feature lets you copy a DSH session ID from the left sidebar session menu, so you can reference the full old session content in a new chat just like the "continue from thread" workflow in Codex.
The second core feature is repairing corrupted DSH session files that the official DSH loader refuses to load. Common issues it fixes include sequence gaps, torn zstd compression, lone UTF-16 surrogates, missing message IDs, dangling tool calls that cause 400 errors, and other issues reported in official DSH community discussions. It works for both regular DSH end users who need to recover unreadable sessions and for developers who need to debug DSH session format issues.
All operations default to read-only scan or dry-run mode to avoid accidental data loss. When you apply a repair, the plugin will first create a timestamped backup of the original session file ending with .bak.<utc> before writing any changes. It never invents missing content like tool call results or message IDs, only normalizes existing valid data to fit the DSH session format specification. The project is released under the permissive MIT open source license, and it also provides standalone CLI commands for use outside of the DSH web interface.
这是一个专为 DeepSeek Harness(DSH)开发的原生插件,提供两项核心功能:一是支持用户从左侧边栏会话菜单复制已有会话 ID,在新聊天中粘贴该 ID 即可引用旧会话内容,实现类似 Codex 的从旧会话继续对话的能力,填补了原版 DSH 缺失的该项功能。二是修复多种原因导致无法加载的损坏 DSH 会话文件。
普通用户可以通过侧边栏会话菜单复制会话 ID,分享给他人或者直接在新对话中引用,无需复制完整内容即可实现上下文接续。遇到会话无法加载的情况,用户可以通过侧边栏的「会话医生」入口或者 CLI 工具扫描、检查损坏会话,先通过 dry-run 预览问题后再选择应用修复。该工具面向所有 DSH 用户,也方便开发人员调试会话格式相关问题。
该插件兼容 DSH 0.1.2-rc.1 及 0.1.3-alpha 版本的会话格式,遵循已安装的 DSH 运行时规范,默认只读操作,执行修复会先备份原文件到 .bak.<utc>,不会凭空生成缺失内容,导出默认脱敏处理密钥等敏感信息。项目采用 MIT 许可证开源,可通过官方 dsh plugin 命令一键安装,安装后重启 DSH Web 即可使用。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-session-surgeon(xiaoshenming/dsh-session-surgeon)
仓库:https://github.com/xiaoshenming/dsh-session-surgeon
本站详情页:https://www.yhbd.top/plugins/xiaoshenming-dsh-session-surgeon/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 10 · 最近提交 2026-10-03 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- 10 stars - an early-stage project星标 10,属于早期项目
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 desktop add "github:xiaoshenming/dsh-session-surgeon#main"
把 xiaoshenming/dsh-session-surgeon 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-session-surgeon
Copy a session ID from the sidebar ⋯ menu, then paste it into a new chat so the new session can learn from the old one — the Codex-style “continue from this thread” move that stock DSH does not expose.
Also repairs DeepSeek Harness sessions that refuse to load — seq gap, torn zstd, lone surrogates, events missing their message id, and assistant/message / assistant/attempt rows whose settlement fields the seed/restore gate refuses (#8084: seed assistant/message at index N has invalid settlement fields — we name the row and which of turn/step/stream tripped, then repair it: turn/step from the pair the log has open at that seq, and a missing stream as an empty array, the one value both gates admit, leaving message.content, usage and the replay state untouched). inspect also warns on dangling tool/call (no matching tool/result → next model request 400) and on steps that continue a turn the log already closed (#7824: the released walker refuses those with does not match an open turn and step), but will not invent a fake result, a turn boundary, or streamed blocks that are gone. 官方以后修加载器,也救不回已经坏掉的 session.jsonl.zstd。
Verified against
@deepseek-ai/dsh@0.1.7-rc.2and against the0.2.0-rc.2that DSH Desktop bundles — both are format v4, and every gate quoted here is byte-identical in the two (npmlatestandnextmoved to0.2.0-rc.2on 2026-10-01; the same checks were run on0.1.7-rc.1);session.vN.jsonl.zstdfrom every released generation (v0 … v4) is inspected and repaired the same way. Catalog, seq-range handling, and format version follow the installed runtime.
Why copy the session ID
Stock DSH session ⋯ only has rename / fork / archive. There is no “copy ID”.
After this plugin:
Left sidebar, click ⋯ on a session → 复制会话 ID
Open a new chat and paste something like:
Continue from session session-1e66cda9-a046-4893-8f4b-b817080acbea. Read that log if you need prior context.or, for an agent with tools:
session_inspect id=session-1e66cda9-a046-4893-8f4b-b817080acbea Then keep going from where that conversation left off.
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
liangmianya/dsh-synapse
alaliqing/claude-paper
acryldev/acryl
omdsh-dev/dsh-annotation
Anionex/dsh-turn-rewind
Tyan66666/billion-context-dsh
qkycir-123/dsh-run2skill