mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-09-20 17:08:18 +00:00
fix: 简化清空逻辑 - 空消息列表即清空
This commit is contained in:
@ -78,7 +78,7 @@ class BackendClient:
|
||||
packet = Packet(
|
||||
id=self._next_id(),
|
||||
type=PacketType.SAVE_HISTORY,
|
||||
body={"messages": [{"action": "clear"}]}
|
||||
body={"messages": []}
|
||||
)
|
||||
return self._server.send(packet).body
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user