Skip to content

fix(scheduler): report total working memory count in log_working_memory_replacement#1795

Open
nuthalapativarun wants to merge 2 commits into
MemTensor:mainfrom
nuthalapativarun:fix/scheduler-logger-memory-len-1790
Open

fix(scheduler): report total working memory count in log_working_memory_replacement#1795
nuthalapativarun wants to merge 2 commits into
MemTensor:mainfrom
nuthalapativarun:fix/scheduler-logger-memory-len-1790

Conversation

@nuthalapativarun

Copy link
Copy Markdown
Contributor

Description

log_working_memory_replacement was passing memory_len=len(memcube_content) where memcube_content only contains newly added memories. This caused the scheduler UI to show the delta count instead of the total working memory size after replacement.

Fix: use len(new_memory) to report the actual output count.

Related Issue (Required): Fixes #1790

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

  • Unit Test

Checklist

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

@Memtensor-AI Memtensor-AI changed the base branch from main to dev-20260604-v2.0.19 June 10, 2026 15:44
@nuthalapativarun nuthalapativarun force-pushed the fix/scheduler-logger-memory-len-1790 branch from 87a8081 to 8ef020e Compare June 16, 2026 02:14
@nuthalapativarun nuthalapativarun changed the base branch from dev-20260604-v2.0.19 to dev-20260615-v2.0.20 June 16, 2026 02:14
@nuthalapativarun

Copy link
Copy Markdown
Contributor Author

All 16 build matrix legs were failing identically. Investigated the ubuntu-latest/3.11 job log:

Run poetry run ruff check
poetry run ruff format --check
...
All checks passed!
Would reformat: tests/mem_scheduler/test_scheduler_logger.py
1 file would be reformatted, 593 files already formatted
##[error]Process completed with exit code 1.

Root cause: this was caused by my diff, not an unrelated base-branch breakage. The new tests/mem_scheduler/test_scheduler_logger.py had inconsistent inline-comment alignment spacing (extra spaces before # carried over / # new comments) that ruff format --check flagged as needing reformatting. Since every matrix leg runs the same lint/format step regardless of OS/Python version, all 16 legs failed identically.

Fix: ran ruff format locally on the file (only whitespace changes, no logic changes) and pushed as a new commit (b7013d0c). Verified locally:

  • ruff format --check -> passes
  • ruff check -> All checks passed!

This should resolve all 16 failing build legs.

@nuthalapativarun

Copy link
Copy Markdown
Contributor Author

Hi, just following up — CI has been green since the ruff format fix on June 17. Let me know if there's anything you'd like changed before merging!

@Memtensor-AI Memtensor-AI changed the base branch from dev-20260615-v2.0.20 to dev-v2.0.22 July 1, 2026 13:16
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: PASSED

Cloud test-engine rerun against dev-v2.0.22 completed successfully.

  • Run: tr-d3ca0a7e-17d on cloud test-engine 10012
  • memos_python_core/changed-repo-python: 1 passed, 0 failed, 0 skipped

Manual code review is still required before merge.

@CarltonXiang CarltonXiang deleted the branch MemTensor:main July 3, 2026 07:25
@syzsunshine219 syzsunshine219 reopened this Jul 3, 2026
@syzsunshine219 syzsunshine219 added the needs-audit Requires manual audit before merge label Jul 3, 2026
@syzsunshine219 syzsunshine219 changed the base branch from dev-v2.0.22 to main July 3, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-audit Requires manual audit before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: log_working_memory_replacement reports incorrect memory_len (delta instead of total)

4 participants