diff --git a/web/app/components/workflow/run/hooks.ts b/web/app/components/workflow/run/hooks.ts index 07534b911d..74ee9719b5 100644 --- a/web/app/components/workflow/run/hooks.ts +++ b/web/app/components/workflow/run/hooks.ts @@ -28,14 +28,20 @@ export const useLogs = () => { setIterationResultDurationMap(iterDurationMap) }, [setShowIteratingDetailTrue, setIterationResultList, setIterationResultDurationMap]) + const [showAgentDetail, { + setTrue: setShowAgentDetailTrue, + setFalse: setShowAgentDetailFalse, + }] = useBoolean(false) + return { - showSpecialResultPanel: !showRetryDetail && !showIteratingDetail, + showSpecialResultPanel: showRetryDetail || showIteratingDetail, showRetryDetail, setShowRetryDetailTrue, setShowRetryDetailFalse, retryResultList, setRetryResultList, handleShowRetryResultList, + showIteratingDetail, setShowIteratingDetailTrue, setShowIteratingDetailFalse, @@ -44,5 +50,9 @@ export const useLogs = () => { iterationResultDurationMap, setIterationResultDurationMap, handleShowIterationResultList, + + showAgentDetail, + setShowAgentDetailTrue, + setShowAgentDetailFalse, } } diff --git a/web/app/components/workflow/run/index.tsx b/web/app/components/workflow/run/index.tsx index f81c2defe7..b4de75fa64 100644 --- a/web/app/components/workflow/run/index.tsx +++ b/web/app/components/workflow/run/index.tsx @@ -106,16 +106,21 @@ const RunPanel: FC = ({ hideResult, activeTab = 'RESULT', runID, getRe }, [loading]) const { + showSpecialResultPanel, + showRetryDetail, setShowRetryDetailFalse, retryResultList, handleShowRetryResultList, + showIteratingDetail, setShowIteratingDetailFalse, iterationResultList, iterationResultDurationMap, handleShowIterationResultList, - showSpecialResultPanel, + + showAgentDetail, + setShowAgentDetailFalse, } = useLogs() return ( @@ -193,6 +198,9 @@ const RunPanel: FC = ({ hideResult, activeTab = 'RESULT', runID, getRe setShowIteratingDetailFalse={setShowIteratingDetailFalse} iterationResultList={iterationResultList} iterationResultDurationMap={iterationResultDurationMap} + + showAgentDetail={showAgentDetail} + setShowAgentDetailFalse={setShowAgentDetailFalse} /> ) } diff --git a/web/app/components/workflow/run/node.tsx b/web/app/components/workflow/run/node.tsx index f8e28ff713..6e5d99fb34 100644 --- a/web/app/components/workflow/run/node.tsx +++ b/web/app/components/workflow/run/node.tsx @@ -13,6 +13,7 @@ import BlockIcon from '../block-icon' import { BlockEnum } from '../types' import { RetryLogTrigger } from './retry-log' import { IterationLogTrigger } from './iteration-log' +import { AgentLogTrigger } from './agent-log' import cn from '@/utils/classnames' import StatusContainer from '@/app/components/workflow/run/status-container' import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor' @@ -76,6 +77,7 @@ const NodePanel: FC = ({ const isIterationNode = nodeInfo.node_type === BlockEnum.Iteration const isRetryNode = hasRetryNode(nodeInfo.node_type) && nodeInfo.retryDetail + const isAgentNode = nodeInfo.node_type === BlockEnum.Agent return (
@@ -139,6 +141,11 @@ const NodePanel: FC = ({ onShowRetryResultList={onShowRetryDetail} /> )} + { + isAgentNode && ( + + ) + }
{(nodeInfo.status === 'stopped') && ( diff --git a/web/app/components/workflow/run/special-result-panel.tsx b/web/app/components/workflow/run/special-result-panel.tsx index 1098e20165..0995ecf1ef 100644 --- a/web/app/components/workflow/run/special-result-panel.tsx +++ b/web/app/components/workflow/run/special-result-panel.tsx @@ -1,5 +1,6 @@ import { RetryResultPanel } from './retry-log' import { IterationResultPanel } from './iteration-log' +import { AgentResultPanel } from './agent-log' import type { IterationDurationMap, NodeTracing } from '@/types/workflow' type SpecialResultPanelProps = { @@ -11,6 +12,9 @@ type SpecialResultPanelProps = { setShowIteratingDetailFalse: () => void iterationResultList: NodeTracing[][] iterationResultDurationMap: IterationDurationMap + + showAgentDetail: boolean + setShowAgentDetailFalse: () => void } const SpecialResultPanel = ({ showRetryDetail, @@ -21,6 +25,9 @@ const SpecialResultPanel = ({ setShowIteratingDetailFalse, iterationResultList, iterationResultDurationMap, + + showAgentDetail, + setShowAgentDetailFalse, }: SpecialResultPanelProps) => { return ( <> @@ -42,6 +49,13 @@ const SpecialResultPanel = ({ /> ) } + { + showAgentDetail && ( + + ) + } ) }