Description
The memory-core plugin's file watcher (ensureWatcher()) passes glob patterns like memory/**/*.md to chokidar v5. However, chokidar v5 removed built-in glob support (no picomatch/anymatch dependency). The path is treated as a literal file path, stat() fails silently, and the watcher never registers for the memory/ directory.
As a result, new .md files created in workspace/memory/ are never indexed into SQLite until a gateway restart or manual memory_search trigger.
Steps to Reproduce
- Start gateway normally (memory-core registers, existing files indexed)
- Create a new file:
echo "# Test" > workspace/memory/test-new.md
- Wait 60 seconds
- Check:
sqlite3 ~/.openclaw/memory/main.sqlite "SELECT path FROM files WHERE path LIKE '%test-new%';"
- Result: empty — file not indexed
Root Cause
In manager-D8h-GoiI.js line ~2134:
watchPaths.add(path.join(this.workspaceDir, "memory", "**", "*.md"));
This creates a path like /path/to/workspace/memory/**/*.md.
Chokidar v5 (5.0.0) does NOT resolve globs — it passes this string directly to stat() which fails (no such file). The watcher is effectively a no-op for the memory directory.
Confirmed via test: watching the directory path works, watching the glob does not:
// Does NOT fire "add":
chokidar.watch("memory/**/*.md", { ignoreInitial: true })
// DOES fire "add":
chokidar.watch("memory/", { ignoreInitial: true })
Suggested Fix
Replace glob patterns with directory paths in ensureWatcher():
// Before (broken with chokidar v5):
watchPaths.add(path.join(this.workspaceDir, "memory", "**", "*.md"));
// After (works):
watchPaths.add(path.join(this.workspaceDir, "memory"));
Add .md extension filtering in the ignored option or in markDirty().
Environment
- OpenClaw: 2026.3.1
- chokidar: 5.0.0
- Node: v24.13.1
- OS: macOS 15.2 Sequoia (Darwin 24.2.0, Apple Silicon)
Description
The memory-core plugin's file watcher (
ensureWatcher()) passes glob patterns likememory/**/*.mdto chokidar v5. However, chokidar v5 removed built-in glob support (no picomatch/anymatch dependency). The path is treated as a literal file path,stat()fails silently, and the watcher never registers for thememory/directory.As a result, new .md files created in
workspace/memory/are never indexed into SQLite until a gateway restart or manualmemory_searchtrigger.Steps to Reproduce
echo "# Test" > workspace/memory/test-new.mdsqlite3 ~/.openclaw/memory/main.sqlite "SELECT path FROM files WHERE path LIKE '%test-new%';"Root Cause
In
manager-D8h-GoiI.jsline ~2134:This creates a path like
/path/to/workspace/memory/**/*.md.Chokidar v5 (5.0.0) does NOT resolve globs — it passes this string directly to
stat()which fails (no such file). The watcher is effectively a no-op for the memory directory.Confirmed via test: watching the directory path works, watching the glob does not:
Suggested Fix
Replace glob patterns with directory paths in
ensureWatcher():Add
.mdextension filtering in theignoredoption or inmarkDirty().Environment