fix: 修复历史消息二次处理和回复截断问题

1. 历史消息二次处理 (Task #1490):
   - 启动时从消息历史数据库加载最近50条bot回复到_replied_texts
   - 降低查库过滤器重合率阈值0.9→0.7
   - 防止重启后旧回复被OCR重新识别处理

2. 回复截断 (Task #1491):
   - 表格内容截断长度300→1000字符
   - 普通文本保持300字符
   - 避免长表格回复被截断
This commit is contained in:
youpaishidifu
2026-08-09 22:20:27 +08:00
parent 59d0bb8a87
commit 438ba08365
2 changed files with 38 additions and 3 deletions
+5 -2
View File
@@ -173,10 +173,13 @@ class AutoReply:
# 优先用 body(纯正文),兜底用 content(heading+正文)
body = doc.get("body", "").strip()
if body and len(body) > 20:
answer = body[:297] + "..." if len(body) > 300 else body
# 表格内容允许更长,避免截断重要信息
max_len = 1000 if '|' in body else 300
answer = body[:max_len-3] + "..." if len(body) > max_len else body
else:
content = doc.get("content", "").strip()
answer = content[:297] + "..." if len(content) > 300 else content
max_len = 1000 if '|' in content else 300
answer = content[:max_len-3] + "..." if len(content) > max_len else content
if not answer:
return None