diff --git a/server/chat_flow_task_main.py b/server/chat_flow_task_main.py index db12867..4cf1412 100644 --- a/server/chat_flow_task_main.py +++ b/server/chat_flow_task_main.py @@ -1699,10 +1699,25 @@ async def handle_task_with_sender( try: from .tasks import task_manager - pending_runtime_guidance_messages = task_manager.consume_runtime_guidance_messages( + raw_items = task_manager.consume_runtime_guidance_for_injection( username=username, task_id=client_sid, ) + # 权限/审核方式变更通知在任务完成时不应该触发新一轮工作, + # 只保留真正的引导消息(压缩续接等),丢弃权限/执行环境变更通知。 + runtime_skip_sources = {"权限变更", "执行环境变更", "notify"} + for item in (raw_items or []): + if isinstance(item, dict): + src = str(item.get("source") or "").strip().lower() + text = str(item.get("text") or "").strip() + if src in runtime_skip_sources: + continue + if text: + pending_runtime_guidance_messages.append(text) + else: + text = str(item or "").strip() + if text: + pending_runtime_guidance_messages.append(text) except Exception as exc: debug_log(f"[RuntimeGuidance] 读取剩余引导消息失败: {exc}") pending_runtime_guidance_messages = []