dsh-fusion:把多個 DeepSeek Harness 會話融合成一個可繼續會話

前言

在 DSH 會話流中,研究、實現、審查等步驟經常分散在不同會話裏。單獨看每個會話都有價值,但後續模型如果要基於多個會話繼續工作,就需要一個獨立、持久、可繼續的新會話上下文。dsh-fusion 用來做這件事:它把兩個或多個 DSH 會話的當前文本表面融合成一個新的目標會話,並保留爲 native target-session log events。源會話不會被修改。

這是什麼

dsh-fusion 是一個 omdsh-dev 維護的 DeepSeek Harness bundle,資料說明該倉庫是一個帶 cordis.patch.yml 的 DSH bundle。資料中出現的入口/包名爲 @deepseek-ai/dsh-fusion,許可證爲 MIT。

它不是把源會話合併成一個長期鏈接,而是生成一個 point-in-time snapshot:按當前可見表面、標題、排序與去重規則創建新會話,之後可以像普通會話一樣繼續。

核心功能

  • 融合 2–32 個會話;deployment 默認上限爲 8。
  • 投影消息可以按時間順序排列,也可以按 caller-selected source order 分組。
  • 使用穩定 message id 去重共享 fork 前綴,不折疊偶然相同的文本。
  • 只投影 user 和 assistant 消息中的文本,排除 reasoning、tool calls、tool results。
  • 繼承 caller 的 cwd、provider/model options 和 creation-time agent preset。
  • 當可選 Host Workspace registry 可用時,把 target 掛到 caller/source Workspace group。
  • 標題優先級爲:顯式 title,Agent-planned title,根據源會話標題生成的可讀標題。
  • 默認限制 sources 爲 caller cwd;cross-workspace fusion 需要 deployment 顯式啓用。
  • 可選運行一個臨時、無工具的 DSH Agent,用於判斷融合價值,並返回經過驗證的 pruning、topic-grouping 和 ordering plan。
  • 提供 UI Fuse conversations dialog、/fuse 文本命令、conversation_fuse 模型工具,以及 Service API。

安裝與啓用

安裝

在本地準備插件路徑後,運行:

dsh plugin --profile web add /path/to/dsh-fusion

安裝後需要重啓 DSH。資料給出的重啓說明是:

Restart DSH after installation

啓用條件

被選中的 profile 需要提供以下能力:

agents
commands
sessions
sessionQuery
systemPrompt
tools

啓用後,/fuse 會出現在 slash menu,conversation_fuse 會出現在 model tool catalog。

如果宿主組合提供 invariants service,可以單獨掛載可選入口:

@deepseek-ai/dsh-fusion/invariant

默認 bundle 不啓用該入口。

典型用法

使用 UI 對話框

在任意 DSH conversation Header 中點擊 Fuse conversations。對話框會自動包含當前會話,並列出同一 workspace 中的其他非空會話。

它支持:

  • source 搜索與多選
  • 可選 title;留空時會基於源會話標題生成
  • chronological 或 source-grouped ordering
  • fork-history deduplication
  • optional intelligent Agent planning

創建完成後,新會話會加入同一 Workspace group;資料說明它可以在會話列表中出現後立即打開。

使用 /fuse 文本命令

當前會話會被自動包含,因此命令只需要傳其他 source id:

/fuse <other-session-id> [more-session-ids...]

資料中的例子是從 session-research 發起:

/fuse session-implementation session-review

該命令以 manual mode 運行,不發起額外模型請求,默認使用 chronological ordering 與 fork-prefix deduplication,創建後報告新的 session id。空格和逗號都可作爲分隔符。無效、缺失或跨 workspace 的 source 會在 UI 中直接報告。

調用 conversation_fuse 工具

conversation_fuse 的參數如下:

參數 類型 是否必填 說明
sourceSessionIds string[] 是 至少兩個唯一 source id。
targetSessionId string 否 新 id,默認爲 fusion-<uuid>。
title string 否 新會話標題;默認爲 Agent 建議或源會話標題。
strategy chronological \| by-source 否 默認 chronological。
deduplicate boolean 否 摺疊共享穩定 message id;默認 true。
agentPlanning boolean 否 運行臨時 DSH Agent 判斷/裁剪/分組;默認 false。

資料給出的規範結果包括:新 id、source 與保留數量、Agent-pruned 數量、topic headings、planning reason、retained bytes、strategy,以及是否有 persistence listener 參與。

通過 Service API 調用

其他 Host 插件可以調用:

ctx.conversationFusion.fuse(request, { caller, signal })

caller 需要提供 workspace authority 和 new-agent defaults。即使包含當前會話,也仍需在 sourceSessionIds 中提供其 id。

配置項

資料給出的默認配置如下:

字段 默認值 說明
maxSources 8 每次調用的唯一 sources 數;硬上限 32。
maxMessages 500 保留並原生實例化的投影消息數,先於 byte fitting。
maxFusedBytes 131072 planning/provenance JSON 的 UTF-8 字節上限。
maxMessageBytes 16384 單條消息 UTF-8 字節上限。
maxTitleBytes 160 標題 UTF-8 字節上限。
allowCrossWorkspace false 是否允許與 caller 不同 cwd 的 sources。
enableAgentPlanning true 是否允許請求運行臨時 planning Agent。
plannerMaxTokens 8192 planning Agent 輸出 token 上限,範圍 256 到 8192;當所選模型暴露 effort control 時,planner requests 會禁用 reasoning。

適用場景與注意

適合把多個相關 DSH 會話合併爲後續可繼續上下文的場景,例如需要同時參考研究、實現和審查結果時。

使用時注意:

  • 插件以當前 dsh 進程權限運行;安裝前應檢查源碼與許可證。資料確認許可證爲 MIT。
  • 源會話永不被修改;融合結果是 point-in-time snapshot,不是 live link。
  • manual mode 不發起額外模型請求;intelligent planning 只把 authorized、projected、byte-bounded candidate snapshot 發給臨時 DSH Agent。
  • 臨時 planning Agent 是 tool-free 的,使用 empty tool allowlist;skip verdict 不會創建 target conversation。
  • 默認 sources 被限制在 caller cwd;跨 workspace 融合必須被 deployment 顯式啓用。
  • 被選中的 profile 必須提供 agents、commands、sessions、sessionQuery、systemPrompt 和 tools。

資源

GitHub:

https://github.com/omdsh-dev/dsh-fusion

社區目錄:本資料未給出可確認的目錄頁 URL;可按插件名 dsh-fusion 在 DSH 社區目錄中檢索。

羽毛球分组比赛记分
小程序二维码

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

小夜