From a686bdaf80295712aee661c90c85b8a78c4e8654 Mon Sep 17 00:00:00 2001 From: RerankerGuo <121015044+RerankerGuo@users.noreply.github.com> Date: Tue, 28 Jul 2026 16:43:54 +0800 Subject: [PATCH] fix: correct memory_len in log_working_memory_replacement Closes #1790 The log_working_memory_replacement method was passing memory_len=len(memcube_content) to create_event_log, where memcube_content only contains the newly added memories (delta). This caused the scheduler UI to display the count of changes instead of the total size of the output working memory. Change to memory_len=len(new_memory) so the log reports the total number of memories in the working memory after replacement, consistent with how other log entries represent the output size. Test: python3 -m py_compile src/memos/mem_scheduler/general_modules/scheduler_logger.py --- src/memos/mem_scheduler/general_modules/scheduler_logger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memos/mem_scheduler/general_modules/scheduler_logger.py b/src/memos/mem_scheduler/general_modules/scheduler_logger.py index a1f588bda..f4e66cbc6 100644 --- a/src/memos/mem_scheduler/general_modules/scheduler_logger.py +++ b/src/memos/mem_scheduler/general_modules/scheduler_logger.py @@ -226,7 +226,7 @@ def log_working_memory_replacement( mem_cube=mem_cube, memcube_log_content=memcube_content, metadata=meta, - memory_len=len(memcube_content), + memory_len=len(new_memory), memcube_name=self._map_memcube_name(mem_cube_id), ) log_func_callback([ev])