Skip to content

Fix #2335: l3.abstraction hard-fails entire world-model generation on empty LLM title (no r - #2575

Open
syzsunshine219 wants to merge 2 commits into
MemTensor:mainfrom
Memtensor-AI:bugfix/autodev-2335-20260903031432962
Open

syzsunshine219 wants to merge 2 commits into
MemTensor:mainfrom
Memtensor-AI:bugfix/autodev-2335-20260903031432962

Conversation

@syzsunshine219

@syzsunshine219 syzsunshine219 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Restores the change proposed in #2338 for review against main after its former base branch, dev-v2.0.33, was deleted. The source commits and authors are preserved.

Source head: ed61fb9928d9f1ac2b8ac159aaaea3c9a286cb2e

This PR is open for review. Review and CI against the current base are pending; validation claims in the original description below refer to the earlier snapshot. The original discussion and evidence remain in #2338.


Original change description

Description

Fixes issue #2335: l3.abstraction no longer aborts a whole cluster's world-model generation when the LLM returns an empty title. The validate callback still requires the triple (environment / inference / constraints) but no longer throws on empty title; normaliseDraft synthesises a fallback title from domain_tags (title-cased, joined with " · "), the first non-empty environment[].label, or a static "Untitled world model". abstractDraft emits an abstract.title_fallback warn breadcrumb so ops can still spot LLM regressions.

Applied the same softening to l2.induction: title becomes a display attribute (falls back to signatureLabel, else "Untitled policy") while trigger and procedure remain load-bearing and still fail the draft when missing.

Verified with vitest: the two focused test files run 16 tests (all passing) and the full tests/unit/memory/l2 + l3 suite runs 89 tests (all passing). tsc -p tsconfig.json --noEmit is clean. Changes touch four files under apps/memos-local-plugin/{core,tests}/memory/{l2,l3}; opsp task file and openspec change artefacts are staged in .ai-tasks/ and openspec/changes/ for scheduler archival.

Related Issue (Required): Fixes #2335

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Automated tests are pending.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@whipser030, @hijzy please review this PR.

Reviewer Checklist

autodev and others added 2 commits September 3, 2026 11:43
…Tensor#2335)

l3.abstraction previously threw LLM_OUTPUT_MALFORMED when the LLM
returned an empty/whitespace `title`, aborting the entire world-model
generation for the cluster. In production (v2.0.17) this turned a
single flaky LLM response into a full pipeline failure.

Soften the validator: keep the triple (environment / inference /
constraints) as load-bearing but derive `title` from `domain_tags`,
first environment label, or a static "Untitled world model" when the
LLM leaves it empty. Emit `abstract.title_fallback` warn so ops still
see the regression.

Apply the same pattern to l2.induction — `title` is a display attribute
while `trigger` and `procedure` remain load-bearing.
- Inline the raw-title check in l3.abstract (parity with l2.induce);
  drop the now-unused isEmptyString helper.
- Add rawTitleType to the induce/abstract title_fallback warn logs so
  operators can distinguish null vs. "" vs. non-string LLM responses.
- Route l2.induce.synthesiseTitle through sanitizeDerivedText + the
  shared truncate() helper so the fallback path matches the normal
  sanitised/ellipsised path.
- Make l3.abstract's titleCaseTag and synthesiseTitle Unicode-safe by
  iterating over code points instead of UTF-16 code units, so emoji or
  surrogate-pair tags no longer corrupt the display title.
- Drop the outdated docs/openspec/…-2335-….md pointer from the
  synthesiseTitle JSDoc — the referenced path never landed.
@syzsunshine219
syzsunshine219 marked this pull request as ready for review November 9, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

l3.abstraction hard-fails entire world-model generation on empty LLM title (no retry/fallback)

1 participant