fix: preserve repeated shared trace details

This commit is contained in:
Yanli 盐粒 2026-03-18 19:36:03 +08:00
parent 84d1b05501
commit cd9306d4f9
2 changed files with 5 additions and 0 deletions

View File

@ -196,6 +196,7 @@ describe('workflow-stream-handlers helpers', () => {
id: 'iter-trace-2',
node_id: 'iter-1',
status: NodeRunningStatus.Succeeded,
details: undefined,
}))
const loopNextProcess = appendParallelNext(iterFinishedProcess, createTrace({
id: 'loop-trace-2',
@ -205,6 +206,7 @@ describe('workflow-stream-handlers helpers', () => {
id: 'loop-trace-2',
node_id: 'loop-1',
status: NodeRunningStatus.Succeeded,
details: undefined,
}))
expect(loopFinishedProcess.tracing[0]).toEqual(expect.objectContaining({

View File

@ -93,8 +93,11 @@ const finishParallelTrace = (current: WorkflowProcess | undefined, data: NodeTra
draft.expand = true
const traceIndex = findParallelTraceIndex(draft.tracing, data)
if (traceIndex > -1) {
const currentTrace = draft.tracing[traceIndex]
draft.tracing[traceIndex] = {
...currentTrace,
...data,
details: data.details ?? currentTrace.details,
expand: !!data.error,
}
}