Skip to content

fix: filter empty preference memory items#2011

Draft
RerankerGuo wants to merge 2 commits into
MemTensor:mainfrom
RerankerGuo:fix/filter-empty-preference-items
Draft

fix: filter empty preference memory items#2011
RerankerGuo wants to merge 2 commits into
MemTensor:mainfrom
RerankerGuo:fix/filter-empty-preference-items

Conversation

@RerankerGuo

Copy link
Copy Markdown

Fixes #2006.

Summary

  • Skip extracted preference entries whose normalized preference field is empty before creating PreferenceMemory items.
  • Strip non-empty preference text before storing it in metadata.
  • Add regression coverage for explicit and implicit preference extraction results that mix empty and valid entries.
  • Convert touched preference-extractor log messages to parameterized logging while keeping behavior unchanged.

Validation

  • python3 -m py_compile src/memos/mem_reader/read_pref_memory/process_preference_memory.py tests/mem_reader/test_preference_memory.py
  • Manual line-length check for touched Python files passed.
  • Attempted: python3 -m pytest tests/mem_reader/test_preference_memory.py -q; blocked because pytest is not installed in this environment.
  • Attempted: make format; blocked because poetry is not installed in this environment.

@Memtensor-AI Memtensor-AI changed the base branch from main to dev-v2.0.22 July 1, 2026 13:14
# Conflicts:
#	src/memos/mem_reader/read_pref_memory/process_preference_memory.py
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: QUEUED

Conflict with dev-v2.0.22 was resolved by merging the base branch into this PR head. Local syntax check passed; cloud test-engine rerun has been queued.

  • Run: tr-c36bee8d-bf7 on cloud test-engine 10010
  • Branch tested: refs/pull/2011/head

I will post the final pass/fail result when the run completes.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: PASSED

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

  • Run: tr-c36bee8d-bf7 on cloud test-engine 10010
  • memos_python_core/changed-repo-python: 2 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:20
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: 修复偏好记忆会preference为空的列表项

4 participants