Windows: memory index is never populated — POSIX-only path regex skips every file ("path outside memory layout, skipping")
Description
On Windows the memory index is never populated, so the memory tool always returns zero results — it logs one warning per file and moves on.
Error message
WARN service=memory.reconcile
path=C:\Users\<user>\.local\share\mimocode\memory\sessions\ses_...\notes.md
path outside memory layout, skippingRoot cause
parsePath in packages/opencode/src/memory/paths.ts matches with a POSIX-only pattern:
const m = absPath.match(/\/memory\/(global|projects|sessions)(?:\/([^/]+))?\/(.+)\.md$/)Every path that reaches it is built with path.join(), which emits \ on win32. A real
path contains mimocode\memory\sessions\..., so there is no /memory/ substring, the
regex never matches, parsePath returns null, and reconcileMemory skips the file:
const loc = parsePath(p)
if (!loc) {
log.warn("path outside memory layout, skipping", { path: p })
continue
}Net effect: memory_fts stays empty, so memory.search returns [] for every query.
parseCcPath has the same defect, which also breaks cc_index.
Evidence
A 0.1.15 Windows session logged 511 identical warnings for 511 memory files — a 1:1 ratio, i.e. nothing was indexed at all. The count tracks the number of files on disk.
Expected behavior
The memory index populates on Windows the same way it does on macOS/Linux, and
memory.search returns results. Paths outside the memory layout should still be skipped.
Plugins
No response
MiMoCode version
0.1.15 (Windows 11 x64)
Steps to reproduce
- On Windows, create memory under the default layout, e.g.
<data>/memory/global/MEMORY.md - Run any
memorysearch - Observe: 0 results, plus one
path outside memory layout, skippingwarning per file in<data>/log/dev-worker-*.log
A unit test reproduces it directly — the win32 path does not match:
parsePath(String.raw`C:\Users\me\.local\share\mimocode\memory\global\MEMORY.md`)
// -> null (expected { scope: "global", scope_id: "", type: "memory", key: "MEMORY" })Screenshot and/or share link
No response
Operating System
Windows 11 (x64). macOS/Linux are unaffected — path.join already emits / there.
Terminal
Windows Terminal / PowerShell
Source: XiaomiMiMo/MiMo-Code