dsh-orchestrator:同一 Harness 進程內的原生多智能體編排

前言

在 DeepSeek Harness(DSH)裏同時跑多個 agent 時,開發者往往要自己在終端裏切會話、靠外部工具猜誰在執行什麼、誰又卡在審批上。這種方式和 Harness 進程內的實時註冊表、事件日誌是割裂的,排查「哪條任務掛了」成本高。

haroon0x/dsh-orchestrator 是社區維護的工作流類插件,在同一 DSH 進程內提供 Orchestrator 預設與四組 fleet 工具,直接讀取 ctx.agents 與各 session 已提交的事件日誌,用於查看、深查、單向發信和協作式中斷其他 live agent,不依賴終端複用器、外部 CLI 或抓屏。

這是什麼

插件包名爲 @haroon0x/dsh-orchestrator(當前資料中版本爲 0.1.0),維護者爲 haroon0x,許可證 MIT。它面向「在同一 Harness 進程裏管理多條並行 agent」的場景:一次安裝會注入 Orchestrator agent 預設,併爲運行該預設的 agent 開放四枚專用工具;其他預設的工具目錄與提示詞不會被改動,註冊在 step 時通過 when 校驗當前預設。

目錄頁:https://www.skillhub.cn/plugins/haroon0x/dsh-orchestrator
源碼與說明:https://github.com/haroon0x/dsh-orchestrator

核心功能

Orchestrator 預設

預設出現在 Settings → Agent presets 與新會話選擇器中。在標準管理向工具集(shell、文件、搜索、jobs、schedule、skills、goals、compaction、delegation、web、todo 等)之上,額外掛載四枚 fleet 工具。插件還貢獻一段 role 說明,描述管理循環該怎麼用。

Orchestrator 可通過 subagent 拉起 worker;默認 worker 使用 standard 預設(可在 cordis.patch.yml 裏改 agentPreset),避免嵌套出更多 orchestrator。

四枚 fleet 工具

僅對運行 Orchestrator 預設的 agent 開放:

工具 作用
fleet_roster 列出當前 live agent(運行中的靠前),含狀態、當前 tool call、最後一條 assistant 消息、預設、模型、turn/step、最近活動間隔、父子關係、排隊輸入、todo 進度等
fleet_inspect 單 agent 深度視圖:近期消息、未完成 tool call、待審批、排隊輸入、todos、goal、子 agent
fleet_message 向任意 live agent 投遞單向消息;運行中目標下一步收到,空閒目標會開新 turn
fleet_interrupt 請求取消目標 agent 當前 turn,可選保留或清空其排隊輸入

可見性從何來

每次調用都從進程級註冊表 ctx.agents 實時讀取,無緩存、無輪詢。活動狀態由各 session 已提交事件日誌(最近 240 條)推導:未配對的 tool/call、未回應的 approval/asked、開放的 ask_user_question、最後一條 assistant/message 等。標題、todos、goal、收件箱等衍生狀態來自 ctx.sessionProjections,roster 側按顯式 key 列表讀取,避免無關投影開銷。

安裝與啓用

資料中的手動安裝示例如下。將 link: 後的路徑換成本地插件目錄的實際路徑。

dsh plugin --profile web add link:/path/to/dsh-orchestrator

隨後在 profile 的 dsh.profile.bundles 中加入該 bundle,並與既有基礎包一併聲明:

{
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "@haroon0x/dsh-orchestrator"
      ]
    }
  }
}

刷新 Web 應用。通過 Plugin Manager 與 HMR 時,鏈接包可在重組合時替換;若在 Plugin Manager 外手動安裝,有時需要重啓進程。

運行環境要求(來自 package.json):Node >=22.19.0。

啓用步驟:

  1. 安裝 bundle(插件管理器或上述 install_bundle / 手動 link 方式,以你當前 DSH 文檔爲準)。
  2. 用 Orchestrator 預設開新會話,或在 Settings → Agent presets 中將其設爲新建任務的默認預設。
  3. 向 Orchestrator 描述管理意圖,由它調用 fleet 工具 observability 與干預。

也可通過 DSH 插件管理器安裝該 bundle,具體入口以你使用的 DSH 版本界面爲準。

典型用法

README 中的可復現意圖示例(交給 Orchestrator 會話即可):

  • 「看我剛啓動的三個 agent,哪個卡住了」
  • 「停掉 docs agent,並告訴它等 API 變更」

Orchestrator 用 fleet_roster 看艦隊概況,用 fleet_inspect 定位卡點,再用 fleet_message / fleet_interrupt 下發指令或取消 turn。目標不會把回覆直接寫回 Orchestrator 對話;結果需通過 roster 觀察,或僅當 Orchestrator 自己拉起該 agent 時纔有約定內的自動回傳路徑。

適用場景與注意

適合誰: 在同一臺機器、同一個 dsh 進程裏並行多條 coding / 調研類 agent,並希望有一個「班長」會話統一讀狀態、發消息、中斷 runaway turn 的開發者。

設計邊界(資料原文):

  • 單向消息:fleet_message 不建立對話迴路。
  • 僅同進程:其他 dsh 進程裏的 agent 不可見,這是 live registry,不是跨主機總線。
  • 輸出有界:roster 默認 20 行(最多 50);fleet_inspect 默認最近 8 條消息(最多 30)。
  • 自保護:fleet_message / fleet_interrupt 拒絕對調用者自身 id;roster 對應當前行標記爲 self。
  • 中斷爲協作式:fleet_interrupt 發出取消請求後即返回,目標可能短暫仍爲 running。
  • 預設耦聯:orchestrator 預設複製了發佈時的 standard 插件列表;DSH 升級若改動 standard 組成,需自行改 cordis.patch.yml。

安全與權限: 插件以當前 DSH 進程權限運行,Orchestrator 能調用的 shell、文件與 fleet 工具與 harness 配置一致。安裝前請查閱源碼與 MIT 許可證,確認 bundle 來源可信。社區目錄 skillhub.cn 爲獨立生態站點,與 DeepSeek / 幻方無官方從屬關係。

插件自帶測試(假 Cordis 上下文,無需完整 DSH 安裝):

npm test

結尾

dsh-orchestrator 把「看艦隊、查單個、發信、打斷」收進 DSH 原生插件與 Orchestrator 預設,避免爲 multi-agent 另搭一套外部監控。若你已在同一進程裏用 subagent 拆任務,可以把它當作編排面的默認入口。

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

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

小夜