DeepSHPlugins
dsh-session-surgeon 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-session-surgeon

會話與訊息JavaScriptMIT

修好打不開的 DeepSeek Harness 會話,側欄「會話醫生」可檢視對話並預設 dry-run 修復。

4 Starsxiaoshenming 更新時間 2026-09-08
訪問 GitHub 倉庫
dsh-session-surgeon 專案預覽

專案介紹

中文

修好打不開的 DeepSeek Harness 會話,側欄「會話醫生」可檢視對話並預設 dry-run 修復。

English

Repair DeepSeek Harness sessions that refuse to load, with a sidebar Session surgeon overlay and dry-run repair.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
xiaoshenming
倉庫
xiaoshenming/dsh-session-surgeon
GitHub Stars
4
Forks
1
開發語言
JavaScript
許可證
MIT
最近推送
2026-09-08
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

65/ 100
維護活躍
99
文件與實用資訊
85
生態關注度
26
安裝便捷訊號
100
專案宣告訊號
100

近 3 天仍在更新;README 含完整安裝與使用說明;關注度尚低(4)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

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

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

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. inspect also warns on dangling tool/call (no matching tool/result → next model request 400) but will not invent a fake result. 官方以后修加载器,也救不回已经坏掉的 session.jsonl.zstd。

Compatible with @deepseek-ai/[email protected] and 0.1.3-alpha format generations (session.vN.jsonl.zstd). 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.

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)".

In an agent chat that has this checkout (or the installed plugin skills), 更新插件 is enough: scan official Discussions, absorb in-scope repair feedback, changelog, reply, push main via px (127.0.0.1:7897). See skills/dsh-session-surgeon-update/SKILL.md.

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. If a crash-recovery closer collided with a still-live writer (#1586), repair drops those synthetic closers and keeps the live tail instead of truncating at the first gap. A packed chunk row that overlaps already-committed seqs but continues through the cursor (#5151) keeps the uncommitted suffix. Compact refuses an unloadable file — repair first, with all writers stopped. Alpha compressed sourceEventSeqs ranges (#5160) are native on 0.1.2-rc.1+ (surgeon does not rewrite). Older rc.2 still cannot fold them — repair expands inclusive pairs into dense integers; nothing is invented. A validated Alpha model/selection event is preserved and marked ignorable: true for rc.2; arbitrary unknown plugin events are never changed. Empty tool_calls[].id (#5182) is flagged empty-tool-call-id; repair will not invent an id.

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

commandmeaning
scan [root]list sessions + header health + orphan .tmp
inspect <id>decode every zstd frame, expand packed rows, report seq gaps / missing ids / dangling tool/call
repair <id>default --dry-run; --apply rewrites after .bak.<utc>
compact <id> --keep-last-turns Nkeep 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. Windows: fsync on the read-only backup handle used to abort with EPERM after the copy already succeeded; --apply now treats that as best-effort.
  • 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

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案