Skip to content

bug(memos-local-plugin): L3 abstraction rejects salvageable structured outputs too aggressively #1668

@liuhaibin0528

Description

@liuhaibin0528

Pre-submission checklist | 提交前检查

  • I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Bug Description | 问题描述

apps/memos-local-plugin currently rejects many otherwise-usable L3 abstraction drafts too early when the model returns partially structured JSON.

In practice, I saw repeated world_model_generate failures where the payload still had usable body / domain_tags / string items, but the validator aborted because:

  • title was empty
  • inference / constraints were not arrays
  • some list entries came back as strings or { body: ... }

This causes the L3 pipeline to fail hard instead of salvaging a draft and letting downstream validation decide whether it is good enough to persist.

How to Reproduce | 如何重现

  1. Use apps/memos-local-plugin with an OpenAI-compatible structured-output model that is not perfectly strict on every generation.
  2. Let the plugin accumulate enough traces/policies to trigger world_model_generate.
  3. Check logs for failures like:
    • l3.abstraction: 'title' must be a non-empty string
    • l3.abstraction: 'inference' must be an array
    • l3.abstraction: 'constraints' must be an array

Environment | 环境信息

  • MemOS version: main as of 2026-05-09
  • Plugin: apps/memos-local-plugin
  • Example model that reproduced this: glm-4-flashx-250414 via OpenAI-compatible API

Additional Context | 其他信息

This is not only a model-quality issue.

The current parser is strict enough that slightly malformed but semantically usable drafts are discarded wholesale. A more resilient normalization path for:

  • fallback title derivation
  • string / object list entry coercion
  • string tag splitting

would make L3 much less fragile across providers.

I did not open a PR for this yet because it changes parser policy, not just transport/runtime behavior.

Willingness to Implement | 实现意愿

  • I'm willing to implement this myself | 我愿意自己解决
  • I would like someone else to implement this | 我希望其他人来解决

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions