CACppuccino
dsh-multiagent-enhence
No description
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 15, 2026
- Updated
- Aug 15, 2026
Introduction
dsh-fanout-guidance
让 DeepSeek Harness 的模型更主动地把目标拆成独立单元、并行调用多个 SubAgent 完成的纯 Prompt 引导插件。零运行时依赖、零 DSH 核心改动,只用 systemPrompt 公共 seam。
背景
DSH 源码分析显示:DSH 的多子代理机制(continuable 后台子代理 + settle 通知 + workflow fan-out 引擎)已经齐备,但约束 Prompt 停在"原则性表态"层面——workflow 工具被"ONLY when the user explicitly asks"硬门槛挡住,子代理段只说"start independent delegations together"而没有触发条件与收口纪律。
本插件把三处原则性表态升级为操作化触发条件:
| 变更 | 机制 | 效果 |
|---|---|---|
| ① 放宽 workflow 门槛 | system-prompt/assemble waterfall 改写 tool:workflow 段 | "ONLY when explicitly asks" → "任务清晰分解为 ≥3 个独立件即触发" |
| ② 并行分解启发式 + barrier 收口 + scope 预检 | 注册新段 tool:fanout-guidance(order 116.7,位于 tool:subagent 116.5 与 tool:report 117 之间) | 独立单元同消息并行派发;全部 settle 通知到达后才推进依赖步骤;只委派子代理固定权限范围内的工作 |
| ③ goal 循环 fan-out 绑定 | waterfall 向 tool:goal 段追加条款 | 每个 goal 自动续轮可并行子代理,并带预注册护栏(并行不得改动已注册计划) |
安装
# 1. 作为 web profile 依赖安装(支持本地路径 / git URL)
dsh plugin --profile web add /path/to/dsh-fanout-guidance
# 2. 在 ~/.dsh/cordis.patch.yml 的 insert 列表中加入装配行
- insert:
- id: dsh-fanout-guidance
name: dsh-fanout-guidance
config: {} # 可选,见下
重启 dsh web 后生效(配置层在启动时读取)。也可通过 dsh plugin --profile web add git@github.com:CACppuccino/dsh-multiagent-enhence.git 以 git 依赖方式安装(包名仍为 dsh-fanout-guidance)。
配置
| 键 | 默认 | 说明 |
|---|---|---|
fanoutSection | true | 是否注册 tool:fanout-guidance 策略段 |
fanoutSectionOrder | 116.7 | 策略段在 Prompt 中的顺序(保持 116.5–117 之间即可) |
relaxWorkflowGate | true | 是否改写 workflow 段的显式请求门槛 |
goalFanout | true | 是否给 goal 段追加 fan-out 条款(含预注册护栏) |
全部改写幂等(marker 守护)、容忍缺失段(未装 workflow/goal/subagent 工具的 preset 也能组合)。
验证
node --test "tests/*.test.js" # 单元测试(无外部依赖)
装配层验证:重启后新会话的系统提示中应出现 tool:fanout-guidance 段,且 tool:workflow 段不再以 "ONLY when the user explicitly asks" 开头。
设计要点
- 全局层注册:未加 scope 标签的 section 与 waterfall 监听会被所有 agent scope(根代理、子代理、resume 会话)的装配采纳,因此子代理同样获得并行派发策略。
- waterfall 语义:
system-prompt/assemble的监听返回值是权威的(唯一例外是complete段);本插件原地改写 section 文本后继续next(),与官方测试中的用法一致。 - 上游兼容:不 fork 任何 DSH 包;上游更新
tool:workflow段文案时,正则仅匹配"显式请求门槛"前缀,其余内容原样保留;若上游改了门槛措辞导致正则不再命中,插件静默降级为"不改写"(不会损坏 Prompt)。 - 已知边界:workflow 工具仍在前台运行(阻塞父代理回合),大 fan-out 的 token 成本与 LLM provider 限流不是 Prompt 层能消除的;goal 条款的预注册护栏是 Prompt 级提醒,不能替代 fail-closed 门禁本身。
License
MIT