refactor(dispatcher): T1.1 退役 graph.go —— 编排引擎收成单一 compose
compose 已默认数天、HITL/多智能体/评测全在其上真实跑过,soak 充分。删掉自研拓扑 解释器这第二套引擎,消灭"双实现 drift"税: - 删 runGraph(graph.go 的自研解释器)+ composeEnabled/EINO_COMPOSE 逃生舱开关 + runConversation(仅 runGraph 用的死代码)。 - executeGraph 直接走 runComposeGraph;compose 编译失败兜底改单轮对话(不再回退 graph.go);清掉仅 runGraph 用的 import(otel attribute/trace/otelx)。 - 保留 board / 各节点执行器(retriever/tool/agent/branch/approval/map/render/aggregate) / 工具函数 —— 它们是 compose 各节点 lambda 复用的,非 graph.go 专属。 - 测试:8 处 runGraph→runComposeGraph;等价测试(对照两引擎)转为 compose 正确性测试; runConversation 的开关测试转为「无 ChatModel 降级 runAgent」。 go test ./... 全绿 + vet 干净;冒烟 简单 agent/分支图 跑通。此后每个编排改动不再两边 对齐,成本减半。DEPTH_ROADMAP T1.1 ✅。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -134,7 +134,7 @@ func TestRunGraph_BranchRouting(t *testing.T) {
|
||||
ll := &fakeLLM{ready: true, stream: func(m []llm.ChatMessage) string { return m[0].Content }}
|
||||
run := func(cond string) string {
|
||||
o := newOrch(ll, &fakeTools{}, &fakeSink{}, &fakeExec{})
|
||||
ans, _, err := o.runGraph(context.Background(), task(strings.Replace(g, "%s", cond, 1)), o.tracer("t1"))
|
||||
ans, _, err := o.runComposeGraph(context.Background(), task(strings.Replace(g, "%s", cond, 1)), o.tracer("t1"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -160,7 +160,7 @@ func TestRunGraph_ToolFeedsAgent(t *testing.T) {
|
||||
return &contract.ToolResult{OK: true, Content: "TOOLDATA"}
|
||||
}}
|
||||
o := newOrch(ll, ft, &fakeSink{}, &fakeExec{})
|
||||
ans, _, err := o.runGraph(context.Background(), task(g), o.tracer("t1"))
|
||||
ans, _, err := o.runComposeGraph(context.Background(), task(g), o.tracer("t1"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -186,7 +186,7 @@ func TestRunGraph_MapFanout(t *testing.T) {
|
||||
return "正文XYZ", nil
|
||||
}}
|
||||
o := newOrch(ll, &fakeTools{}, &fakeSink{}, &fakeExec{})
|
||||
ans, _, err := o.runGraph(context.Background(), task(g), o.tracer("t1"))
|
||||
ans, _, err := o.runComposeGraph(context.Background(), task(g), o.tracer("t1"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -203,7 +203,7 @@ func TestRunGraph_OutputRedaction(t *testing.T) {
|
||||
}}
|
||||
fs := &fakeSink{}
|
||||
o := newOrch(ll, &fakeTools{}, fs, &fakeExec{})
|
||||
if _, _, err := o.runGraph(context.Background(), task(g), o.tracer("t1")); err != nil {
|
||||
if _, _, err := o.runComposeGraph(context.Background(), task(g), o.tracer("t1")); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
out := fs.text()
|
||||
|
||||
Reference in New Issue
Block a user