fix(desktop,dispatcher): 从编排执行的多 agent 图看不到「团队」tab
现象:编排里并排三个 agent(研究/撰写/审查)跑完,运行页没有团队 tab。 两处卡住,不是一处: 1) isMultiAgent 只认 coordinator: 节点。用户自己在图里并排多个 agent 也是 团队,却被整个漏掉。改成:有协调者,或 ≥2 个 agent: 节点。 2) 就算放宽 1,deriveTeam 仍按 kind==="agent" 挑工位——而两条产生 agent 的 路径 kind 并不一致:协调者派发的专家是 kind=agent,图里的 agent 节点是 kind=model。改成按节点名前缀(agent:/tool:)判,这本来就是后端一直遵守的 约定;顺带天然把 retriever:/map:/render: 这些同为 kind=tool 的节点挡在 工位之外(之前它们会混进来当工位)。 连带修一个更要命的:runAgent 把轨迹标签写死成"模型流式推理"、runReactAgent 写死成"ReAct 智能体(自主调工具)",用户在编排里给节点起的名字(研究 Agent / 撰写 Agent / 审查 Agent)整个丢了。后果不止办公室:执行轨迹里三行同名,根本 分不出谁是谁;团队视图只能退回节点 ID,工位显示成 r/w/rev。 改成一律 labelOf(n, 兜底) 由调用方传入,+2 单测钉住。 另:没有协调者时不再凭空画一个"协调者"小人(白板改挂「任务产出」),也不演 递简报那一程(没人可递),✓ 气泡改为收工即冒。 注意:已存的历史轨迹是落库的,仍是旧标签;只有新跑的任务才有节点名。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -16,17 +16,17 @@ import (
|
||||
// runComposeConversation 用 Eino compose.Graph 跑对话主流程:
|
||||
// START → ChatModel 节点 → END,编译为 Runnable 后流式执行;可观测经 callbacks 桥到 ExecEvent。
|
||||
// 模型未就绪 / 编译失败时降级回 runAgent(同样的流式回流,保证不回归)。
|
||||
func (o *Orchestrator) runComposeConversation(ctx context.Context, taskID string, b *board, system string, tr *execTracer, node string) {
|
||||
func (o *Orchestrator) runComposeConversation(ctx context.Context, taskID string, b *board, system string, tr *execTracer, node, label string) {
|
||||
cm := o.pool.ChatModel()
|
||||
if cm == nil {
|
||||
o.runAgent(ctx, taskID, b, system, tr, node) // 无模型 → 降级桩
|
||||
o.runAgent(ctx, taskID, b, system, tr, node, label) // 无模型 → 降级桩
|
||||
return
|
||||
}
|
||||
|
||||
g := compose.NewGraph[[]*schema.Message, *schema.Message]()
|
||||
if err := g.AddChatModelNode("model", cm); err != nil {
|
||||
tr.info(node, "system", "compose 降级", "建图失败,退回自研路径:"+err.Error())
|
||||
o.runAgent(ctx, taskID, b, system, tr, node)
|
||||
o.runAgent(ctx, taskID, b, system, tr, node, label)
|
||||
return
|
||||
}
|
||||
_ = g.AddEdge(compose.START, "model")
|
||||
@@ -34,7 +34,7 @@ func (o *Orchestrator) runComposeConversation(ctx context.Context, taskID string
|
||||
r, err := g.Compile(ctx)
|
||||
if err != nil {
|
||||
tr.info(node, "system", "compose 降级", "编译失败,退回自研路径:"+err.Error())
|
||||
o.runAgent(ctx, taskID, b, system, tr, node)
|
||||
o.runAgent(ctx, taskID, b, system, tr, node, label)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user