Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): fix unique key issue (#20809) (#20810)

HyaCinth945d1569ee26
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 674c768aa5d..4ca8746137b 100644
--- a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx
+++ b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx
@@ -118,6 +118,7 @@ export const AgentStrategy = memo((props: AgentStrategyProps) => {
title={<>
{renderI18nObject(def.label)} {def.required && <span className='text-red-500'>*</span>}
</>}
+ 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 57ad2a0b814..d2267fd00fb 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<NodeProps<AgentNodeType>> = (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,
})
})