From d896355bad726da44a809161cd9c29d342ed98d8 Mon Sep 17 00:00:00 2001 From: Jiaqing Liang Date: Mon, 16 Mar 2026 13:57:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20key=5Finfo=20regex=20residue=20accumulat?= =?UTF-8?q?ion=20bug=20-=20non-greedy=20match=20stopped=20at=20first=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E8=AE=B0=E5=BF=86=20leaving=20tail=20behind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agentmain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agentmain.py b/agentmain.py index b2839ac..d33fc51 100644 --- a/agentmain.py +++ b/agentmain.py @@ -102,7 +102,7 @@ class GeneraticAgent: ki = re.sub(r'\n\[SYSTEM\] 此为.*?工作记忆[。\n]*', '', self.handler.working['key_info']) # 去旧 handler.working['key_info'] = ki handler.working['passed_sessions'] = ps = self.handler.working.get('passed_sessions', 0) + 1 - if ps > 0: handler.working['key_info'] += f'\n[SYSTEM] 此为 {ps} 个对话前设置的工作记忆。若已在新任务,先更新或清除工作记忆\n' + if ps > 0: handler.working['key_info'] += f'\n[SYSTEM] 此为 {ps} 个对话前设置的key_info,若已在新任务,先更新或清除工作记忆。\n' self.handler = handler self.llmclient.backend = self.llmclient.backends[self.llm_no] user_input = raw_query