feat(chat): 优化提及检测并精简兴趣度评分日志

增强了机器人提及检测逻辑,使其能够识别配置文件中设置的所有别名(alias_names),而不仅仅是主昵称。这提高了交互的灵活性和准确性。

此外,还对兴趣度评分和匹配系统的日志输出进行了大幅重构:
- 将多条评分计算日志合并为一条包含核心指标的摘要日志,使输出更简洁。
- 调整了部分日志级别,将非关键信息移至 DEBUG 级别,以减少日志噪音。
- 在关键日志中增加了消息内容预览,以便于快速上下文定位和调试。
This commit is contained in:
tt-P607
2025-09-21 22:58:18 +08:00
committed by Windpicker-owo
parent 956d206675
commit 85c52aff5a
3 changed files with 21 additions and 32 deletions

View File

@@ -124,7 +124,10 @@ class ActionPlanner:
# 3. 根据兴趣度调整可用动作
if interest_scores:
latest_score = max(interest_scores, key=lambda s: s.total_score)
should_reply, score = self.interest_scoring.should_reply(latest_score)
latest_message = next(
(msg for msg in unread_messages if msg.message_id == latest_score.message_id), None
)
should_reply, score = self.interest_scoring.should_reply(latest_score, latest_message)
reply_not_available = False
if not should_reply and "reply" in initial_plan.available_actions: