diff --git a/packages/service/core/workflow/dispatch/agent/runTool/functionCall.ts b/packages/service/core/workflow/dispatch/agent/runTool/functionCall.ts index 287a9e7a71eb..0ffbcca60b9f 100644 --- a/packages/service/core/workflow/dispatch/agent/runTool/functionCall.ts +++ b/packages/service/core/workflow/dispatch/agent/runTool/functionCall.ts @@ -194,7 +194,10 @@ export const runToolWithFunctionCall = async ( isEntry: true, inputs: updateToolInputValue({ params: startParams, inputs: item.inputs }) } - : item + : { + ...item, + isEntry: false + } ) }); diff --git a/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts b/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts index eac1edc35c9e..8e986d05dbf7 100644 --- a/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts +++ b/packages/service/core/workflow/dispatch/agent/runTool/promptCall.ts @@ -226,7 +226,10 @@ export const runToolWithPromptCall = async ( isEntry: true, inputs: updateToolInputValue({ params: startParams, inputs: item.inputs }) } - : item + : { + ...item, + isEntry: false + } ) }); diff --git a/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts b/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts index e294dff4db73..8aaca1cacc82 100644 --- a/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts +++ b/packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts @@ -209,7 +209,10 @@ export const runToolWithToolChoice = async ( isEntry: true, inputs: updateToolInputValue({ params: startParams, inputs: item.inputs }) } - : item + : { + ...item, + isEntry: false + } ) }); @@ -359,6 +362,7 @@ export const runToolWithToolChoice = async ( }; } } catch (error) { + console.log(error); addLog.warn(`LLM response error`, { requestBody }); diff --git a/packages/service/core/workflow/dispatch/index.ts b/packages/service/core/workflow/dispatch/index.ts index a5fe48657814..29899ba205d8 100644 --- a/packages/service/core/workflow/dispatch/index.ts +++ b/packages/service/core/workflow/dispatch/index.ts @@ -532,9 +532,12 @@ export async function dispatchWorkFlow(data: Props): Promise item.isEntry); // reset entry - // runtimeNodes.forEach((item) => { - // item.isEntry = false; - // }); + runtimeNodes.forEach((item) => { + // Interactive node is not the entry node, return interactive result + if (item.flowNodeType !== FlowNodeTypeEnum.userSelect) { + item.isEntry = false; + } + }); await Promise.all(entryNodes.map((node) => checkNodeCanRun(node))); // focus try to run pluginOutput