dsh-plugin-subagent-model-route:在子智能體目錄與會話頭顯示實際模型路由

前言

在 DeepSeek Harness(DSH)裏用子智能體(subagent)做委派時,父會話的目錄列表和子會話界面是兩條最常查看的路徑。默認 UI 會顯示名稱、標題、運行狀態等,但不會把「這次委派實際走了哪條模型路由」寫在你一眼能看到的位置。排查「爲什麼這個子任務用了另一個 provider / 推理檔位」時,往往要額外翻日誌或推斷,成本偏高。

社區插件 dsh-plugin-subagent-model-route(維護者 huhu23333,分類:客戶端)做的是一件事:從已有 durable 投影裏讀出子智能體最後一次請求的模型路由,並在上述兩個界面原位標註出來。它不新增 RPC、不改 host 投影,而是通過佔用(shadow)官方 UI 的兩個 slot 來渲染 badge。下面介紹它改動了哪裏、如何安裝,以及安裝前需要接受的取捨。

這是什麼

dsh-plugin-subagent-model-route 是 DSH 的 client 插件(npm 包名同目錄名)。簡介(與倉庫 README 一致):在父會話 catalog 每一行和子會話 header 兩處,標註該 subagent 實際運行時所使用的 model route。

  • 維護者:huhu23333(GitHub:huhu23333/dsh-plugin-subagent-model-route)
  • 當前版本(package.json):0.1.2
  • 許可證:MIT
  • 兼容聲明:dshReleases 中 0.2.1-alpha.1 標記爲 compatible;Node >= 20

路由文案格式爲 provider/model · reasoningEffort(例如 openai/gpt-5.6-sol · medium、deepseek-official/deepseek-flash · high),與委派執行時一致;過長時在 badge 行換行而不是截斷,tooltip 與無障礙名稱也會重複該路由。

核心功能

插件只改兩個 UI 表面,其餘保持官方 shipped 行爲。

表面 改動前 改動後
父 catalog 每一行 名稱 + 一行 title · one-shot · running 三行:名稱 / one-shot running + 路由 badge / 標題
子會話 header 僅 lineage 麪包屑切換器 麪包屑旁顯示完整路由

路由數據來源:每次 request/header 已記錄的 durable modelSelection 投影,通過與子行已有的 token、耗時相同的 summary.projectionValues 讀取——無新 RPC、無 host 變更、無新 slot 定義。

行爲細節(README 已說明):

  1. 子會話從未發過請求的行:不顯示 badge(表示「從未請求」,不是「未知」)。
  2. 子會話生命週期內若切換模型:badge 只反映最後一次請求的路由。
  3. 與 subagent-director 等同屏使用時,子會話 composer 下方與 header 可能各顯示一次路由,需自行只保留其一。

實現上,官方 @deepseek-ai/dsh-client-ui-subagent 對 conversation.session.header.lineage(single)和 catalog 行沒有可擴展的 additive API,插件因此在 priority: -1 註冊同一 seat,shadow 默認 0 的 shipped 組件(SubagentHeaderLineage、SubagentCatalogAction,後者以相同 id subagent-catalog 再註冊)。

安裝與啓用

插件以 profile bundle 掛載;dsh.client 爲 composition 級配置,修改後必須重啓 host,不能熱加載。

官方支持的安裝方式(會同時寫入 dependencies 與 dsh.profile.bundles):

dsh plugin --profile web add dsh-plugin-subagent-model-route     # from npm
dsh plugin --profile web add ./dsh-plugin-subagent-model-route   # from a checkout

也可手動在 profile 的 package.json 中 link 本地路徑並加入 bundles(需放在 @deepseek-ai/dsh-base、@deepseek-ai/dsh-web-app 之後),例如:

// ~/.dsh/profiles/web/package.json
"dependencies": {
  "dsh-plugin-subagent-model-route": "link:/path/to/dsh-plugin-subagent-model-route"
},
"dsh": { "profile": { "bundles": [
  // ...after @deepseek-ai/dsh-base and @deepseek-ai/dsh-web-app
  "dsh-plugin-subagent-model-route"
] } }

完成後 重啓 DSH host。

卸載:從 profile 的 bundles 移除該包並重啓即可;不持久化任何 host 側狀態,界面恢復官方默認。

典型用法

本插件無獨立 CLI 或配置項:安裝並重啓後,打開帶子智能體 catalog 的父會話即可看到行內 badge;點進某一子會話,header lineage 旁會出現同一路由。

可復現的驗證路徑(與倉庫開發腳本一致,供維護者或二次開發者使用):

npm run check      # typecheck -> build -> headless smoke(16 checks)
npm run preview    # 生成 preview.html,在瀏覽器中查看兩處 seat 的渲染

普通使用者只需完成 profile 安裝與 host 重啓,無需額外配置。

適用場景與注意

適合誰

  • 頻繁委派 subagent、需要在目錄裏快速對比「各子任務實際用的模型與 reasoningEffort」的開發者。
  • 打開子會話時要確認 lineage 與當前路由是否一致、便於和父會話決策對照的場景。

安裝前務必知曉的代價(插件刻意 shadow shipped UI)

  1. Catalog 行高由約 44px 增至 59px(路由換行時可達約 74px),下拉在 min(560px, 100vh - 140px) cap 下可見行數減少(約 12 行降至約 9 行)。
  2. Catalog 契約標記 replaceRisk: 'shadows-shipped-ui';上游若改進同一區域(含官方自行加 model 列),不會自動合併,需按倉庫 PATCH-RECORD.md 重新 vendor 並應用修改。當前 vendored 渲染器 pin 在 deepseek-ai/deepseek-harness master @ 5badb15009。
  3. 該區域 shipped UI 的 bug 也會落在 fork 副本上;樣式表會以第二份 CSS module 注入(hash 不同,一般不衝突)。
  4. Shipped 佔用者仍註冊但渲染爲空,有少量 inert 成本。
  5. 只讀 composer、Sidebar chat、@ 引用源等保持官方,不變。

權限與安全

插件隨當前 DSH client profile 加載,在瀏覽器 / host 進程內與官方 UI 同級運行。安裝前應閱讀倉庫源碼與 MIT 許可證,確認 bundle 來源可信;社區目錄(SkillHub 等)爲獨立站點,與 DeepSeek / 幻方無官方從屬關係。

結尾

dsh-plugin-subagent-model-route 把子智能體「最後一次請求的真實 model route」寫進父 catalog 行與子會話 header,改動的面很窄,但對排查委派與模型選擇足夠直觀。若你同時安裝 subagent-director,注意同一視圖可能重複顯示路由。

  • 社區目錄頁:https://www.skillhub.cn/plugins/huhu23333/dsh-plugin-subagent-model-route
  • 源碼與說明:https://github.com/huhu23333/dsh-plugin-subagent-model-route
羽毛球分组比赛记分
小程序二维码

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

小夜