diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.ts index cb795f195a..b7e717de2b 100644 --- a/web/app/components/workflow/hooks/use-checklist.ts +++ b/web/app/components/workflow/hooks/use-checklist.ts @@ -62,12 +62,14 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => { if (node.data.type === BlockEnum.Agent) { const data = node.data as AgentNodeType + const isReadyForCheckValid = !!strategyProviders const provider = strategyProviders?.find(provider => provider.declaration.identity.name === data.agent_strategy_provider_name) const strategy = provider?.declaration.strategies?.find(s => s.identity.name === data.agent_strategy_name) moreDataForCheckValid = { provider, strategy, language, + isReadyForCheckValid, } } diff --git a/web/app/components/workflow/nodes/agent/default.ts b/web/app/components/workflow/nodes/agent/default.ts index 26c004b188..3ece9d44bc 100644 --- a/web/app/components/workflow/nodes/agent/default.ts +++ b/web/app/components/workflow/nodes/agent/default.ts @@ -21,8 +21,15 @@ const nodeDefault: NodeDefault = { strategyProvider?: StrategyPluginDetail, strategy?: StrategyDetail language: string + isReadyForCheckValid: boolean }) { - const { strategy, language } = moreDataForCheckValid + const { strategy, language, isReadyForCheckValid } = moreDataForCheckValid + if (!isReadyForCheckValid) { + return { + isValid: true, + errorMessage: '', + } + } if (!strategy) { return { isValid: false,