fix(agent): 画布助手 - 避免未支持节点阻断整张画布

This commit is contained in:
ddCat
2026-09-15 09:27:00 +08:00
parent 18d4bcbca6
commit 40aca20f4d
5 changed files with 63 additions and 4 deletions

View File

@@ -462,10 +462,13 @@ func cloudAgentCanvasSummary(canvas *model.CanvasProject) (string, error) {
break
}
descriptor, known := cloudAgentNodeCapabilityForType(node.Type)
if !known {
return "", BadAuthRequest("画布包含当前 Agent 不支持的节点类型")
}
item := map[string]any{"id": truncateRunes(node.ID, 100), "type": truncateRunes(node.Type, 40), "title": truncateRunes(node.Title, 300)}
if !known {
item["agentSupported"] = false
item["agentUnsupportedReason"] = "仅展示基础信息;当前 Agent 不支持操作此类型节点"
nodes = append(nodes, item)
continue
}
projected, err := cloudAgentProjectNodeFields(map[string]any{"title": node.Title}, node.Metadata, descriptor, descriptor.SummaryFields, 600, false, 0)
if err != nil {
return "", err