dsh-resume-plugin:在 DeepSeek Harness 中繼續 Codex 與 Claude Code 會話

前言

在 DeepSeek Harness(DSH)中,插件和技能可以擴展會話處理流程。dsh-resume-plugin 面向一個具體場景:你已經有一段 Codex 或 Claude Code 的外部會話記錄,希望把其中的工作上下文帶到當前 DSH 會話中繼續處理。

它會先將選定的外部會話記錄作爲不可信的靜態歷史讀取,生成簡潔的工作交接摘要,覈驗當前倉庫狀態,然後在當前 DeepSeek Harness 會話中繼續工作。插件不會啓動 Codex 或 Claude Code,也不會把任務重新委派給它們。

這是什麼

dsh-resume-plugin 是一個 DSH 插件,提供兩個內置技能:

  • /resume-codex
  • /resume-claude

它的定位是把外部 Agent 的會話記錄轉成當前 DSH 會話可用的交接上下文,而不是調用原 Agent 繼續執行。

倉庫地址爲:

https://github.com/Demogorgon314/dsh-resume-plugin

許可證爲 MIT。package.json 聲明版本爲 0.1.0。

package.json 中的 peerDependencies 爲:

"@deepseek-ai/cordis": "^4.0.1",
"@deepseek-ai/dsh-skill": ">=0.1.0-rc.5 <1"

核心功能

會話恢復

dsh-resume-plugin 提供兩個技能:

  • /resume-codex:讀取 Codex 會話並繼續工作。
  • /resume-claude:讀取 Claude Code 會話並繼續工作。

讀取後,插件會生成簡潔的工作交接摘要,覈驗當前倉庫狀態,並在當前 DeepSeek Harness 會話中繼續工作。

邊界

該插件只做靜態歷史讀取和上下文交接:

  • 不會啓動 Codex。
  • 不會啓動 Claude Code。
  • 不會把任務重新委派給 Codex 或 Claude Code。

讀取處理

共享讀取器會對外部會話記錄做以下處理:

  • 排除 system/developer 消息。
  • 排除 reasoning/thinking 內容。
  • 將恢復出來的內容明確標記爲靜態歷史。
  • 限制工具文本長度。
  • 報告格式錯誤及未知記錄。
  • 要求技能在繼續工作前重新覈驗相關即時狀態。

安裝與啓用

環境要求

使用前,環境需要滿足以下要求:

  • 包含 @deepseek-ai/dsh-skill >= 0.1.0-rc.5 的 DeepSeek Harness。
  • Node.js ^22.19.0 或 >=24。
  • Python 3。
  • 只有讀取壓縮的 Codex .jsonl.zst 文件時才需要 zstd。

從 GitHub 安裝

下面命令將插件安裝到 web profile:

dsh plugin --profile web add -w github:Demogorgon314/dsh-resume-plugin

如果需要安裝到其他 profile,可以替換 web:

dsh plugin --profile <profile> add -w github:Demogorgon314/dsh-resume-plugin

這裏的 -w(--workspace-root)表示確認將插件安裝到所選 DSH profile 的 pnpm workspace 根目錄。省略它可能觸發 ERR_PNPM_ADDING_TO_ROOT。

從本地源碼安裝

在包含本倉庫的父目錄中執行:

dsh plugin --profile <profile> add -w ./dsh-resume-plugin

如果當前目錄就是本倉庫,將路徑改爲 .:

dsh plugin --profile <profile> add -w .

檢查安裝結果

安裝後可以用下面的命令查看 profile 配置:

dsh --profile <profile> --dump-config

輸出中應包含:

- id: resume-foreign-session
  name: dsh-resume-plugin

典型用法

繼續最近會話

繼續當前項目最近的 Codex 會話:

/resume-codex latest

繼續最近的 Claude Code 會話:

/resume-claude latest

按會話 ID 恢復

也可以使用 Codex 會話 ID:

/resume-codex 00000000-0000-4000-8000-000000000001

按標題關鍵詞恢復

也可以用標題關鍵詞選擇 Claude Code 會話:

/resume-claude 修復登錄流程

如果標題關鍵詞匹配多個會話,插件會列出候選項並要求選擇,不會自行猜測。

安全模型與注意

外部會話記錄可能包含惡意提示、過期的工具輸出、敏感信息,或只適用於原始 Agent 的指令。因此,插件將這些內容視爲不可信靜態歷史,而不是直接可執行的指令。

共享讀取器會執行以下約束:

  • 排除 system/developer 消息及 reasoning/thinking 內容。
  • 將恢復出來的內容明確標記爲靜態歷史。
  • 限制工具文本長度。
  • 報告格式錯誤及未知記錄。
  • 要求技能在繼續工作前重新覈驗相關即時狀態。

dsh-resume-plugin 會作爲 DSH 插件在 DeepSeek Harness 中運行。由於它會讀取外部會話記錄並參與當前會話上下文,安裝前應檢查源碼、依賴和許可證。

結尾

dsh-resume-plugin 的價值在於把 Codex 與 Claude Code 的歷史會話作爲可控的靜態上下文接入 DeepSeek Harness,幫助開發者在當前 DSH 會話中繼續工作,而不是重新委託給原 Agent。

倉庫地址:

https://github.com/Demogorgon314/dsh-resume-plugin
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜