Skip to content

fix(memory): skip markdown placeholder snippets during short-term promotion#95571

Closed
lsr911 wants to merge 1 commit into
openclaw:mainfrom
lsr911:fix/issue-80582-Memory-skip-markdown-placehol
Closed

fix(memory): skip markdown placeholder snippets during short-term promotion#95571
lsr911 wants to merge 1 commit into
openclaw:mainfrom
lsr911:fix/issue-80582-Memory-skip-markdown-placehol

Conversation

@lsr911

@lsr911 lsr911 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Short-term memory promotion treats markdown skeleton placeholders — such as a
bare - under a daily-note heading — as promotable snippets. In the affected
case, promotion appends empty or near-empty blocks into MEMORY.md because a
grounded candidate can be rehydrated onto a placeholder line.

Why This Change Was Made

isContaminatedDreamingSnippet filters out unwanted dreaming output but did
not check for structural placeholder lines. Daily notes commonly contain
bootstrap sections with empty bullets:

## Tagesnotizen
-

## Entscheidungen
-

These are scaffolding, not promotable content.

Changes

  • extensions/memory-core/src/short-term-promotion.ts — treat bare
    bullet items (-, *, +) and whitespace-only lines as contaminated in
    isContaminatedDreamingSnippet so they are skipped during promotion

Evidence

  • The regex /^\s*[-*+]\s*$/ matches standard Markdown list markers with no
    content, and /^\s*$/ matches blank lines
  • Both are structural patterns that contain no usable memory content

Related

Closes #80582

…motion

Bare bullet items (-, *, +) and whitespace-only lines in daily-note
bootstrap sections (e.g. ## Tagesnotizen followed by -) were being
promoted into MEMORY.md as empty or near-empty blocks. These are
structural scaffolding, not promotable content.

Fix: treat placeholder snippets as contaminated in isContaminatedDreamingSnippet
so they are skipped during promotion.

Closes openclaw#80582
@clawsweeper

clawsweeper Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: the open canonical issue still owns the memory-core placeholder promotion bug, and maintainer review already rejected this heuristic filter family in favor of typed/source-shape-aware normalization. This PR is narrower than the previously closed same-issue attempts and does not cover the linked issue’s skeleton-range or relocation paths.

Root-cause cluster
Relationship: superseded
Canonical: #80582
Summary: This PR targets the same markdown placeholder short-term promotion bug, but the canonical issue remains open and prior same-issue heuristic PRs were closed in favor of a typed/source-shape-aware repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Keep #80582 as the canonical tracker and replace this regex-only branch with the maintainer-requested typed/source-shape-aware short-term promotion normalization repair.

So I’m closing this here and keeping the remaining discussion on #80582.

Review details

Best possible solution:

Keep #80582 as the canonical tracker and replace this regex-only branch with the maintainer-requested typed/source-shape-aware short-term promotion normalization repair.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main is source-reproducible because non-empty markdown placeholder ranges pass the existing empty/dreaming-contamination gates into recording, ranking, relocation, and apply; the canonical issue also includes a sanitized field cleanup signal.

Is this the best way to solve the issue?

No. This PR is a plausible partial filter, but prior maintainer review rejected this heuristic family and the current patch still misses skeleton ranges plus relocation matching.

Security review:

Security review cleared: The diff changes one memory-core TypeScript filtering path only, with no dependency, workflow, package metadata, secret-handling, or code-execution surface changes.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • vignesh07: Authored the merged weighted short-term promotion flow that introduced the central record/rank/apply surface affected by this bug. (role: feature introducer; confidence: high; commits: 4c1022c73b39; files: extensions/memory-core/src/short-term-promotion.ts, extensions/memory-core/src/short-term-promotion.test.ts)
  • mbelinky: Authored merged grounded backfill work that feeds candidates into the same short-term promotion store path. (role: recent area contributor; confidence: high; commits: e8209e4cf9b8; files: extensions/memory-core/src/short-term-promotion.ts, extensions/memory-core/src/dreaming-phases.ts)
  • gumadeiras: Authored the existing dreaming self-ingestion guard, the closest current precedent for filtering invalid snippets in this promotion pipeline. (role: adjacent filtering contributor; confidence: medium; commits: 0c4e0d703023; files: extensions/memory-core/src/short-term-promotion.ts, extensions/memory-core/src/short-term-promotion.test.ts)
  • vincentkoc: Provided maintainer direction closing the broader same-issue heuristic repair and local blame maps the current touched module snapshot to recent Vincent Koc work. (role: recent reviewer and adjacent area contributor; confidence: medium; commits: a70b34a3cba6; files: extensions/memory-core/src/short-term-promotion.ts)

Codex review notes: model internal, reasoning high; reviewed against b84665222c0e.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jun 21, 2026
@clawsweeper

clawsweeper Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

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

Labels

extensions: memory-core Extension: memory-core merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory: skip markdown placeholder snippets during short-term promotion

1 participant