This commit is contained in:
Windpicker-owo
2025-09-30 21:17:47 +08:00
6 changed files with 83 additions and 18 deletions

View File

@@ -34,8 +34,8 @@ class StreamLoopManager:
}
# 配置参数
self.max_concurrent_streams = max_concurrent_streams or getattr(
global_config.chat, "max_concurrent_distributions", 10
self.max_concurrent_streams = (
max_concurrent_streams or global_config.chat.max_concurrent_distributions
)
# 强制分发策略

View File

@@ -145,6 +145,7 @@ class ChatterActionManager:
action_data: Optional[dict] = None,
thinking_id: Optional[str] = None,
log_prefix: str = "",
clear_unread_messages: bool = True,
) -> Any:
"""
执行单个动作的通用函数
@@ -217,7 +218,8 @@ class ChatterActionManager:
if success:
await self._record_action_to_message(chat_stream, action_name, target_message, action_data)
# 自动清空所有未读消息
await self._clear_all_unread_messages(chat_stream.stream_id, action_name)
if clear_unread_messages:
await self._clear_all_unread_messages(chat_stream.stream_id, action_name)
# 重置打断计数
await self._reset_interruption_count_after_action(chat_stream.stream_id)
@@ -262,8 +264,8 @@ class ChatterActionManager:
# 记录回复动作到目标消息
await self._record_action_to_message(chat_stream, "reply", target_message, action_data)
# 自动清空所有未读消息
await self._clear_all_unread_messages(chat_stream.stream_id, "reply")
if clear_unread_messages:
await self._clear_all_unread_messages(chat_stream.stream_id, "reply")
# 回复成功,重置打断计数
await self._reset_interruption_count_after_action(chat_stream.stream_id)