diff --git a/src/chat/actions/plugin_api/database_api.py b/src/chat/actions/plugin_api/database_api.py index d8a45aefa..3342a3d6c 100644 --- a/src/chat/actions/plugin_api/database_api.py +++ b/src/chat/actions/plugin_api/database_api.py @@ -195,7 +195,8 @@ class DatabaseAPI: return None if single_result else [] elif query_type in ["create", "update", "delete", "count"]: return None - + raise "unknown query type" + async def db_raw_query( self, sql: str, diff --git a/src/chat/focus_chat/expressors/default_expressor.py b/src/chat/focus_chat/expressors/default_expressor.py index 01a60721b..adb595f17 100644 --- a/src/chat/focus_chat/expressors/default_expressor.py +++ b/src/chat/focus_chat/expressors/default_expressor.py @@ -109,6 +109,7 @@ class DefaultExpressor: # logger.debug(f"创建思考消息thinking_message:{thinking_message}") await self.heart_fc_sender.register_thinking(thinking_message) + return None async def deal_reply( self, diff --git a/src/chat/focus_chat/heartFC_sender.py b/src/chat/focus_chat/heartFC_sender.py index 49d33cc99..528d5802d 100644 --- a/src/chat/focus_chat/heartFC_sender.py +++ b/src/chat/focus_chat/heartFC_sender.py @@ -88,10 +88,10 @@ class HeartFCSender: """ if not message.chat_stream: logger.error("消息缺少 chat_stream,无法发送") - return + raise "消息缺少 chat_stream,无法发送" if not message.message_info or not message.message_info.message_id: logger.error("消息缺少 message_info 或 message_id,无法发送") - return + raise "消息缺少 message_info 或 message_id,无法发送" chat_id = message.chat_stream.stream_id message_id = message.message_info.message_id diff --git a/src/chat/focus_chat/replyer/default_replyer.py b/src/chat/focus_chat/replyer/default_replyer.py index 78727968a..a9424a910 100644 --- a/src/chat/focus_chat/replyer/default_replyer.py +++ b/src/chat/focus_chat/replyer/default_replyer.py @@ -120,6 +120,7 @@ class DefaultReplyer: # logger.debug(f"创建思考消息thinking_message:{thinking_message}") await self.heart_fc_sender.register_thinking(thinking_message) + return None async def deal_reply( self, diff --git a/src/chat/utils/timer_calculator.py b/src/chat/utils/timer_calculator.py index af8058a59..df2b9f778 100644 --- a/src/chat/utils/timer_calculator.py +++ b/src/chat/utils/timer_calculator.py @@ -111,11 +111,13 @@ class Timer: async def async_wrapper(*args, **kwargs): with self: return await func(*args, **kwargs) + return None @wraps(func) def sync_wrapper(*args, **kwargs): with self: return func(*args, **kwargs) + return None wrapper = async_wrapper if asyncio.iscoroutinefunction(func) else sync_wrapper wrapper.__timer__ = self # 保留计时器引用