diff --git a/src/plugins/chat_module/reasoning_chat/reasoning_chat.py b/src/plugins/chat_module/reasoning_chat/reasoning_chat.py index d6f106d27..6743b5aec 100644 --- a/src/plugins/chat_module/reasoning_chat/reasoning_chat.py +++ b/src/plugins/chat_module/reasoning_chat/reasoning_chat.py @@ -187,6 +187,7 @@ class ReasoningChat: # 处理缓冲器结果 if not buffer_result: await willing_manager.bombing_buffer_message_handle(message.message_info.message_id) + willing_manager.delete(message.message_info.message_id) if message.message_segment.type == "text": logger.info(f"触发缓冲,已炸飞消息:{message.processed_plain_text}") elif message.message_segment.type == "image": diff --git a/src/plugins/chat_module/think_flow_chat/think_flow_chat.py b/src/plugins/chat_module/think_flow_chat/think_flow_chat.py index 7351bffed..13a150d20 100644 --- a/src/plugins/chat_module/think_flow_chat/think_flow_chat.py +++ b/src/plugins/chat_module/think_flow_chat/think_flow_chat.py @@ -212,6 +212,7 @@ class ThinkFlowChat: # 处理缓冲器结果 if not buffer_result: await willing_manager.bombing_buffer_message_handle(message.message_info.message_id) + willing_manager.delete(message.message_info.message_id) if message.message_segment.type == "text": logger.info(f"触发缓冲,已炸飞消息:{message.processed_plain_text}") elif message.message_segment.type == "image": diff --git a/src/plugins/willing/willing_manager.py b/src/plugins/willing/willing_manager.py index 133ecbbee..05a29b7cd 100644 --- a/src/plugins/willing/willing_manager.py +++ b/src/plugins/willing/willing_manager.py @@ -69,14 +69,15 @@ class BaseWillingManager(ABC): module = importlib.import_module(f".mode_{manager_type}", __package__) manager_class = getattr(module, f"{manager_type.capitalize()}WillingManager") if not issubclass(manager_class, cls): - manager_class = getattr(module, "ClassicalWillingManager") - logger.info("未找到当前意愿模式对应文件,使用经典配方~") + raise else: logger.info(f"成功载入willing模式:{manager_type}") return manager_class() - except (ImportError, AttributeError) as e: - logger.error(f"Failed to create willing manager: {str(e)}") - raise ValueError(f"Invalid willing manager type: {manager_type}") from e + except: + module = importlib.import_module(f".mode_classical", __package__) + manager_class = getattr(module, "ClassicalWillingManager") + logger.info("未找到当前意愿模式对应文件,使用经典配方~") + return manager_class() def __init__(self): self.chat_reply_willing: Dict[str, float] = {} # 存储每个聊天流的回复意愿(chat_id)