diff --git a/deps/agent-native b/deps/agent-native index 1ac21c6..37c5e6f 160000 --- a/deps/agent-native +++ b/deps/agent-native @@ -1 +1 @@ -Subproject commit 1ac21c68d4e2c2728d92d6db67a30ff06e0066d3 +Subproject commit 37c5e6fbd65c69cc794ce476f3bed020aafd9eef diff --git a/internal/squadadapter/adapter.go b/internal/squadadapter/adapter.go index 51d1490..cff3128 100644 --- a/internal/squadadapter/adapter.go +++ b/internal/squadadapter/adapter.go @@ -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。 diff --git a/internal/squadadapter/adapter_test.go b/internal/squadadapter/adapter_test.go index 64cf621..e61c06d 100644 --- a/internal/squadadapter/adapter_test.go +++ b/internal/squadadapter/adapter_test.go @@ -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) }