Merge pull request 'Complete the delegation task brief with output format and tool sections (Q3 WP3)' (#101) from feature/q3-delegation-template into main
ci / vet-and-test (push) Successful in 1m15s

Merge pull request 'Complete the delegation task brief with output format and tool sections (Q3 WP3)' (#101) from feature/q3-delegation-template into main
This commit was merged in pull request #101.
This commit is contained in:
2026-10-08 03:33:06 +00:00
3 changed files with 13 additions and 2 deletions
+8
View File
@@ -248,6 +248,14 @@ func SubagentFactory(rc Ctx) subagent.Factory {
if len(req.Deliverables) > 0 {
b.WriteString("\n交付物:" + strings.Join(req.Deliverables, ", "))
}
// Q3 WP3:任务书四要素补全——目标、输出格式、工具和边界。空声明
// 不落节(沿用子代理画像默认)。
if strings.TrimSpace(req.OutputFormat) != "" {
b.WriteString("\n输出格式:" + req.OutputFormat)
}
if len(req.Tools) > 0 {
b.WriteString("\n工具面(可用工具,不得越界):" + strings.Join(req.Tools, ", "))
}
// Background(N2 WP5):声明驱动后台派生,语义同产品 delegate 的
// background 参数;完成结果经通知队列回投,本次调用立即返回 run ID。
// rc 无后台能力(测试桩/旧宿主)时回落同步派生,不 fail-closed。
+4 -1
View File
@@ -85,6 +85,8 @@ func TestSubagentFactoryBridgesSpawnSubagent(t *testing.T) {
Goal: "查证数据", Inputs: "docs/v2", WriteScope: "research/",
NonGoals: "不做实现", DoneCriteria: "三来源对照",
Deliverables: []string{"notes.md"},
OutputFormat: "Markdown:结论先行,附对照表",
Tools: []string{"web_search", "read_file"},
})
if err != nil {
t.Fatal(err)
@@ -92,7 +94,8 @@ func TestSubagentFactoryBridgesSpawnSubagent(t *testing.T) {
if !res.Success || res.Text != "子代理结论" {
t.Fatalf("bridge result wrong: %+v", res)
}
for _, want := range []string{"查证数据", "docs/v2", "research/", "不做实现", "三来源对照", "notes.md"} {
for _, want := range []string{"查证数据", "docs/v2", "research/", "不做实现", "三来源对照", "notes.md",
"输出格式:Markdown:结论先行,附对照表", "工具面(可用工具,不得越界):web_search, read_file"} {
if !strings.Contains(rc.gotTask, want) {
t.Fatalf("task brief missing %q:\n%s", want, rc.gotTask)
}