Skip to content

[Bug]: Dreaming recall store never populated when daily notes are in memory/ subdirectory #64642

@orangeruan128

Description

@orangeruan128

Bug Description

isShortTermMemoryPath() in short-term-promotion fails to match daily memory files stored in memory/daily/YYYY-MM-DD.md because the regex patterns only match memory/YYYY-MM-DD.md (no subdirectory).

This means the recall store (memory/.dreams/short-term-recall.json) is never written, and dreaming has zero data to work with.

Root Cause

Three regexes in the function all fail for paths like memory/daily/2026-04-09.md:

  1. SHORT_TERM_PATH_RE (/memory\/(\d{4})-(\d{2})-(\d{2})\.md$/) — expects memory/YYYY-MM-DD.md, no subdirectory
  2. SHORT_TERM_SESSION_CORPUS_RE — only matches sessions/ paths
  3. SHORT_TERM_BASENAME_RE (/^(\d{4})-(\d{2})-(\d{2})\.md$/) — anchored with ^ but tested against the full path, not the basename

Steps to Reproduce

  1. Store daily memory notes in memory/daily/ subdirectory (e.g., memory/daily/2026-04-09.md)
  2. Run memory_search — results come back with path: "memory/daily/2026-04-09.md", source: "memory"
  3. recordShortTermRecalls calls isShortTermMemoryPath("memory/daily/2026-04-09.md") — returns false
  4. No recall traces are ever recorded
  5. Dreaming cron finds 0 entries and does nothing

Expected Behavior

isShortTermMemoryPath should match daily notes in subdirectories like memory/daily/, memory/notes/, etc. — not just flat memory/YYYY-MM-DD.md.

Suggested Fix

Either:

  • Make SHORT_TERM_PATH_RE tolerate intermediate directories: /memory\/(?:[\w-]+\/)*(\d{4})-(\d{2})-(\d{2})\.md$/
  • Or test SHORT_TERM_BASENAME_RE against path.basename() instead of the full path (which is what the variable name implies)

Workaround

Move daily notes from memory/daily/ to memory/ root. This is what I did to fix my setup.

Environment

  • OpenClaw version: 2026.4.9
  • OS: macOS (arm64)
  • Memory provider: qmd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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