Skip to content

Bug: isShortTermMemoryPath regex skips daily memory files with timestamp suffixes (e.g. YYYY-MM-DD-HHMM.md) #90896

@stevenjj33

Description

@stevenjj33

Bug Description

isShortTermMemoryPath() in the dreaming doctor.memory.status endpoint fails to match daily memory files that have timestamp suffixes in their names (e.g. memory/2026-05-28-1503.md). Only files matching the strict memory/YYYY-MM-DD.md pattern are counted.

This causes promotedToday, shortTermCount, and promotedTotal to show incorrect values in the WebUI Dreams tab.

Root Cause

The regex in isShortTermMemoryPath():

/(?:^|\/)memory\/(\d{4})-(\d{2})-(\d{2})\.md$/

Only matches memory/YYYY-MM-DD.md. Files with timestamp suffixes like memory/YYYY-MM-DD-HHMM.md are skipped.

Impact

  • WebUI Dreams → Advanced tab shows "0 promoted today" despite successful promotions
  • shortTermCount underreports by filtering out entries with timestamp-suffixed paths
  • doctor.memory.status API returns incorrect stats
  • Actual dreaming functionality is unaffected — Deep Sleep still promotes entries to MEMORY.md correctly

Evidence

Recall store (memory/.dreams/short-term-recall.json) contains entries with paths like:

  • memory/2026-05-28-1503.md ❌ (skipped by regex)
  • memory/2026-05-28-1652.md ❌ (skipped by regex)
  • memory/2026-05-28.md ✅ (matches regex)

Testing the regex against all 512 recall store entries:

  • 286 entries pass the isShortTermMemoryPath filter
  • 226 entries are skipped due to timestamp suffixes

The 2 entries promoted today both have timestamp-suffixed paths and are skipped, so promotedToday stays at 0.

Related Issues

Suggested Fix

Update the regex to also match timestamp-suffixed filenames:

/(?:^|\/)memory\/(\d{4})-(\d{2})-(\d{2})(?:-\d{4})?\.md$/

Or use a more flexible pattern that handles both formats.

Environment

  • OpenClaw version: 2026.6.1
  • OS: Linux (WSL2)
  • Node: v22.22.1

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions