修复基线抑制后截图 hash 导致消息被跳过的问题:
- 基线抑制时清除截图 hash(_last_screenshot_hash.pop) - 防止下次轮询时 hash 相同直接跳过 OCR,导致消息永远等不到回复 - 更新注释:从'三项关键处置'改为'四项关键处置'
This commit is contained in:
+4
-1
@@ -5166,15 +5166,18 @@ class MessageMonitor:
|
||||
is_baseline = self._last_new_msg_time.get(platform, 0) == 0
|
||||
if is_baseline:
|
||||
# 基线轮:日志标记但不触发回复。
|
||||
# ⚠ 三项关键处置,防止"基线吞消息后永不回复":
|
||||
# ⚠ 四项关键处置,防止"基线吞消息后永不回复":
|
||||
# 1. 从 seen 移除 item(4383 循环已 seen.add)——否则用户重发
|
||||
# 相同内容 → ts in seen 永久拦截
|
||||
# 2. 清空 _last_sig ——否则下一轮 sig 相同 → 4131 静默跳过,
|
||||
# 用户刚发的新消息被基线误吞后永远等不到回复
|
||||
# 3. 不 seen.add ——防重复由 sig 静默跳过承担
|
||||
# 4. ⭐ 清除截图 hash——否则下次轮询时 hash 相同直接跳过 OCR,
|
||||
# 消息永远等不到回复(截图内容没变但消息需要被处理)
|
||||
logger.info(f"[{platform}] 基线↺(不回复): {item[:60]}")
|
||||
seen.discard(item)
|
||||
self._last_sig[platform] = ""
|
||||
self._last_screenshot_hash.pop(platform, None)
|
||||
self._last_new_msg_time[platform] = time.time()
|
||||
else:
|
||||
self._last_new_msg_time[platform] = time.time()
|
||||
|
||||
Reference in New Issue
Block a user