fix: 修复工作流断点续跑时执行记录复用逻辑

This commit is contained in:
2026-08-24 08:59:29 +08:00
parent f34566d9ad
commit 75fb40274d
3 changed files with 35 additions and 15 deletions
+17 -14
View File
@@ -186,21 +186,24 @@ func resolveValueSource(global *flowDto.FlowExecutionInput, nodeId, field string
}
}
default:
// templates 是模型节点在前端配置的静态输出模板,不在 OutputResult 中,需单独取
if field == "templates" {
value = nodeConfig.Templates
} else {
for _, output := range nodeConfig.OutputResult {
// 模型节点输出记录是单 key 的字面量扁平 key(如 "choices.attrs[0].attrs.delta.attrs.content"),
// gjson 会把 . 和 [0] 当结构路径解析,无法命中字面量 key,故先按字面量 key 直接取值;
// 未命中再回退 gjson 路径查询(兼容真正嵌套的输出结构)。
if v, has := output[field]; has {
value = v
} else {
value = gjson.Get(gconv.String(output), field).Value()
}
if !g.IsEmpty(value) {
return value, gjson.Get(gconv.String(output), CleanFieldPath("refsName")).Value(), true
}
if !g.IsEmpty(nodeConfig.Templates) {
return nodeConfig.Templates, "", true
}
return nil, nil, false
}
for _, output := range nodeConfig.OutputResult {
// 模型节点输出记录是单 key 的字面量扁平 key(如 "choices.attrs[0].attrs.delta.attrs.content"),
// gjson 会把 . 和 [0] 当结构路径解析,无法命中字面量 key,故先按字面量 key 直接取值;
// 未命中再回退 gjson 路径查询(兼容真正嵌套的输出结构)。
if v, has := output[field]; has {
value = v
} else {
value = gjson.Get(gconv.String(output), field).Value()
}
if !g.IsEmpty(value) {
return value, gjson.Get(gconv.String(output), CleanFieldPath("refsName")).Value(), true
}
}
}