Merge pull request #1097 from A0000Xz/dev

修复hfc在私聊情况下的糟糕表现,让no_reply对私聊不执行退出专注模式的逻辑
This commit is contained in:
SengokuCola
2025-07-07 20:35:10 +08:00
committed by GitHub
2 changed files with 13 additions and 106 deletions

View File

@@ -190,12 +190,6 @@ class HeartFChatting:
if loop_info["loop_action_info"]["command"] == "stop_focus_chat":
logger.info(f"{self.log_prefix} 麦麦决定停止专注聊天")
# 如果是私聊,则不停止,而是重置疲劳度并继续
if not self.chat_stream.group_info:
logger.info(f"{self.log_prefix} 私聊模式下收到停止请求,不退出。")
continue # 继续下一次循环,而不是退出
# 如果是群聊,则执行原来的停止逻辑
# 如果设置了回调函数,则调用它
if self.on_stop_focus_chat:
try:
@@ -484,10 +478,6 @@ class HeartFChatting:
)
# 设置系统命令,在下次循环检查时触发退出
command = "stop_focus_chat"
elif self._message_count >= current_threshold and global_config.chat.chat_mode != "auto":
logger.info(
f"{self.log_prefix} [非auto模式] 已发送 {self._message_count} 条消息,达到疲惫阈值 {current_threshold}但非auto模式不会自动退出"
)
else:
if reply_text == "timeout":
self.reply_timeout_count += 1