oudecheng
4baa8e7a6b
fix: 内存历史按 topic_id 键化,新增 replace_topic_history 修复 DB 压缩覆盖
- SessionHistory.chat_histories 改为 topic_histories 按 topic_id 键化,消除多话题并发时内存历史互相覆盖的根因
- is_current_turn 改用 current_topic == original_topic_id 直接比较,替代失效的内存最新消息匹配判断
- 新增 ConversationRepository::replace_topic_history 按 topic 删除/插入消息,解决 replace_active_history 删除整个 session 消息的 pre-existing 问题
- compaction 路径改用 replace_topic_history,避免压缩时覆盖其他 topic 的 DB 消息
- switch_topic 不再 remove_history,不同 topic 历史独立存储互斥
- append_persisted_message 仅当 topic_id == current_topic 时更新内存,防止延迟消息污染新话题历史
2026-07-28 15:32:42 +08:00
..
2026-07-15 16:36:13 +08:00
2026-07-15 16:36:13 +08:00
2026-07-03 19:32:14 +08:00
2026-07-08 14:51:42 +08:00
2026-06-14 10:24:52 +08:00
2026-07-08 16:23:09 +08:00
2026-07-09 14:42:38 +08:00
2026-04-28 14:16:30 +08:00
2026-07-21 16:33:55 +08:00
2026-07-28 15:32:42 +08:00
2026-07-08 15:52:36 +08:00
2026-05-12 17:44:39 +08:00
2026-06-13 09:06:45 +08:00
2026-07-08 16:23:09 +08:00
2026-07-15 17:47:52 +08:00
2026-06-02 23:31:05 +08:00
2026-07-21 16:33:55 +08:00
2026-07-28 15:32:42 +08:00
2026-07-21 16:33:55 +08:00
2026-06-02 15:23:50 +08:00
2026-07-21 16:33:55 +08:00
2026-07-21 16:33:55 +08:00
2026-06-19 10:40:00 +08:00
2026-06-19 10:40:00 +08:00
2026-04-28 10:33:31 +08:00
2026-06-10 11:26:35 +08:00