From 83fcabadaea7799bd1341abf66c34b05a00f0275 Mon Sep 17 00:00:00 2001 From: Eternity <1533512157@qq.com> Date: Thu, 19 Mar 2026 12:04:48 +0800 Subject: [PATCH 1/8] fix(workflow): fix incorrect file message display in non-streaming calls --- api/app/services/workflow_service.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/api/app/services/workflow_service.py b/api/app/services/workflow_service.py index 6503fe25..04a778a1 100644 --- a/api/app/services/workflow_service.py +++ b/api/app/services/workflow_service.py @@ -636,30 +636,33 @@ class WorkflowService: final_messages = result.get("messages", [])[init_message_length:] human_message = "" assistant_message = "" + human_meta = { + "files": [] + } for message in final_messages: if message["role"] == "user": if isinstance(message["content"], str): human_message += message["content"] elif isinstance(message["content"], list): for file in message["content"]: - if file.get("type") == FileType.IMAGE: - human_message += f"![image]({file.get('url', '')})" - else: - human_message += f"[{file.get('type')}]({file.get('url', '')})" + human_meta["files"].append({ + "type": file.get("type"), + "url": file.get("url") + }) if message["role"] == "assistant": assistant_message = message["content"] self.conversation_service.add_message( conversation_id=conversation_id_uuid, role="user", content=human_message, - meta_data=None + meta_data=human_meta ) self.conversation_service.add_message( message_id=message_id, conversation_id=conversation_id_uuid, role="assistant", content=assistant_message, - meta_data={"usage": token_usage} + meta_data={"usage": token_usage, "audio_url": None} ) self.update_execution_status( execution.execution_id, From ebd51928d73237a53d4f0dc6dd4ec5516b50631a Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 19 Mar 2026 13:42:06 +0800 Subject: [PATCH 2/8] fix(web): workflow memory not allowed change --- web/src/components/ButtonCheckbox/index.tsx | 6 ++++-- web/src/components/Chat/ChatContent.tsx | 4 ++-- web/src/views/Conversation/index.tsx | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/src/components/ButtonCheckbox/index.tsx b/web/src/components/ButtonCheckbox/index.tsx index 41824fd1..18bca7c6 100644 --- a/web/src/components/ButtonCheckbox/index.tsx +++ b/web/src/components/ButtonCheckbox/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-02 15:01:59 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-17 15:35:34 + * @Last Modified time: 2026-03-19 13:41:26 */ /** @@ -42,7 +42,8 @@ const ButtonCheckbox: FC = ({ icon, checkedIcon, children, - cicle = false + cicle = false, + disabled, }) => { // Listen to value changes and trigger side effects via onValueChange callback useEffect(() => { @@ -70,6 +71,7 @@ const ButtonCheckbox: FC = ({ "rb:bg-[rgba(21,94,239,0.06)] rb:border-[rgba(21,94,239,0.25)] rb:hover:bg-[rgba(21,94,239,0.06)] rb:text-[#155EEF]": checked, // Unchecked state: gray border and dark text "rb:border-[#DFE4ED] rb:text-[#212332]": !checked, + "rb:opacity-65 rb:cursor-not-allowed!": disabled })} onClick={handleChange} > diff --git a/web/src/components/Chat/ChatContent.tsx b/web/src/components/Chat/ChatContent.tsx index c73d91f5..c77e8384 100644 --- a/web/src/components/Chat/ChatContent.tsx +++ b/web/src/components/Chat/ChatContent.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2025-12-10 16:46:17 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-19 10:37:01 + * @Last Modified time: 2026-03-19 13:38:20 */ import { type FC, useRef, useEffect, useState } from 'react' import clsx from 'clsx' @@ -118,7 +118,7 @@ const ChatContent: FC = ({ {labelFormat(item)} } - {item.meta_data?.files && item.meta_data?.files.length > 0 && + {item.meta_data?.files && item.meta_data?.files.length > 0 && {item.meta_data?.files?.map((file) => { if (file.type.includes('image')) { return ( diff --git a/web/src/views/Conversation/index.tsx b/web/src/views/Conversation/index.tsx index 9774a8df..3a726746 100644 --- a/web/src/views/Conversation/index.tsx +++ b/web/src/views/Conversation/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:58:03 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-18 20:54:00 + * @Last Modified time: 2026-03-19 12:30:41 */ /** * Conversation Page @@ -63,6 +63,7 @@ const Conversation: FC = () => { const [isHasMemory, setIsHasMemory] = useState(false) const [memory, setMemory] = useState(true) const [features, setFeatures] = useState({} as FeaturesConfigForm) + const [config, setConfig] = useState>({}) useEffect(() => { const shareToken = localStorage.getItem(`shareToken_${token}`) @@ -88,6 +89,7 @@ const Conversation: FC = () => { .then(res => { const response = res as { variables: Variable[]; features: FeaturesConfigForm; app_type: string; memory?: boolean; } toolbarRef.current?.setVariables(response.variables || []) + setConfig(response) setFeatures(response.features) setIsHasMemory((response.app_type === 'workflow' && response.memory) || (response.app_type !== 'workflow')) }) @@ -284,6 +286,7 @@ const Conversation: FC = () => { } const handleChangeMemory = (value: boolean) => { + if (config.app_type === 'workflow') return; modal.confirm({ title: value ? t('memoryConversation.memoryTipTitle') : t('memoryConversation.memoryCancelTipTitle'), okText: t('common.confirm'), @@ -388,6 +391,7 @@ const Conversation: FC = () => { icon={MemoryFunctionIcon} checkedIcon={MemoryFunctionCheckedIcon} checked={memory} + disabled={config.app_type === 'workflow'} onChange={handleChangeMemory} > {t('memoryConversation.memory')} From c5cfe557da577eb84d03cdb8dc7dc11b47df20d6 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 19 Mar 2026 14:31:54 +0800 Subject: [PATCH 3/8] fix(web): change file size limit --- .../components/FeaturesConfig/FileUploadSettingModal.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx index f30b5aa8..818fd559 100644 --- a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx +++ b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-03-05 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-19 09:59:42 + * @Last Modified time: 2026-03-19 14:31:20 */ import { forwardRef, useImperativeHandle, useState } from 'react'; import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd'; @@ -58,7 +58,7 @@ const defaultValues: FileUpload = { document_max_size_mb: 100, document_allowed_extensions: ['pdf', 'docx', 'xlsx', 'txt', 'csv', 'json'], video_enabled: false, - video_max_size_mb: 500, + video_max_size_mb: 100, video_allowed_extensions: ['mp4', 'mov', 'avi', 'webm'], max_file_count: 5, allowed_transfer_methods: 'both' @@ -161,7 +161,7 @@ const FileUploadSettingModal = forwardRef
{t('application.singleMaxSize')}:
- +
From d523e4f3c68533d93cc2c8efb021a4a343ce9162 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 19 Mar 2026 14:59:59 +0800 Subject: [PATCH 4/8] fix(web): change file count limit --- .../components/FeaturesConfig/FileUploadSettingModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx index 818fd559..6825a6bf 100644 --- a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx +++ b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-03-05 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-19 14:31:20 + * @Last Modified time: 2026-03-19 14:59:34 */ import { forwardRef, useImperativeHandle, useState } from 'react'; import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd'; @@ -127,7 +127,7 @@ const FileUploadSettingModal = forwardRef{t('application.maxCount')} - + From 86a0aa1f9f429c5026b3485685ff4f7fcb047634 Mon Sep 17 00:00:00 2001 From: lixiangcheng1 Date: Thu, 19 Mar 2026 15:08:50 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E3=80=90fix]Nested=20query=20of=20folder?= =?UTF-8?q?=20knowledge=20base=20retrieve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/core/rag/nlp/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app/core/rag/nlp/search.py b/api/app/core/rag/nlp/search.py index 56f6ba47..f6f04e3b 100644 --- a/api/app/core/rag/nlp/search.py +++ b/api/app/core/rag/nlp/search.py @@ -146,7 +146,7 @@ def _retrieve_for_knowledge( return results, chat_model, embedding_model # Folder 类型:递归处理子知识库 - if db_knowledge.type == knowledge_model.KnowledgeType.Folder: + if db_knowledge.type == knowledge_model.KnowledgeType.FOLDER: children = knowledge_repository.get_knowledges_by_parent_id(db=db, parent_id=db_knowledge.id) for child in children: if not (child and child.chunk_num > 0 and child.status == 1): From b018e35ada274451e290ff0776151625cdf12418 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 19 Mar 2026 15:19:05 +0800 Subject: [PATCH 6/8] fix(web): update file type --- .../FeaturesConfig/FileUploadSettingModal.tsx | 63 ++++++++++++++++--- 1 file changed, 53 insertions(+), 10 deletions(-) diff --git a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx index 6825a6bf..3fb05a0e 100644 --- a/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx +++ b/web/src/views/ApplicationConfig/components/FeaturesConfig/FileUploadSettingModal.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-03-05 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-19 14:59:34 + * @Last Modified time: 2026-03-19 15:18:20 */ import { forwardRef, useImperativeHandle, useState } from 'react'; import { Form, InputNumber, Flex, Switch, Row, Col, Radio } from 'antd'; @@ -27,22 +27,43 @@ const fileTypeOptions = [ { type: 'document', icon:
, - formats: 'TXT, PDF, DOC, DOCX, XLSX, CSV, JSON', + formats: [ + "pdf", + "docx", + "doc", + "xlsx", + "xls", + "txt", + "csv", + "json", + "md", + ], }, { type: 'image', icon:
, - formats: 'JPG, JPEG, PNG, GIF, WEBP', + formats: [ + "png", + "jpg", + "jpeg" + ], }, { type: 'audio', icon:
, - formats: 'MP3, M4A, WAV, OGG, FLAC', + formats: [ + "mp3", + "wav", + "m4a", + ], }, { type: 'video', icon:
, - formats: 'MP4, MOV, AVI, WEBM', + formats: [ + "mp4", + "mov", + ], }, ]; @@ -50,16 +71,38 @@ const defaultValues: FileUpload = { enabled: false, image_enabled: false, image_max_size_mb: 20, - image_allowed_extensions: ['png', 'jpg', 'jpeg', 'gif', 'webp'], + image_allowed_extensions: [ + "png", + "jpg", + "jpeg" + ], audio_enabled: false, audio_max_size_mb: 50, - audio_allowed_extensions: ['mp3', 'wav', 'm4a', 'ogg', 'flac'], + audio_allowed_extensions: [ + "mp3", + "wav", + "m4a", + "ogg", + "flac" + ], document_enabled: false, document_max_size_mb: 100, - document_allowed_extensions: ['pdf', 'docx', 'xlsx', 'txt', 'csv', 'json'], + document_allowed_extensions: [ + "pdf", + "docx", + "xlsx", + "txt", + "csv", + "json" + ], video_enabled: false, video_max_size_mb: 100, - video_allowed_extensions: ['mp4', 'mov', 'avi', 'webm'], + video_allowed_extensions: [ + "mp4", + "mov", + "avi", + "webm" + ], max_file_count: 5, allowed_transfer_methods: 'both' } @@ -149,7 +192,7 @@ const FileUploadSettingModal = forwardRef
{t(`application.${option.type}`)}
-
{option.formats}
+
{option.formats.map(item => item.toUpperCase()).join(', ')}
From f045b59b2d7c25da4dc214a4c166c3d4cbee83f7 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 19 Mar 2026 16:07:42 +0800 Subject: [PATCH 7/8] fix(web): ui update --- web/src/components/Chat/ChatInput.tsx | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/web/src/components/Chat/ChatInput.tsx b/web/src/components/Chat/ChatInput.tsx index 508b0d0c..7daf935c 100644 --- a/web/src/components/Chat/ChatInput.tsx +++ b/web/src/components/Chat/ChatInput.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2025-12-10 16:46:14 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-06 13:36:20 + * @Last Modified time: 2026-03-19 16:05:56 */ import { type FC, useEffect, useMemo } from 'react' import { Flex, Input, Form } from 'antd' @@ -109,15 +109,20 @@ const ChatInput: FC = ({ } return (
- {(file.type.includes('doc') || file.type.includes('docx') || file.type.includes('word') || file.type.includes('wordprocessingml.document')) &&
} - {(file.type.includes('pdf')) &&
} - {(file.type.includes('excel') || file.type.includes('spreadsheetml.sheet') || file.type.includes('csv')) &&
} + {file.type.includes('pdf') + ?
+ : (file.type.includes('excel') || file.type.includes('spreadsheetml.sheet') || file.type.includes('csv')) + ?
+ : (file.type.includes('doc') || file.type.includes('docx') || file.type.includes('word') || file.type.includes('wordprocessingml.document')) + ?
+ : null + }
{file.name}
{file.type} · {file.size}
From 6bc4f04293bfcb550723e14cb95c34a2bc0cb251 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 19 Mar 2026 17:14:43 +0800 Subject: [PATCH 8/8] fix(web): add loading --- web/src/i18n/en.ts | 1 + web/src/i18n/zh.ts | 1 + .../ApplicationConfig/components/ConfigHeader.tsx | 4 ++-- .../components/CommunityNetwork.tsx | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index dd5746e4..7ff1f30a 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1564,6 +1564,7 @@ export const en = { summary: 'Summary', core_entities: 'Core Entities', communityDetailEmptyDesc: 'Click on a community in the chart on the left to view details', + communityLoadingTip: 'Generating community graph', }, space: { createSpace: 'Create Space', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index f7a84f00..49a1b803 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -1562,6 +1562,7 @@ export const zh = { summary: '摘要', core_entities: '核心实体', communityDetailEmptyDesc: '点击左侧图表中的社区查看详情', + communityLoadingTip: '社区图谱生成中', }, space: { createSpace: '创建空间', diff --git a/web/src/views/ApplicationConfig/components/ConfigHeader.tsx b/web/src/views/ApplicationConfig/components/ConfigHeader.tsx index e2e1cf6f..77977a82 100644 --- a/web/src/views/ApplicationConfig/components/ConfigHeader.tsx +++ b/web/src/views/ApplicationConfig/components/ConfigHeader.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:27:52 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-18 21:25:23 + * @Last Modified time: 2026-03-19 17:13:54 */ import { type FC, useRef, useMemo, useCallback } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; @@ -212,7 +212,7 @@ const ConfigHeader: FC = ({ className={styles.tabs} />
- {application?.type === 'workflow' && source !== 'sharing' + {application?.type === 'workflow' && source !== 'sharing' && activeTab === 'arrangement' ?
diff --git a/web/src/views/UserMemoryDetail/components/CommunityNetwork.tsx b/web/src/views/UserMemoryDetail/components/CommunityNetwork.tsx index 2757498d..75316693 100644 --- a/web/src/views/UserMemoryDetail/components/CommunityNetwork.tsx +++ b/web/src/views/UserMemoryDetail/components/CommunityNetwork.tsx @@ -1,6 +1,8 @@ import React, { useState, type FC, useEffect } from 'react' import { useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' +import { Spin, Flex } from 'antd'; + import type { CommunityD3Node, CommunityGraphData, RawCommunityGraphData, RawCommunityNode } from '@/components/D3Graph/types' import { buildCommunityGraphData } from '@/components/D3Graph/utils' import CommunityGraph from '@/components/D3Graph/CommunityGraph' @@ -40,14 +42,17 @@ const NodeTooltip: FC<{ node: CommunityD3Node }> = ({ node }) => { const CommunityNetwork: FC<{ onSelectCommunity?: (node: RawCommunityNode) => void }> = ({ onSelectCommunity }) => { const { id } = useParams() + const { t } = useTranslation() const [graphData, setGraphData] = useState(null) const [empty, setEmpty] = useState(false) + const [loading, setLoading] = useState(false) useEffect(() => { if (!id) return const controller = new AbortController() setEmpty(false) setGraphData(null) + setLoading(true) getMemoryCommunityGraph(id, { signal: controller.signal }).then(res => { const raw = res as RawCommunityGraphData if (!raw.nodes?.length) { setEmpty(true); return } @@ -55,9 +60,18 @@ const CommunityNetwork: FC<{ onSelectCommunity?: (node: RawCommunityNode) => voi if (!built) { setEmpty(true); return } setGraphData(built) }).catch((e) => { if (e?.code !== 'ERR_CANCELED') setEmpty(true) }) + .finally(() => setLoading(false)) return () => controller.abort() }, [id]) + if (loading) { + return + +
+ + + } + return (