From b0f21309f721fe52d757b16ce81e07278dba2893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E6=B3=BD=E6=B6=9B?= Date: Wed, 25 Feb 2026 19:09:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(agent):=20=E4=BF=AE=E5=A4=8D=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=B9=9F=E5=8F=98=E6=88=90=E5=9C=A8=E6=B5=81=E5=BC=8F?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/AgentChatComponent.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/components/AgentChatComponent.vue b/web/src/components/AgentChatComponent.vue index 4b5f7275..833d3628 100644 --- a/web/src/components/AgentChatComponent.vue +++ b/web/src/components/AgentChatComponent.vue @@ -825,7 +825,10 @@ const enqueueLoadingChunkForTyping = (threadId, chunk) => { } const msg = chunk.msg || {} - const contentChars = splitChars(msg.content) + const msgType = String(msg.type || '').toLowerCase() + const isToolMessage = msgType === 'tool' || msgType.includes('tool') + const streamText = typeof chunk.response === 'string' ? chunk.response : '' + const contentChars = !isToolMessage ? splitChars(streamText) : [] if (contentChars.length === 0) { typingChunkQueue.push({ threadId, chunk, isChar: false }) scheduleTypingRender() @@ -838,6 +841,7 @@ const enqueueLoadingChunkForTyping = (threadId, chunk) => { isChar: true, chunk: { ...chunk, + response: char, msg: { ...msg, content: char From 6768fa9ed3b944f06bb9511c481db581d55a358c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E6=B3=BD=E6=B6=9B?= Date: Wed, 25 Feb 2026 19:09:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(kb):=20=E4=BF=AE=E5=A4=8D=20worker=20?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=20=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0=20?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E5=AE=9E=E4=BE=8B=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/knowledge/manager.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/knowledge/manager.py b/src/knowledge/manager.py index a74192c4..a9dc4fee 100644 --- a/src/knowledge/manager.py +++ b/src/knowledge/manager.py @@ -175,16 +175,28 @@ class KnowledgeBaseManager: kb_repo = KnowledgeBaseRepository() rows = await kb_repo.get_all() - all_databases = [] + metadata_reloaded_types: set[str] = set() for row in rows: - kb_instance = self._get_or_create_kb_instance(row.kb_type or "lightrag") + kb_type = row.kb_type or "lightrag" + kb_instance = self._get_or_create_kb_instance(kb_type) db_info = kb_instance.get_database_info(row.db_id) - if db_info: - # 补充 share_config 和 additional_params - db_info["share_config"] = row.share_config or {"is_shared": True, "accessible_departments": []} - db_info["additional_params"] = ensure_chunk_defaults_in_additional_params(row.additional_params) - all_databases.append(db_info) + if not db_info and kb_type not in metadata_reloaded_types: + try: + await kb_instance._load_metadata() + metadata_reloaded_types.add(kb_type) + except Exception as e: + logger.warning(f"Failed to reload metadata for kb_type={kb_type}: {e}") + db_info = kb_instance.get_database_info(row.db_id) + + if not db_info: + logger.warning(f"Skip database due to missing metadata: db_id={row.db_id}, kb_type={kb_type}") + continue + + # 补充 share_config 和 additional_params + db_info["share_config"] = row.share_config or {"is_shared": True, "accessible_departments": []} + db_info["additional_params"] = ensure_chunk_defaults_in_additional_params(row.additional_params) + all_databases.append(db_info) return {"databases": all_databases} async def check_accessible(self, user: dict, db_id: str) -> bool: