Skip to content

[Bug] Memory system file not found errors and sync failures #9307

Description

@nikolasdehor

Problem

Memory system fails to find expected files and has sync failures, breaking context persistence.

Errors

1. Missing core memory files

2026-02-02T21:24:52.425Z [tools] read failed: ENOENT: no such file or directory,
access '/Users/nikolas/.openclaw/workspace/MEMORY.md'

2. Missing dated memory logs

2026-02-02T21:24:52.429Z [tools] read failed: ENOENT: no such file or directory,
access '/Users/nikolas/.openclaw/workspace/memory/2026-02-02.md'

2026-02-02T21:24:52.430Z [tools] read failed: ENOENT: no such file or directory,
access '/Users/nikolas/.openclaw/workspace/memory/2026-02-01.md'

2026-02-04T12:17:25.463Z [tools] read failed: ENOENT: no such file or directory,
access '/Users/nikolas/.openclaw/workspace/memory/2026-02-03.md'

3. Memory sync failures

2026-02-02T21:34:14.468Z [memory] sync failed (watch): Error: ENOENT: no such file or directory,
open '/Users/nikolas/.openclaw/workspace/memory/chat-nikolas-dm-full-log.md'

2026-02-02T21:34:14.469Z [memory] sync failed (search): Error: ENOENT: no such file or directory,
open '/Users/nikolas/.openclaw/workspace/memory/chat-nikolas-dm-full-log.md'

Root Causes

1. Hardcoded file expectations

Code expects specific files that may not exist:

  • MEMORY.md (uppercase)
  • Daily logs (YYYY-MM-DD.md)
  • Full chat logs (*-full-log.md)

2. No auto-creation

When files don't exist:

  • ❌ Errors thrown instead of creating files
  • ❌ No graceful fallback
  • ❌ Sync system breaks

3. File naming inconsistency

Multiple naming patterns:

  • MEMORY.md vs memory/ directory
  • chat-X.md vs chat-X-history.md vs chat-X-full-log.md

Impact

Severity: High

  • Memory persistence broken
  • Context not maintained across sessions
  • Agent "forgets" previous conversations
  • Sync errors spam logs

Expected Behavior

  1. Auto-create missing files
  2. Graceful degradation - Warn about missing files (don't error), Continue with empty memory, Create on first write
  3. Consistent naming - Document required file structure, Or make filenames configurable

Suggested Fixes

Auto-create files on first access, support flexible memory backends, or clarify file structure documentation.

Reproduction

  1. Delete ~/.openclaw/workspace/MEMORY.md
  2. Delete daily memory logs
  3. Start OpenClaw
  4. Observe ENOENT errors

Environment

  • OpenClaw: 2026.2.2-3
  • OS: macOS
  • Workspace: ~/.openclaw/workspace

Additional Context

The memory system appears to use two backends:

  1. File-based (.md files)
  2. SQLite database

This creates confusion about which is "source of truth". Recommend clarifying or unifying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions