From 88ab86734def8fdb9c5db8dd12818f361ede3e2a Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 30 Jan 2026 12:19:23 +0800 Subject: [PATCH] fix(web): the memoryContent field is compatible with numbers and strings --- web/src/views/ApplicationConfig/Agent.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/views/ApplicationConfig/Agent.tsx b/web/src/views/ApplicationConfig/Agent.tsx index 77e90440..5d749f3c 100644 --- a/web/src/views/ApplicationConfig/Agent.tsx +++ b/web/src/views/ApplicationConfig/Agent.tsx @@ -126,12 +126,16 @@ const Agent = forwardRef((_props, ref) => { getApplicationConfig(id as string).then(res => { const response = res as Config let allTools = Array.isArray(response.tools) ? response.tools : [] + const memoryContent = response.memory?.memory_content + const parsedMemoryContent = memoryContent === null || memoryContent === '' + ? undefined + : !isNaN(Number(memoryContent)) ? Number(memoryContent) : memoryContent form.setFieldsValue({ ...response, tools: allTools, memory: { ...response.memory, - memory_content: response.memory?.memory_content ? Number(response.memory?.memory_content) : undefined + memory_content: parsedMemoryContent } }) setData({