fix(canvas): 云端 Agent - 参数错误有限重试并折叠中间失败
This commit is contained in:
1 parent
c80a554c49
commit
6eea2552f8
16 files changed
+396
-15
No files matched your search
@@ -66,7 +66,7 @@ func prepareCloudAgentCanvasMutation(repo *repository.Repository, userID, canvas
|
||||
}
|
||||
beforeHash := cloudAgentCanvasHash(doc)
|
||||
if beforeHash != args.SnapshotHash {
|
||||
return nil, creationConflict("画布已变化,本次未写入;请重新读取并重新申请审批")
|
||||
return nil, &cloudAgentFieldArgumentError{error: &cloudAgentArgumentError{creationConflict("画布已变化,本次未写入;请重新读取并重新申请审批")}, Field: "snapshotHash", Issue: "stale_snapshot"}
|
||||
}
|
||||
items, err := applyCloudAgentCanvasPlan(doc, args.Ops)
|
||||
if err != nil {
|
||||
@@ -86,7 +86,7 @@ func applyCloudAgentCanvasPlan(doc map[string]any, ops []agentCanvasOp) ([]cloud
|
||||
nodes := creationMaps(doc["nodes"])
|
||||
edges := creationMaps(doc["connections"])
|
||||
items := make([]cloudAgentApprovalPreviewItem, 0, len(ops))
|
||||
for _, op := range ops {
|
||||
for opIndex, op := range ops {
|
||||
title, content := "", ""
|
||||
if op.Title != nil {
|
||||
title = *op.Title
|
||||
@@ -133,7 +133,7 @@ func applyCloudAgentCanvasPlan(doc map[string]any, ops []agentCanvasOp) ([]cloud
|
||||
return nil, BadAuthRequest("连线端点不存在或指向自身")
|
||||
}
|
||||
if err := validateCloudAgentConnection(nodes, op.FromNodeID, op.ToNodeID, edges); err != nil {
|
||||
return nil, err
|
||||
return nil, cloudAgentFieldError(fmt.Sprintf("ops[%d]", opIndex), "invalid_connection", cloudAgentSafeToolError(err))
|
||||
}
|
||||
for _, edge := range edges {
|
||||
if stringValue(edge["id"]) == op.ID || (stringValue(edge["fromNodeId"]) == op.FromNodeID && stringValue(edge["toNodeId"]) == op.ToNodeID) {
|
||||
|
||||
Reference in new issue
Block a user