From 919b7a6f1f862c838098a9eb8acc02782bd9ff35 Mon Sep 17 00:00:00 2001 From: zhujiruo Date: Mon, 9 Jun 2025 12:28:36 +0800 Subject: [PATCH] fix(web): fix unique key issue - Add unique key attribute to each field in the AgentStrategy component - Correct the tool ID generation logic in the AgentNode component (multiToolSelector) --- .../workflow/nodes/_base/components/agent-strategy.tsx | 1 + web/app/components/workflow/nodes/agent/node.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx index de23602e34..e2945487e9 100644 --- a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx +++ b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx @@ -120,6 +120,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => { title={<> {renderI18nObject(def.label)} {def.required && *} } + key={def.variable} tooltip={def.tooltip && renderI18nObject(def.tooltip)} inline > diff --git a/web/app/components/workflow/nodes/agent/node.tsx b/web/app/components/workflow/nodes/agent/node.tsx index 57ad2a0b81..d2267fd00f 100644 --- a/web/app/components/workflow/nodes/agent/node.tsx +++ b/web/app/components/workflow/nodes/agent/node.tsx @@ -54,9 +54,9 @@ const AgentNode: FC> = (props) => { const field = param.name const value = inputs.agent_parameters?.[field]?.value if (value) { - (value as unknown as any[]).forEach((item) => { + (value as unknown as any[]).forEach((item, idx) => { tools.push({ - id: `${param.name}-${i}`, + id: `${param.name}-${idx}`, providerName: item.provider_name, }) })