From 3ea185315d571565d66541271c6faf36646fc807 Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Mon, 9 Sep 2024 14:14:32 +0800 Subject: [PATCH] fix: workflow clear repeat check run (#2646) --- packages/service/core/workflow/dispatch/index.ts | 9 ++++----- projects/app/src/pages/api/common/system/getInitData.ts | 7 ++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/service/core/workflow/dispatch/index.ts b/packages/service/core/workflow/dispatch/index.ts index c6003e9996b3..7b437efefa8b 100644 --- a/packages/service/core/workflow/dispatch/index.ts +++ b/packages/service/core/workflow/dispatch/index.ts @@ -303,8 +303,8 @@ export async function dispatchWorkFlow(data: Props): Promise { @@ -331,11 +331,13 @@ export async function dispatchWorkFlow(data: Props): Promise { if (status === 'run') { + nodeRunBeforeHook(node); props.maxRunTimes--; addLog.debug(`[dispatchWorkFlow] nodeRunWithActive: ${node.name}`); return nodeRunWithActive(node); } if (status === 'skip' && !skippedNodeIdList.has(node.nodeId)) { + nodeRunBeforeHook(node); props.maxRunTimes -= 0.1; skippedNodeIdList.add(node.nodeId); addLog.debug(`[dispatchWorkFlow] nodeRunWithSkip: ${node.name}`); @@ -502,8 +504,6 @@ export async function dispatchWorkFlow(data: Props): Promise { // Set target edges status to skipped const targetEdges = runtimeEdges.filter((item) => item.source === node.nodeId); - nodeRunAfterHook(node); return { node, diff --git a/projects/app/src/pages/api/common/system/getInitData.ts b/projects/app/src/pages/api/common/system/getInitData.ts index 2d904adb9196..84a569fb4205 100644 --- a/projects/app/src/pages/api/common/system/getInitData.ts +++ b/projects/app/src/pages/api/common/system/getInitData.ts @@ -10,7 +10,12 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { data: { feConfigs: global.feConfigs, subPlans: global.subPlans, - llmModels: global.llmModels, + llmModels: global.llmModels.map((model) => ({ + ...model, + customCQPrompt: '', + customExtractPrompt: '', + defaultSystemChatPrompt: '' + })), vectorModels: global.vectorModels, reRankModels: global.reRankModels?.map((item) => ({