Skip to content

fix(plugin): derive missing crystallization summaries - #2222

Open
RerankerGuo wants to merge 2 commits into
MemTensor:mainfrom
RerankerGuo:fix/issue-2143-crystallize-summary-fallback
Open

fix(plugin): derive missing crystallization summaries#2222
RerankerGuo wants to merge 2 commits into
MemTensor:mainfrom
RerankerGuo:fix/issue-2143-crystallize-summary-fallback

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

Description

Fixes #2143.

When the crystallization LLM returns a structurally useful draft but omits
summary, normalization currently produces an empty string and the default
validator rejects the entire draft.

This change derives a sanitized fallback summary in this order:

  1. retrieval_blurb / retrievalBlurb, when provided by older or alternate models
  2. The first normalized step body or title
  3. The normalized display title or skill name
  4. A final static fallback

Existing non-empty summaries are unchanged. Missing steps remain invalid, so
this does not weaken the structural validator.

Related Issue (Required): Fixes #2143

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test
  • Test Script Or Test Steps

Evidence:

  • Before the fix, the two new regressions failed with
    skill.crystallize.invalid: missing summary.
  • npm test -- tests/unit/skill/crystallize.test.ts -> 9 passed.
  • npm run lint -> TypeScript project check passed.
  • npm run build -> plugin build passed.
  • The broader tests/unit/skill run passed 35 tests; 13 database-backed tests
    could not start because the local Node 26 install lacks the
    better-sqlite3 native binding after an --ignore-scripts install.

Impact

  • Breaking change: no
  • Scope: skill draft normalization only
  • Dependencies: none
  • Existing valid summaries and validation of missing steps are unchanged

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove the fix is effective
  • I have linked the issue to this PR
  • No documentation update is required for this internal recovery path
  • Review requested from @hijzy and @whipser030

Reviewer Checklist

@Memtensor-AI Memtensor-AI added area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Aug 5, 2026
@Memtensor-AI

Memtensor-AI commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

🤖 Open Code Review

Target: PR #2222
Task: afc7396792f82328
Base: main
Head: fix/issue-2143-crystallize-summary-fallback

🔍 OpenCodeReview found 1 issue(s) in this PR.


1. apps/memos-local-plugin/core/skill/crystallize.ts (L367)

The hardcoded magic number 200 in summarySource.slice(0, 200) should be extracted to a named constant. This makes the intent clear and makes it easier to update the limit in one place if needed.

Suggested fix:

const MAX_SUMMARY_LENGTH = 200;
// ...
const summary = summarySource.slice(0, MAX_SUMMARY_LENGTH);
💡 Suggested Change

Before:

  const summary = summarySource.slice(0, 200);

After:

const MAX_SUMMARY_LENGTH = 200;
// ...
  const summary = summarySource.slice(0, MAX_SUMMARY_LENGTH);

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (9/9 executed). memos_local_plugin/unit: 9/9. Duration: 3s [advisory, non-gating] AI-generated tests on branch test/auto-gen-32083f8dbbd21f66-20260805162117: 19/19 passed — these do NOT affect the PR verdict; review the branch manually.

Branch: fix/issue-2143-crystallize-summary-fallback

@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Aug 5, 2026
@Memtensor-AI Memtensor-AI added status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 and removed status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 labels Aug 6, 2026
@syzsunshine219

Copy link
Copy Markdown
Collaborator

Updated this PR at a1dcfb2c to address both unresolved OCR findings.

Changes:

  • select the first sanitized summary source, then apply the 200-character cap uniformly to explicit and derived summaries
  • remove the unreachable optional/static fallback; displayTitle is already guaranteed non-empty
  • add a regression test for an explicit 250-character summary (observed failing before the fix, passing after)

Merge status:

  • the PR is already based on the latest main (0 behind / 1 ahead)
  • merge-tree completed without conflicts

Local verification:

  • focused crystallization suite: 10/10 passed
  • complete local-plugin suite: 159 files, 1305 passed, 2 skipped
  • npm run lint: passed
  • npm run build: passed
  • git diff --check: passed

Fresh OCR and AutoTest checks are pending. Python Actions run: https://github.com/MemTensor/MemOS/actions/runs/31122705498 (16 jobs queued while GitHub Actions is under a major outage).

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (10/10 executed). memos_local_plugin/unit: 10/10. Duration: 3s [advisory, non-gating] AI-generated tests on branch test/auto-gen-afc7396792f82328-20260807012102: 24/25 passed, 1 failed — these do NOT affect the PR verdict; review the branch manually.

Branch: fix/issue-2143-crystallize-summary-fallback

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

Labels

area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crystallize: defaultDraftValidator throws skill.crystallize.invalid: missing summary when LLM omits summary field

4 participants