From 53907af9f75514340576e34e19ea02a935960e73 Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Fri, 26 Sep 2025 16:01:20 +0800 Subject: [PATCH] fix: loop interactive (#5714) * fix: loop interactive * add buffer time --- document/content/docs/toc.mdx | 1 + document/content/docs/upgrading/4-13/4131.mdx | 19 +++++++++++++++++++ .../content/docs/upgrading/4-13/meta.json | 2 +- document/data/doc-last-modified.json | 2 +- .../core/workflow/dispatch/loop/runLoop.ts | 8 ++++++-- .../core/chat/ChatContainer/ChatBox/index.tsx | 2 +- 6 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 document/content/docs/upgrading/4-13/4131.mdx diff --git a/document/content/docs/toc.mdx b/document/content/docs/toc.mdx index f8e2c465c..a2c6e44f5 100644 --- a/document/content/docs/toc.mdx +++ b/document/content/docs/toc.mdx @@ -108,6 +108,7 @@ description: FastGPT 文档目录 - [/docs/upgrading/4-12/4123](/docs/upgrading/4-12/4123) - [/docs/upgrading/4-12/4124](/docs/upgrading/4-12/4124) - [/docs/upgrading/4-13/4130](/docs/upgrading/4-13/4130) +- [/docs/upgrading/4-13/4131](/docs/upgrading/4-13/4131) - [/docs/upgrading/4-8/40](/docs/upgrading/4-8/40) - [/docs/upgrading/4-8/41](/docs/upgrading/4-8/41) - [/docs/upgrading/4-8/42](/docs/upgrading/4-8/42) diff --git a/document/content/docs/upgrading/4-13/4131.mdx b/document/content/docs/upgrading/4-13/4131.mdx new file mode 100644 index 000000000..e721916e9 --- /dev/null +++ b/document/content/docs/upgrading/4-13/4131.mdx @@ -0,0 +1,19 @@ +--- +title: 'V4.13.1(进行中)' +description: 'FastGPT V4.13.1 更新说明' +--- + + + +## 🚀 新增内容 + + +## ⚙️ 优化 + + +## 🐛 修复 + +1. 循环节点中,每轮结束,未清除上一轮交互响应值。 + +## 🔨 插件更新 + diff --git a/document/content/docs/upgrading/4-13/meta.json b/document/content/docs/upgrading/4-13/meta.json index 6ed99a30c..f86b97b14 100644 --- a/document/content/docs/upgrading/4-13/meta.json +++ b/document/content/docs/upgrading/4-13/meta.json @@ -1,5 +1,5 @@ { "title": "4.13.x", "description": "", - "pages": ["4130"] + "pages": ["4131", "4130"] } diff --git a/document/data/doc-last-modified.json b/document/data/doc-last-modified.json index 0f9821700..03546f7b2 100644 --- a/document/data/doc-last-modified.json +++ b/document/data/doc-last-modified.json @@ -111,7 +111,7 @@ "document/content/docs/upgrading/4-12/4122.mdx": "2025-09-07T14:41:48+08:00", "document/content/docs/upgrading/4-12/4123.mdx": "2025-09-07T20:55:14+08:00", "document/content/docs/upgrading/4-12/4124.mdx": "2025-09-17T22:29:56+08:00", - "document/content/docs/upgrading/4-13/4130.mdx": "2025-09-25T21:02:34+08:00", + "document/content/docs/upgrading/4-13/4130.mdx": "2025-09-26T13:23:01+08:00", "document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00", diff --git a/packages/service/core/workflow/dispatch/loop/runLoop.ts b/packages/service/core/workflow/dispatch/loop/runLoop.ts index 0645fe78f..8619649de 100644 --- a/packages/service/core/workflow/dispatch/loop/runLoop.ts +++ b/packages/service/core/workflow/dispatch/loop/runLoop.ts @@ -44,9 +44,9 @@ export const dispatchLoop = async (props: Props): Promise => { return Promise.reject(`Input array length cannot be greater than ${maxLength}`); } - const interactiveData = + let interactiveData = lastInteractive?.type === 'loopInteractive' ? lastInteractive?.params : undefined; - const lastIndex = interactiveData?.currentIndex; + let lastIndex = interactiveData?.currentIndex; const outputValueArr = interactiveData ? interactiveData.loopResult : []; const loopResponseDetail: ChatHistoryItemResType[] = []; @@ -127,6 +127,10 @@ export const dispatchLoop = async (props: Props): Promise => { interactiveResponse = response.workflowInteractiveResponse; break; } + + // Clear last interactive data, avoid being influenced by the previous round of interaction + interactiveData = undefined; + lastIndex = undefined; } return { diff --git a/projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx b/projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx index e09ff0f34..afe90eb8c 100644 --- a/projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx +++ b/projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx @@ -926,7 +926,7 @@ const ChatBox = ({ chatBoxData?.app?.chatConfig?.autoExecute ], { - wait: 500 + wait: 1000 } );