Commit d0f96723 by Archer Committed by GitHub

fix: plugin catch (#6643)

parent 064b2ce6
...@@ -68,6 +68,7 @@ CODE_SANDBOX_TOKEN=代码运行沙盒的凭证 ...@@ -68,6 +68,7 @@ CODE_SANDBOX_TOKEN=代码运行沙盒的凭证
14. 用户输入框消息不转义成 markdown 格式 14. 用户输入框消息不转义成 markdown 格式
15. 修复 AgentV2 部分上下文拼接错误。 15. 修复 AgentV2 部分上下文拼接错误。
16. login 接口安全风险。 16. login 接口安全风险。
17. 工作流工具未按预期连接到结束节点时,嵌套调用工作流工具会导致父工作流无法停止。
## 代码优化 ## 代码优化
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
"document/content/docs/self-host/upgrading/4-14/4140.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4140.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4141.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4141.en.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4141.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4141.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/41410.mdx": "2026-03-24T18:02:38+08:00", "document/content/docs/self-host/upgrading/4-14/41410.mdx": "2026-03-25T14:45:38+08:00",
"document/content/docs/self-host/upgrading/4-14/4142.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4142.en.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4142.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4142.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/4-14/4143.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4143.en.mdx": "2026-03-03T17:39:47+08:00",
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
"document/content/docs/self-host/upgrading/4-14/41481.en.mdx": "2026-03-09T12:02:02+08:00", "document/content/docs/self-host/upgrading/4-14/41481.en.mdx": "2026-03-09T12:02:02+08:00",
"document/content/docs/self-host/upgrading/4-14/41481.mdx": "2026-03-09T17:39:53+08:00", "document/content/docs/self-host/upgrading/4-14/41481.mdx": "2026-03-09T17:39:53+08:00",
"document/content/docs/self-host/upgrading/4-14/4149.en.mdx": "2026-03-23T12:17:04+08:00", "document/content/docs/self-host/upgrading/4-14/4149.en.mdx": "2026-03-23T12:17:04+08:00",
"document/content/docs/self-host/upgrading/4-14/4149.mdx": "2026-03-25T13:54:15+08:00", "document/content/docs/self-host/upgrading/4-14/4149.mdx": "2026-03-25T14:45:38+08:00",
"document/content/docs/self-host/upgrading/outdated/40.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/outdated/40.en.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/outdated/40.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/outdated/40.mdx": "2026-03-03T17:39:47+08:00",
"document/content/docs/self-host/upgrading/outdated/41.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/outdated/41.en.mdx": "2026-03-03T17:39:47+08:00",
......
...@@ -669,7 +669,6 @@ export class WorkflowQueue { ...@@ -669,7 +669,6 @@ export class WorkflowQueue {
await this.processSkipNodes(); await this.processSkipNodes();
continue; continue;
} else { } else {
this.resolve(this);
break; break;
} }
} }
...@@ -679,7 +678,6 @@ export class WorkflowQueue { ...@@ -679,7 +678,6 @@ export class WorkflowQueue {
await this.processSkipNodes(); await this.processSkipNodes();
continue; continue;
} else { } else {
this.resolve(this);
break; break;
} }
} }
...@@ -688,7 +686,9 @@ export class WorkflowQueue { ...@@ -688,7 +686,9 @@ export class WorkflowQueue {
if (this.activeRunQueue.size === 0 || runningNodePromises.size >= this.maxConcurrency) { if (this.activeRunQueue.size === 0 || runningNodePromises.size >= this.maxConcurrency) {
if (runningNodePromises.size > 0) { if (runningNodePromises.size > 0) {
// 当上一个节点运行结束时,立即运行下一轮 // 当上一个节点运行结束时,立即运行下一轮
await Promise.race(runningNodePromises); await Promise.race(runningNodePromises).catch((error) => {
logger.error('Workflow race error', { error });
});
} else { } else {
// 理论上不应出现此情况,防御性退回到让出进程 // 理论上不应出现此情况,防御性退回到让出进程
await surrenderProcess(); await surrenderProcess();
...@@ -713,6 +713,7 @@ export class WorkflowQueue { ...@@ -713,6 +713,7 @@ export class WorkflowQueue {
} }
} }
} finally { } finally {
this.resolve(this);
this.processingActive = false; this.processingActive = false;
} }
} }
...@@ -1100,6 +1101,7 @@ export class WorkflowQueue { ...@@ -1100,6 +1101,7 @@ export class WorkflowQueue {
(Array.isArray(toolResponses) && toolResponses.length > 0) || (Array.isArray(toolResponses) && toolResponses.length > 0) ||
(!Array.isArray(toolResponses) && (!Array.isArray(toolResponses) &&
typeof toolResponses === 'object' && typeof toolResponses === 'object' &&
toolResponses !== null &&
Object.keys(toolResponses).length > 0) Object.keys(toolResponses).length > 0)
) { ) {
this.toolRunResponse = toolResponses; this.toolRunResponse = toolResponses;
......
...@@ -229,7 +229,7 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi ...@@ -229,7 +229,7 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi
acc[key] = output.pluginOutput![key]; acc[key] = output.pluginOutput![key];
return acc; return acc;
}, {}) }, {})
: null, : undefined,
[DispatchNodeResponseKeyEnum.customFeedbacks]: customFeedbacks [DispatchNodeResponseKeyEnum.customFeedbacks]: customFeedbacks
}; };
} catch (error) { } catch (error) {
......
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