xiaoshenming/dsh-session-surgeon

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

修复拒绝加载的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 即可使用。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 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.2 and against the 0.2.0-rc.2 that DSH Desktop bundles — both are format v4, and every gate quoted here is byte-identical in the two (npm latest and next moved to 0.2.0-rc.2 on 2026-10-01; the same checks were run on 0.1.7-rc.1); session.vN.jsonl.zstd from 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:

  1. Left sidebar, click ⋯ on a session → 复制会话 ID

  2. 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 →

← 上一个 Prev dsh-browser4 下一个 Next dsh-model-switch →