Skip to content

fix(memory): parse Windows backslash paths in memory/cc path locators - #2060

Open
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/memory-windows-paths
Open

fix(memory): parse Windows backslash paths in memory/cc path locators#2060
YOMXXX wants to merge 1 commit into
XiaomiMiMo:mainfrom
YOMXXX:fix/memory-windows-paths

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2012 (Issues 1 & 2). The memory system is non-functional on Windows: parsePath() in packages/opencode/src/memory/paths.ts matches /memory/... with a forward-slash-only regex, but Windows returns backslash paths (\memory\...). Every file fails to parse → reconcileMemory() skips all → memory_fts stays empty → the memory tool always returns "No matches".

Fix: normalize \/ before the forward-slash regex match in both parsePath() and parseCcPath() (which has the same Windows failure). No-op for POSIX paths.

const normalized = absPath.replace(/\\/g, "/")
const m = normalized.match(/\/memory\/(global|projects|sessions).../)

Test Plan

  • New Windows (backslash) tests: parsePath global/project-MEMORY/session-checkpoint; parseCcPath CC notes.
  • bun test test/memory/paths.test.ts test/memory/cc-paths.test.ts — 38 pass (existing forward-slash tests green).
  • bun typecheck — clean.

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Memory system broken on Windows — empty FTS + no project isolation

1 participant