chore: sync current WechatHookBot workspace

This commit is contained in:
2026-03-09 15:48:45 +08:00
parent 4016c1e6eb
commit 9119e2307d
195 changed files with 24438 additions and 17498 deletions

View File

@@ -190,11 +190,14 @@ class ContextStore:
if self._use_redis_for_group_history():
redis_cache = get_cache()
try:
key = f"group_history:{_safe_chat_id(chat_id)}"
# 使用与写入时相同的 key 格式: "group_history:{chat_id}"
# 注意redis_cache._make_key 会生成 "group_history:{chat_id}" 格式
# 这里直接使用原始 chat_id与 add_group_message 保持一致
key = f"group_history:{chat_id}"
redis_cache.delete(key)
logger.debug(f"[ContextStore] 已清除 Redis 群聊历史: {chat_id}")
logger.info(f"[ContextStore] 已清除 Redis 群聊历史: {key}")
except Exception as e:
logger.debug(f"[ContextStore] 清除 Redis 群聊历史失败: {e}")
logger.warning(f"[ContextStore] 清除 Redis 群聊历史失败: {e}")
# 清除本地文件中的群聊历史
history_file = self._get_history_file(chat_id)