diff --git a/web/app/components/workflow/run/utils/format-log/agent/data.ts b/web/app/components/workflow/run/utils/format-log/agent/data.ts index 2e0c23b5fb..828a482e9d 100644 --- a/web/app/components/workflow/run/utils/format-log/agent/data.ts +++ b/web/app/components/workflow/run/utils/format-log/agent/data.ts @@ -89,3 +89,39 @@ export const agentNodeData = (() => { }], } })() + +export const oneStepCircle = (() => { + const node = { + node_type: BlockEnum.Agent, + execution_metadata: { + agent_log: [ + { id: '1', label: 'Node 1' }, + { id: '1', parent_id: '1', label: 'Node 1' }, + { id: '1', parent_id: '1', label: 'Node 1' }, + { id: '1', parent_id: '1', label: 'Node 1' }, + { id: '1', parent_id: '1', label: 'Node 1' }, + { id: '1', parent_id: '1', label: 'Node 1' }, + ], + }, + } + + return { + in: [node], + expect: [{ + ...node, + agentLog: [ + { + id: '1', + label: 'Node 1', + hasCircle: true, + }, + ], + }], + } +})() + +export const multiStepsCircle = () => { +} + +export const CircleNestCircle = (() => { +})() diff --git a/web/app/components/workflow/run/utils/format-log/agent/index.ts b/web/app/components/workflow/run/utils/format-log/agent/index.ts index 255dc16c5c..2efa44114c 100644 --- a/web/app/components/workflow/run/utils/format-log/agent/index.ts +++ b/web/app/components/workflow/run/utils/format-log/agent/index.ts @@ -3,6 +3,10 @@ import type { AgentLogItem, AgentLogItemWithChildren, NodeTracing } from '@/type const supportedAgentLogNodes = [BlockEnum.Agent, BlockEnum.Tool] +const removeCircle = (node: NodeTracing) => { + +} + const listToTree = (logs: AgentLogItem[]) => { if (!logs || logs.length === 0) return [] @@ -24,6 +28,7 @@ const listToTree = (logs: AgentLogItem[]) => { }) return tree } + const format = (list: NodeTracing[]): NodeTracing[] => { const result: NodeTracing[] = list.map((item) => { if (supportedAgentLogNodes.includes(item.node_type) && item.execution_metadata?.agent_log && item.execution_metadata?.agent_log.length > 0)