fix: 简化清空逻辑 - 空消息列表即清空

This commit is contained in:
root
2026-04-15 11:10:29 +08:00
parent b86610d445
commit a282ec1a58
2 changed files with 2 additions and 2 deletions

View File

@ -345,7 +345,7 @@ class BackendServer:
def _handle_save_history(self, body: Dict) -> Dict:
messages = body.get("messages", [])
if messages and messages[0].get("action") == "clear":
if not messages:
self._graph.clear_chat_records()
return {"status": "history_cleared"}
result = self._graph.save_chat_records(messages)