前言¶
在 DeepSeek Harness(DSH)裏用 Agent Teams 時,Team Lead 可以拉起多個子成員並行幹活,但官方實驗包默認並不在創建成員時把「用哪家 provider、哪條 model、思考強度 reasoning effort」逐成員傳下去。若你希望某個成員走便宜模型、另一個走強推理模型,或者統一由管理員鎖定路由,就需要在 spawn 接縫上補一層策略。下面介紹社區插件 dsh-agent-team-model-selection(維護者 devloom1024,分類:模型推理),它替換官方 @deepseek-ai/dsh-experimental-tool-agent-team 的同名列註冊(九個 Team 工具名不變),並增加按成員選路、模型目錄查詢與圖形化設置。
這是什麼¶
一句話:DSH 插件,在創建 Agent Teams 成員時指定 LLM 路由(provider / model / reasoning effort),提供 list_team_models 查詢工具,並在 設置 → Agent Teams 模型 配置「自動跟隨 Lead」或「固定路由」兩種策略。
- 倉庫:devloom1024/dsh-agent-team-model-selection
- 目錄頁:SkillHub 插件頁
- 許可證:MIT(當前 package 版本 0.6.0)
- 安裝方式:在 DSH 會話內通過
plugin_manager安裝 bundle,而非憑名稱拼接 CLI 命令
插件同時包含 Host 與 Client 兩半;首次安裝後若設置頁未出現,可先刷新頁面,極端情況下需重啓 DSH 應用。
兩種路由模式¶
設置字段核心是 modelSelection.mode:
| 模式 | 值 | 行爲 |
|---|---|---|
| 自動(默認) | inherit |
不傳路由參數時沿用 Lead 當前路由(Lead 換模型後新繼承行爲仍跟隨);仍可爲單個成員傳 provider、model、reasoning_effort;可開白名單,開啓後僅允許白名單內的顯式 provider/model |
| 固定路由 | fixed |
所有新成員使用配置裏寫死的 provider/model/reasoningEffort;spawn_teammate 一旦帶任何路由參數即報錯 |
自動模式下需注意:白名單隻約束顯式傳入的 provider/model;不傳參數時的繼承、以及只傳 reasoning_effort 的請求不受白名單限制。顯式傳入 provider/model 但未給 effort 時,不繼承 Lead 的思考等級,由該模型解析默認值。固定模式不使用白名單;路由在創建成員前經 LLM 運行時 resolveCallConfig 校驗。
核心功能¶
工具變化¶
| 工具 | 說明 |
|---|---|
spawn_teammate |
新增可選參數 provider、model、reasoning_effort(僅自動模式);隻影響新成員,不改變 Lead 自己會話路由 |
list_team_models |
新增:無參列 provider;傳 provider 列模型;傳 provider+model 列推理強度 |
list_agents |
每行新增 llm,報告成員實際 provider / model / reasoningEffort |
| 其餘 | 與官方一致:send_message、wait_agent、interrupt_agent、team_task_* 等 |
設置頁¶
路徑:Settings → Agent Teams 模型(導航 id agent-team-models,在 Agent Presets 之後)。
- 始終可見:路由模式(自動 / 固定)
- 固定路由:提供方、模型、思考等級(
provider/model/reasoningEffort) - 自動模式:「限制可傳入的路由」開關與
allowedModels列表
只讀部署會禁用控件;保存失敗保留草稿;多頁面併發改設置會提示衝突。舊字段 allowModelOverride 已廢棄,設置頁不再展示。
也可直接改 profile 的 cordis.patch.yml(config 需寫全字段),例如:
- id: tool-agent-team-model-selection
name: dsh-agent-team-model-selection
config:
interrupt: true
freshProvider: spawn
forkProvider: fork
modelSelection:
mode: inherit # inherit | fixed
provider: magpie-anthropic # 僅 fixed
model: zcode/GLM-5.3-Flash # 僅 fixed
reasoningEffort: high # 僅 fixed;留空 = 模型默認
allowedModels: # 僅 inherit;空數組 = 不限制
- provider: magpie-anthropic
model: zcode/GLM-5.3-Flash
安裝與驗證¶
從 GitHub 安裝(推薦)¶
在 DSH 會話中執行:
plugin_manager({ action: "install_bundle", target: "devloom1024/dsh-agent-team-model-selection" })
target 使用 owner/repo 簡寫;需要固定提交或分支時可傳完整 GitHub URL。
從本地目錄安裝¶
plugin_manager({ action: "install_bundle", target: "<本目錄絕對路徑>" })
驗證步驟¶
- 用
cordis_inspect_query或下一輪工具列表確認spawn_teammate有新參數、list_team_models存在。 - 在設置頁確認兩種模式菜單不同且可保存。
- 由 Lead 創建成員,查看返回的
llm字段及成員 session 的request/header裏config.provider/config.model。
若激活失敗,plugin_manager 會報告行狀態;可用 remove_bundle 移除以恢復官方 Team 工具行。
典型用法¶
自動模式:爲單個成員指定路由¶
Lead 在自動模式(inherit)下調用 spawn_teammate,傳入例如 magpie-anthropic、zcode/GLM-5.3-Flash、high。README 中 v0.6.0 本機驗證記錄顯示:成員返回的 model 與 llm 均爲該路由,session header 爲 {"provider":"magpie-anthropic","model":"zcode/GLM-5.3-Flash","reasoningEffort":"high"}。
查模型目錄¶
先無參調用 list_team_models 看 provider,再帶 provider 看模型,必要時帶 model 看可用 reasoning effort,避免手寫無效路由。
固定路由:禁止 spawn 時改路¶
管理員在設置頁切到固定路由並保存 provider/model/effort 後,成員創建時不應再傳路由參數;若傳入,工具報錯:fixed-route mode does not accept spawn route parameters。
適用場景與注意¶
適合誰:在 DSH 裏重度使用 Agent Teams、需要 heterogeneous 模型(Lead 用一套、成員用另一套)或需要組織級鎖定成員路由的團隊。
運行與信任邊界:插件以當前 DSH 進程權限運行,會 hook ctx.subagents.startActivation 並在 bundle patch 中停用官方 tool-agent-team 行。安裝前應閱讀源碼與 MIT 許可證,確認替換官方實驗包的行爲可接受。
限制(來自 README 實現說明):
- 成員重啓後的路由恢復依賴 session 的
request/header;主機重啓後、成員尚未發首請求前,不保證保留路由。 - 官方包若將來原生支持
spawnTeammate路由,應優先用原生能力並考慮移除此插件。 - 倉庫要求 Node >=22;CI 在 Node 22 / 24 跑單元測試。
DSH 生態強調「一切皆插件」;SkillHub 等社區目錄爲獨立站點,與 DeepSeek / 幻方無官方從屬關係。
結尾¶
dsh-agent-team-model-selection 把 Agent Teams 的成員級 LLM 路由、模型發現與策略化配置收到一個 MIT 插件裏:自動模式可繼承 Lead 或按成員 override,固定模式適合統一管控。需要細節與變更記錄時,見 GitHub README 與 SkillHub 目錄頁。