Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: loop single run log (#17329)

zxhlyh78409dfec1c9
diff --git a/web/app/components/workflow/nodes/loop/panel.tsx b/web/app/components/workflow/nodes/loop/panel.tsx
index 55380b939dc..8114160efdc 100644
--- a/web/app/components/workflow/nodes/loop/panel.tsx
+++ b/web/app/components/workflow/nodes/loop/panel.tsx
@@ -1,5 +1,5 @@
import type { FC } from 'react'
-import React from 'react'
+import React, { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { RiAddLine } from '@remixicon/react'
import Split from '../_base/components/split'
@@ -51,7 +51,21 @@ const Panel: FC<NodePanelProps<LoopNodeType>> = ({
handleUpdateLoopVariable,
} = useConfig(id, data)
- const nodeInfo = formatTracing(loopRunResult, t)[0]
+ const nodeInfo = useMemo(() => {
+ const formattedNodeInfo = formatTracing(loopRunResult, t)[0]
+
+ if (runResult && formattedNodeInfo) {
+ return {
+ ...formattedNodeInfo,
+ execution_metadata: {
+ ...runResult.execution_metadata,
+ ...formattedNodeInfo.execution_metadata,
+ },
+ }
+ }
+
+ return formattedNodeInfo
+ }, [runResult, loopRunResult, t])
const logsParams = useLogs()
return (