You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
split_continuous_references in src/memos/mem_os/utils/reference_utils.py converts any single [...] block containing commas into split tags, even when the content is not a reference list:
>>>split_continuous_references("The set is [apple, banana] here")
'The set is [apple][banana] here'# plain prose corrupted
The id part of a reference tag is a hex-looking memory id, so the shape guard should require int:<id> items (as [1:aa, 2:bb] has), not just "has a comma".
Expected Behavior
Blocks whose items are not int:<id> pairs should be returned unchanged.
Environment
MemOS main, python 3.14.
Additional Context
Fix + red/green-verified test ready; PR to follow referencing this issue.
Summary: Fix #2446: split_continuous_references now guards against plain bracketed prose. Previously the function rewrote any single [...] block containing a comma into split tags, so "The set is [apple, banana] here" was corrupted into "The set is [apple][banana] here". Added a shape guard that only rewrites blocks whose every comma-separated item matches the reference tag shape <int>:<id> (e.g. 1:92ff35fb); otherwise the block is returned unchanged.
Changes: src/memos/mem_os/utils/reference_utils.py gains a module-level _REFERENCE_ITEM_RE regex and a validation step before the split; docstring updated to describe the new condition. New test file tests/mem_os/test_reference_utils.py covers the regression case from the issue, mixed-content brackets (e.g. [1:92ff35fb, banana]), numeric-only lists ([1, 2, 3]), non-integer prefixes ([a:1, b:2]), and the original happy path ([1:92ff35fb, 4:bfe6f044] → split, with and without space after comma).
Activity
Memtensor-AI commentedon Sep 30, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
9201e950886deeb7Working branch:
bugfix/autodev-2446-20260930155806113Target branch:
latest dev* branchWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
fix(reference_utils): guard split_continuous_references against plain…
Memtensor-AI commentedon Sep 30, 2026
✅ AutoDev task
9201e950886deeb7completed.Summary: Fix #2446: split_continuous_references now guards against plain bracketed prose. Previously the function rewrote any single [...] block containing a comma into split tags, so "The set is [apple, banana] here" was corrupted into "The set is [apple][banana] here". Added a shape guard that only rewrites blocks whose every comma-separated item matches the reference tag shape
<int>:<id>(e.g.1:92ff35fb); otherwise the block is returned unchanged.Changes:
src/memos/mem_os/utils/reference_utils.pygains a module-level_REFERENCE_ITEM_REregex and a validation step before the split; docstring updated to describe the new condition. New test filetests/mem_os/test_reference_utils.pycovers the regression case from the issue, mixed-content brackets (e.g.[1:92ff35fb, banana]), numeric-only lists ([1, 2, 3]), non-integer prefixes ([a:1, b:2]), and the original happy path ([1:92ff35fb, 4:bfe6f044]→ split, with and without space after comma).Verification:
pytest tests/mem_os/test_reference_utils.py -q→ 11 passed.pytest tests/mem_os/ -q→ 47 passed.ruff check+ruff format --check→ clean. Task file archived to memos-autodev-specs main.Base branch:
mainBranch:
bugfix/autodev-2446-20260930155806113Commit:
b6a21c9PR: #2450
Assigned to: @syzsunshine219
Reviewers: @WeiminLee
github-actions commentedon Nov 4, 2026
This issue has been automatically marked as stale due to inactivity.