Commit 003e6688 by Archer Committed by GitHub

fix: loop filter (#6033)

parent 48aaa73f
...@@ -14,6 +14,8 @@ description: 'FastGPT V4.14.4 更新说明' ...@@ -14,6 +14,8 @@ description: 'FastGPT V4.14.4 更新说明'
## 🐛 修复 ## 🐛 修复
1. 循环节点数组,取消过滤空内容。
2. 工作流工具,未传递自定义 DataId,导致测试运行时,查看知识库提示无权限。
## 插件 ## 插件
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"document/content/docs/introduction/development/migration/docker_db.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/migration/docker_db.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/migration/docker_mongo.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/migration/docker_mongo.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/modelConfig/ai-proxy.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/modelConfig/ai-proxy.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/modelConfig/intro.mdx": "2025-08-12T22:22:18+08:00", "document/content/docs/introduction/development/modelConfig/intro.mdx": "2025-12-03T08:36:19+08:00",
"document/content/docs/introduction/development/modelConfig/one-api.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/modelConfig/one-api.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/modelConfig/ppio.mdx": "2025-09-29T11:52:39+08:00", "document/content/docs/introduction/development/modelConfig/ppio.mdx": "2025-09-29T11:52:39+08:00",
"document/content/docs/introduction/development/modelConfig/siliconCloud.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/modelConfig/siliconCloud.mdx": "2025-08-05T23:20:39+08:00",
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
"document/content/docs/upgrading/4-14/4141.mdx": "2025-11-19T10:15:27+08:00", "document/content/docs/upgrading/4-14/4141.mdx": "2025-11-19T10:15:27+08:00",
"document/content/docs/upgrading/4-14/4142.mdx": "2025-11-18T19:27:14+08:00", "document/content/docs/upgrading/4-14/4142.mdx": "2025-11-18T19:27:14+08:00",
"document/content/docs/upgrading/4-14/4143.mdx": "2025-11-26T20:52:05+08:00", "document/content/docs/upgrading/4-14/4143.mdx": "2025-11-26T20:52:05+08:00",
"document/content/docs/upgrading/4-14/4144.mdx": "2025-11-29T09:24:47+08:00", "document/content/docs/upgrading/4-14/4144.mdx": "2025-12-01T21:46:30+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+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/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
......
...@@ -56,7 +56,7 @@ export const dispatchLoop = async (props: Props): Promise<Response> => { ...@@ -56,7 +56,7 @@ export const dispatchLoop = async (props: Props): Promise<Response> => {
let interactiveResponse: WorkflowInteractiveResponseType | undefined = undefined; let interactiveResponse: WorkflowInteractiveResponseType | undefined = undefined;
let index = 0; let index = 0;
for await (const item of loopInputArray.filter(Boolean)) { for await (const item of loopInputArray) {
// Skip already looped // Skip already looped
if (lastIndex && index < lastIndex) { if (lastIndex && index < lastIndex) {
index++; index++;
......
...@@ -190,6 +190,7 @@ const PluginRunContextProvider = ({ ...@@ -190,6 +190,7 @@ const PluginRunContextProvider = ({
abortRequest(); abortRequest();
const abortSignal = new AbortController(); const abortSignal = new AbortController();
chatController.current = abortSignal; chatController.current = abortSignal;
const responseChatItemId = getNanoid(24);
setChatRecords([ setChatRecords([
{ {
...@@ -201,7 +202,7 @@ const PluginRunContextProvider = ({ ...@@ -201,7 +202,7 @@ const PluginRunContextProvider = ({
status: 'finish' status: 'finish'
}, },
{ {
dataId: getNanoid(24), dataId: responseChatItemId,
obj: ChatRoleEnum.AI, obj: ChatRoleEnum.AI,
value: [ value: [
{ {
...@@ -231,6 +232,7 @@ const PluginRunContextProvider = ({ ...@@ -231,6 +232,7 @@ const PluginRunContextProvider = ({
try { try {
await onStartChat({ await onStartChat({
messages, messages,
responseChatItemId,
controller: chatController.current, controller: chatController.current,
generatingMessage, generatingMessage,
variables: { variables: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment