Skip to content

split_continuous_references corrupts plain bracketed lists (non-reference text) #2446

Description

@simpleqt

Bug Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务ai:testingAI agent is running tests | AI 正在运行测试area:coreMOS 编排层 / 框架底座 / 跨模块问题status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理types:bugSomething isn't working | 功能异常

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions