ConradLu2740/dsh-orchestrate ↗★ 0
dsh-orchestrate
Multi-agent orchestration for DeepSeek Harness: delegate, adversarial review, diverse explore, background runs + converge. One prompt. A team of agents.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ConradLu2740/dsh-orchestrate说明文档
阅读完整 README ↗使用
在 dsh Web UI 里对 Agent 说:
并行调研这三个方向:① SQLite vs DuckDB 存储,② RAG chunk 策略,③ 索引方案。
Agent 会主动调用 orchestrate_delegate,返回:
🧩 编排完成(run run-8ca117bf,3/3 成功)
[0] ✅ SQLite 更适合小规模…
[1] ✅ 512-token 重叠 10%…
[2] ✅ HNSW 优于 IVF…
长任务可后台化:run_in_background: true 立即返回 runId,稍后用 orchestrate_converge 收敛。
工具
| 工具 | 作用 |
|---|---|
orchestrate_delegate | 并行拆分:tasks(任务书数组)/ task(单任务)/ template(模板引用:delegations/.yml + templateArgs 占位符填充);并发默认 4、超时默认 10 分钟;支持 run_in_background(后台化)、converge.mode: all/any、retryFailed、role、model(per-run 模型)、maxTokens(软预算);返回结构化汇总(每个结论标注来源子会话) |
orchestrate_review | 对抗式审查:spawn 多个只读审查者子 Agent 挑毛病,返回风险/假设挑战/边界/建议的机械汇总;父 Agent 逐条评估;支持 aspects/reviewers(1-5)/model/maxTokens |
orchestrate_explore | 多样性探索:spawn 多个只读调研者子 Agent 沿独立方向探索,返回带置信度的发现报告;支持 directions(上限 6,超限截断提示)/model/maxTokens |
orchestrate_converge | 收敛后台编排:按 runId 阻塞等待全部子会话完成并返回完整汇总(可重复读) |
orchestrate_status | 查询编排任务与子会话状态(含后台 run 的完成比例) |
orchestrate_stop | 中止进行中的编排任务(子会话以 aborted 收尾) |
后台模式(
run_in_background: true)忽略converge.mode=any与retryFailed(语义不适用,调用时在 note 提示)。
角色(persona)
子 Agent 可指定 role(orchestrate_delegate 参数;review/explore 内定角色):
| role | 视角 | 结构化输出 |
|---|---|---|
executor(默认) | 独立完成子任务并汇报 | { summary, findings[], open_questions[] } |
reviewer | 对抗式审查:风险/假设/边界/建议 | { verdict, risks[], assumptions_challenged[], edge_cases[], suggestions[] } |
researcher | 方向探索,标注置信度 | { summary, findings[], confidence, evidence[] } |
devil | 刁难压力测试:反面论点与推演 | { challenge, counterpoints[], what_if[] } |
行为细节
- 子 Agent 结构化输出:按角色强制对应 schema(官方
structured_output机制)。 - 防递归:每个子 Agent 自动隐藏
orchestrate_*工具(Spike B 验证 one visibility), 且子请求显式传maxDepth=1;toolFilter 降级时深度上限仍生效。 - 决策注入方案 C:
orchestration:policy段按 delegationDepth 过滤——仅根 Agent 可见, 子 Agent 的 prompt 里完全没有该段(2026-08-16 落地)。 - 只读:依赖官方部署 sandbox 默认
read-only(若部署改为 workspace-write,子 Agent 将继承写权限)。 - 失败语义:子会话失败(error/refusal/max-tokens)标记为 failed,partial output 保留;
retryFailed只重试非中止类失败;mode=any在成功数不足但所有任务已结束时返回失败汇总,不会永久等待。 - 成本控制:
converge.timeoutMs超时中止在途子会话;maxTokens软预算(按输出长度 估算 token,超限中止余下子会话,估算值返回在costTokens);任务数上限 20。 - 取消:用户/模型取消当前回合时,在途子会话一并中止(父级信号接入)。
使用限制
task路径不自动拆分(等价单任务);请先自行将父任务拆成任务书数组。- 编排状态存于进程内,重启后需重新编排(跨重启恢复未实现)。
costTokens为估算值(输出长度近似),非官方 token 计数。- 后台 run 受
timeoutMs兜底;收敛语义依赖官方 one-shot 子会话(未用 continuable 后台)。
使用限制
task路径不自动拆分(等价单任务);请先自行将父任务拆成任务书数组。- 编排状态存于进程内,重启后需重新编排(跨重启恢复未实现)。
costTokens为估算值(输出长度近似),非官方 token 计数。- 后台 run 受
timeoutMs兜底;收敛语义依赖官方 one-shot 子会话(未用 continuable 后台)。
配置
| 键 | 默认 | 含义 |
|---|---|---|
provider | spawn | in-process spawn provider 名 |
auto | true | 是否注入 orchestration:policy 决策段(false = 只被动响应) |
denyTools | orchestrate_* | 子 Agent 需隐藏的工具名列表 |
maxDepth | 1 | 子 Agent 递归深度上限 |
templatesDir | 包内 delegations/ | 任务书模板目录(可挂载外部模板库) |
registryCapacity | 100 | registry 保留编排记录上限(超出时淘汰最旧记录) |