Problem
In src/memos/mem_scheduler/general_modules/scheduler_logger.py, log_working_memory_replacement has a # TODO: Log output count is incorrect comment at line 167.
The method passes memory_len=len(memcube_content) to create_event_log, where memcube_content only contains the newly added memories (delta). This means the scheduler UI shows the count of changes, not the actual size of the output working memory.
Example:
- Original working memory: [A, B, C] (3 items)
- New working memory: [A, B, D] (3 items)
memcube_content = [D] → memory_len = 1
- Correct value:
memory_len = 3 (total memories in output)
Expected Behavior
memory_len should reflect the total number of memories in the working memory after replacement (len(new_memory)), consistent with how other log entries represent the output size.
Steps to Reproduce
Trigger a working memory replacement operation via the scheduler and observe the memory_len field in the scheduler log output.
Proposed Fix
Change line 227:
# Before
memory_len=len(memcube_content),
# After
memory_len=len(new_memory),
Files
src/memos/mem_scheduler/general_modules/scheduler_logger.py line 167, 227
Problem
In
src/memos/mem_scheduler/general_modules/scheduler_logger.py,log_working_memory_replacementhas a# TODO: Log output count is incorrectcomment at line 167.The method passes
memory_len=len(memcube_content)tocreate_event_log, wherememcube_contentonly contains the newly added memories (delta). This means the scheduler UI shows the count of changes, not the actual size of the output working memory.Example:
memcube_content= [D] →memory_len = 1memory_len = 3(total memories in output)Expected Behavior
memory_lenshould reflect the total number of memories in the working memory after replacement (len(new_memory)), consistent with how other log entries represent the output size.Steps to Reproduce
Trigger a working memory replacement operation via the scheduler and observe the
memory_lenfield in the scheduler log output.Proposed Fix
Change line 227:
Files
src/memos/mem_scheduler/general_modules/scheduler_logger.pyline 167, 227