From 33924e65c278ee1d8338a4f278a26e48c2e790eb Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Tue, 11 Nov 2025 01:27:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E7=BB=99=E5=88=B0=E6=89=80=E6=9C=89=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/memory_system/memory_retrieval.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/memory_system/memory_retrieval.py b/src/memory_system/memory_retrieval.py index e466ef9d..ed1e0b66 100644 --- a/src/memory_system/memory_retrieval.py +++ b/src/memory_system/memory_retrieval.py @@ -271,13 +271,12 @@ async def _react_agent_solve_question( pass # 达到最大迭代次数或超时,但Agent没有明确返回final_answer - # 这种情况下,即使收集到了一些信息,也不认为找到了答案 + # 迭代超时应该直接视为no_answer,而不是使用已有信息 # 只有Agent明确返回final_answer时,才认为找到了答案 if collected_info: logger.warning(f"ReAct Agent达到最大迭代次数或超时,但未明确返回final_answer。已收集信息: {collected_info[:100]}...") - return False, collected_info, thinking_steps - else: - return False, "未找到相关信息", thinking_steps + logger.warning("ReAct Agent达到最大迭代次数或超时,直接视为no_answer") + return False, "未找到相关信息", thinking_steps def _get_recent_query_history(chat_id: str, time_window_seconds: float = 300.0) -> str: