Skip to content

get_default_cube_config crashes with UnboundLocalError on invalid text_mem_type #2441

Description

@simpleqt

Bug Description

get_default_cube_config in src/memos/mem_os/utils/default_config.py only assigns text_mem_config inside the tree_text and general_text branches, but there is no else. Any other value (e.g. a typo like "tree-text" passed through MOS_NEO4J_*/env config plumbing or the MCP create_cube path) crashes with a bare UnboundLocalError:

>>> get_default_cube_config(openai_api_key="sk-x", text_mem_type="tree-text")
UnboundLocalError: cannot access local variable 'text_mem_config' where it is not associated with a value

Expected Behavior

An invalid text_mem_type should raise a clear ValueError naming the accepted values.

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:pr-readyAI-created PR is ready for review | AI 生成的 PR 已等待评审area:memcubeGeneralMemCube / cube 生命周期 / cube 配置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