From 45a64dbbacacf3dd1c872ce8447eb62c55e0ede2 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 3 Mar 2026 11:15:14 +0800 Subject: [PATCH] fix(web): agent's variables init update --- web/src/views/ApplicationConfig/Agent.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/src/views/ApplicationConfig/Agent.tsx b/web/src/views/ApplicationConfig/Agent.tsx index 4bee291b..6018c600 100644 --- a/web/src/views/ApplicationConfig/Agent.tsx +++ b/web/src/views/ApplicationConfig/Agent.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:29:21 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-25 18:11:49 + * @Last Modified time: 2026-03-03 11:14:30 */ import { type FC, type ReactNode, useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react'; import clsx from 'clsx' @@ -175,6 +175,10 @@ const Agent = forwardRef((_props, ref) => { const parsedMemoryContent = memoryContent === null || memoryContent === '' ? undefined : !isNaN(Number(memoryContent)) ? Number(memoryContent) : memoryContent + const variableList = variables?.map((item, index) => ({ + ...item, + index + })) || [] form.setFieldsValue({ ...response, tools: allTools, @@ -185,9 +189,10 @@ const Agent = forwardRef((_props, ref) => { skills: { ...skills, skill_ids: allSkills - } + }, + variables: [...variableList] }) - updateVariableList([...variables]) + updateVariableList([...variableList]) setData({ ...response, tools: allTools