dshbase

插件目录 / Developer / dsh-session-surgeon

dsh-session-surgeon

未验证 xiaoshenming

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

2Stars
0Forks
0未关闭 issue
语言
2026-08-19最近推送
跨平台平台

功能简介

Repair DeepSeek Harness sessions that refuse to load. 修好打不开的 DSH 会话文件。

我们的评价
未验证 — 尚未实测

Repair DeepSeek Harness sessions that refuse to load. 修好打不开的 DSH 会话文件。 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

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, and events missing their message id. 官方以后修加载器,也救不回已经坏掉的 session.jsonl.zstd

Compatible with @deepseek-ai/[email protected].

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.
    

The ID is the durable handle (with or without the session- prefix — same session). Fork duplicates a file; copying the ID lets a new session refer to the old one, the way people pass a Codex thread id around.

Install

One command, same as other DSH plugins:

dsh plugin --profile web add "github:xiaoshenming/dsh-session-surgeon#main"

Restart dsh web. Then:

  • Session ⋯ menu: 复制会话 ID (the everyday action) / inspect / dry-run repair
  • Sidebar 会话医生 / Session surgeon: browse conversations, copy id, dry-run repair, apply repair, compact preview, export JSONL

Developers working in a checkout can still use dsh plugin --profile web add link:"$(pwd)".

Also: repair unloadable sessions

Real crash families from official Discussions:

  • #317 stack overflow on huge history
  • #1497 / #1586 seq gap in committed region
  • #436 lone UTF-16 surrogate → permanent HTTP 400
  • #674 leftover .tmp plaintext

Default repair is dry-run. --apply writes .bak.<utc> first, never invents missing seqs, and fills missing message ids without dropping events.

CLI

No dsh web required after the plugin (or this repo) is on disk:

npx --yes github:xiaoshenming/dsh-session-surgeon scan
npx --yes github:xiaoshenming/dsh-session-surgeon inspect <session-id>
npx --yes github:xiaoshenming/dsh-session-surgeon repair <session-id>          # dry-run
npx --yes github:xiaoshenming/dsh-session-surgeon repair <session-id> --apply  # writes .bak.<utc> first

Or from a clone: node bin/dsh-session-surgeon.mjs scan.

Agent tools after install: session_scan / session_inspect / session_repair (apply defaults to false).

Commands

command meaning
scan [root] list sessions + header health + orphan .tmp
inspect <id> decode every zstd frame, expand packed rows, report seq gaps
repair <id> default --dry-run; --apply rewrites after .bak.<utc>
compact <id> --keep-last-turns N keep the last N complete turns, renumber seq from 0
export <id> JSONL dump; redacts secrets unless --no-redact
index [root] session / parent / goal / health table

--format text prints a human table. Exit 0 on success, 2 on usage error, 1 on not-found / refuse.

What this is not

Not a marketplace, not a token heatmap, not a memory plugin, not a Codex task store.

DSH has session id + optional same-session goal id, not a Codex-style resumable task id. Copying the session ID is the closest everyday equivalent. See docs/LEARNING-TASKS.md.

Docs

Safety

  • Default is read-only. Write paths require --apply and write .bak.<utc> first.
  • Never commit raw files from ~/.dsh/sessions (they contain user text and secrets).
  • Do not put @deepseek-ai/dsh-tools in dependencies.
  • Export redacts sk-*, PEM blocks, and home paths unless --no-redact.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-session-surgeon」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:xiaoshenming/dsh-session-surgeon

Headless(CLI)profile:

dsh plugin --profile headless add github:xiaoshenming/dsh-session-surgeon

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-26 · 标记 webonly
备注:验证: web-only;待 L4 web CDP;L4 web CDP runtime-fail on dsh 0.1.0-rc.8. 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7789 个插件 →