From 296d815e3e74b7204a3dd635305938071742e576 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 28 Mar 2026 12:42:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E5=BC=82?= =?UTF-8?q?=E6=AD=A5pop=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/agent/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/agent/__init__.py b/app/agent/__init__.py index 4c1e6bf8..99cd03ec 100644 --- a/app/agent/__init__.py +++ b/app/agent/__init__.py @@ -124,9 +124,7 @@ class MoviePilotAgent: """ try: # 系统提示词 - system_prompt = prompt_manager.get_agent_prompt( - channel=self.channel - ) + system_prompt = prompt_manager.get_agent_prompt(channel=self.channel) # LLM 模型(用于 agent 执行) llm = self._initialize_llm() @@ -311,7 +309,9 @@ class MoviePilotAgent: text = self._extract_text_content(msg.content) if text: # 过滤掉包含在 标签中的内容 - text = re.sub(r'.*?(?:|$)', '', text, flags=re.DOTALL) + text = re.sub( + r".*?(?:|$)", "", text, flags=re.DOTALL + ) final_text = text.strip() break @@ -549,7 +549,7 @@ class AgentManager: logger.info(f"会话 {session_id} 的worker被取消") finally: # 清理已完成的worker记录 - await self._session_workers.pop(session_id, None) + self._session_workers.pop(session_id, None) # noqa # 如果队列为空,清理队列 if ( session_id in self._session_queues