Skip to content

fix: filter empty preference memory items#2011

Open
RerankerGuo wants to merge 1 commit into
MemTensor:mainfrom
RerankerGuo:fix/filter-empty-preference-items
Open

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

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

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
@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 changed the base branch from dev-v2.0.22 to main July 3, 2026 08:20
@RerankerGuo

Copy link
Copy Markdown
Contributor Author

Hi @Memtensor-AI / @CarltonXiang — friendly ping on this draft.

Quick observation: this PR still has base branch main, but MemTensor/MemOS's current merge flow is into dev-v2.0.22 (every recent PR #2065 / #2058 / #2047 / #2046 / #2042 / #2034 / #2033 / #2026 lands on dev-v2.0.22). The bot already retargeted the base SHA for testing and cloud test-engine returned PASSED against dev-v2.0.22 on every rerun.

Could a maintainer please change the base branch from maindev-v2.0.22 (Edit → base branch dropdown) so this can enter the normal merge queue? The head commit is a single focused change and does not depend on any main-only commits.

Thanks!

@RerankerGuo

Copy link
Copy Markdown
Contributor Author

Hi @syzsunshine219 — looks like you've merged 35 of the last 50 PRs on this repo. Friendly ping on this one.

This draft (and the other 21 OPEN PRs I have here) is small, single-commit, has cloud test-engine PASSED, and is fully mergeable. The only thing blocking it is that the base branch dropdown still says main — every recent merge (e.g. #2038, #2037, #2034, #2032) landed on dev-v2.0.22.

When you have a moment, would you mind one of:

  1. Flipping the base branch on this PR from maindev-v2.0.22 (Edit → base branch dropdown), or
  2. Telling me which base branch you'd prefer and I'll re-push accordingly.

Both fix and feature PRs in this batch are independent — each can be reviewed/merged on its own. Happy to rebase / split / drop any that don't fit the direction.

Thanks!

@RerankerGuo RerankerGuo force-pushed the fix/filter-empty-preference-items branch from d61c336 to abcbe06 Compare July 8, 2026 07:45
@Memtensor-AI Memtensor-AI added the area:memory 记忆存储、检索、更新、召回逻辑 label Jul 8, 2026
@Memtensor-AI Memtensor-AI requested a review from bittergreen July 8, 2026 11:43
@CarltonXiang CarltonXiang marked this pull request as ready for review July 8, 2026 12:56
@CarltonXiang CarltonXiang changed the base branch from main to dev-v2.0.23 July 8, 2026 12:56
@syzsunshine219 syzsunshine219 changed the base branch from dev-v2.0.23 to main July 9, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:memory 记忆存储、检索、更新、召回逻辑

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 修复偏好记忆会preference为空的列表项

5 participants