前言¶
在 DeepSeek Harness (DSH) 的开发场景中,智能体逻辑通常涉及多个子智能体的协作。直接在代码中调用 ctx.subagents 容易产生重复逻辑,且难以统一管理策略。dsh-team-runner 旨在解决这一问题,它将 subagents 的连接点封装为可复用的、受策略控制的智能体团队。
是什么¶
dsh-team-runner 是一个 DeepSeek Harness 插件,由用户 tkr520521 维护,许可证为 MIT。
其核心价值在于将分散的 subagents 调用转化为标准的“团队”定义。用户可以预先定义包含规划、撰写、审阅等角色的团队,通过统一的工具接口调用,从而简化多智能体编排流程。
核心功能¶
该插件提供以下核心能力:
- team_run:将团队定义作为单个工具运行,支持提示注入。
- team_list:列出当前可用的团队定义。
- team_delegate:委托给团队内的特定子智能体,允许动态替换。
- 策略门控:通过
maxConcurrentDelegations限制并发委托数量,防止资源耗尽。 - 团队编排:通过
ctx.subagents协调规划器、编写者、审阅者等角色的执行顺序。
安装与启用¶
安装该插件需要指定一个 profile。
dsh plugin --profile <name> add dsh-team-runner
前置依赖:
插件运行需要特定的子智能体提供者,通常包括 spawn 或 fork。
配置文件要求:
需要在 profile 的配置中添加 cordis.patch.yml,以启用插件提供的工具。
典型用法¶
在 cordis.patch.yml 中配置团队定义。以下示例定义了一个名为 writing 的团队,包含规划、撰写和审阅三个角色:
- insert:
- id: dsh-team-runner
name: dsh-team-runner
config:
provider: spawn
maxConcurrentDelegations: 3
teams:
- name: writing
agents:
- role: planner
prompt: 'Plan the task: outline goals, steps, and acceptance criteria.'
- role: writer
prompt: 'Write the full deliverable following the plan.'
- role: reviewer
prompt: 'Review the deliverable for correctness and quality; report issues.'
配置完成后,可以通过以下命令调用团队:
Use team_run with team "writing" on: ...
注意事项与适用场景¶
适用场景:
适合需要固定工作流(如规划 -> 撰写 -> 审阅)的场景,或者需要将多个子智能体组合成标准化组件的项目。
注意事项:
1. 配置依赖:必须确保 profile 中正确配置了 cordis.patch.yml。
2. 子智能体提供者:必须安装并配置支持 spawn 或 fork 的子智能体提供者。
3. 运行权限:插件以当前 DSH 进程的权限运行,需注意安全沙箱策略。
结语¶
dsh-team-runner 为 DeepSeek Harness 提供了标准化的团队编排能力。通过将 subagents 的连接点转化为可复用的团队定义,它降低了多智能体协作的复杂度。更多信息可参考插件目录或GitHub 仓库。