Skip to content

Issue with windows paths? #20

Closed
Closed

Description

@mattepiu

From cmd:

C:\Users\m>C:\Users\m\bin\codebase-memory-mcp.exe cli index_repository '{"repo_path": "C:\Temp\codebase-memory-mcp"}'
error: invalid arguments: invalid character '\'' looking for beginning of value

C:\Users\m>C:\Users\m\bin\codebase-memory-mcp.exe cli index_repository '{"repo_path": "C:\\Temp\\codebase-memory-mcp"}'
error: invalid arguments: invalid character '\'' looking for beginning of value

from git bash always ends a scan with:

Indexed "C:-Temp-codebase-memory-mcp": 2912 nodes, 10333 edges
  indexed_at: 2026-03-05T14:04:06Z
  db: C:\Users\m\.cache\codebase-memory-mcp\C:-Temp-codebase-memory-mcp.db

then if I check ~/.cache/codebase-memory-mcp directory:

$ ls -lahtr ~/.cache/codebase-memory-mcp/
total 4.0K
drwxr-xr-x 1 m 4096 0 Mar  5 15:04 ../
drwxr-xr-x 1 m 4096 0 Mar  5 15:04 ./
-rw-r--r-- 1 m 4096 0 Mar  5 15:04 C

> /c/Temp/codebase-memory-mcp (main)
$ cat ~/.cache/codebase-memory-mcp/C  

[NO OUTPUT AS FILE IS EMPTY]

Activity

  1. mattepiu commented on Mar 5, 2026

    @mattepiu
    Author

    Fix Required:

    1. In internal/pipeline/pipeline.go, line 71, add replacement for : after the / replacement:
      name := strings.ReplaceAll(cleaned, "/", "-")
      name = strings.ReplaceAll(name, ":", "-") // Add this line

    2. Add Windows test case in internal/pipeline/pipeline_test.go at line 790:
      {"C:/Users/project", "C-Users-project"},

  2. xberry1231 commented on Mar 6, 2026

    @xberry1231

    This'll give you C--Users-project so that test will fail. Could use regexp [/:]+ or change the replace to avoid the double -- but I suspect the -- may be preferred

  3. added a commit that references this issue on Mar 6, 2026
  4. DeusData commented on Mar 6, 2026

    @DeusData
    Owner

    This should be addressed in v0.4.1 — ProjectNameFromPath() now sanitizes colons and backslashes from Windows paths, and collapses consecutive dashes. For example C:\Users\project now correctly produces C-Users-project instead of C:-Users-project.

    Could you update and test again? Let me know if you still encounter any issues.

  5. xberry1231 commented on Mar 6, 2026

    @xberry1231

    I'm getting a missing dll error for libwinpthread-1.dll. not sure if I did something wrong with swapping out the builds - I uninstalled the previous dist and deleted the binary then reinstalled from the latest windows built archive. i'll try rebuilding from source but maybe I made a dumb mistake somewhere.

  6. DeusData commented on Mar 6, 2026

    @DeusData
    Owner

    Thanks for the follow-up! The libwinpthread-1.dll missing error is because the Windows binary was dynamically linking against the MinGW runtime. I've pushed a fix that statically links all C dependencies (-extldflags '-static'), so the binary will be fully self-contained.

    This will be in the next release — I'll get it out shortly. In the meantime, building from source with go build ./cmd/codebase-memory-mcp/ should work since Go's default linker behavior on your local toolchain may differ.

  7. DeusData commented on Mar 6, 2026

    @DeusData
    Owner

    v0.4.2 is out now with the static linking fix. The Windows binary should no longer require libwinpthread-1.dll. Could you grab the latest release and try again?

  8. xberry1231 commented on Mar 6, 2026

    @xberry1231

    Thanks - was able to get it installed and run from that binary. I'm now getting a warning from the watcher.root_gone, it looks like it's prepending a / in front of the path it's checking for windows and it's on a loop, no progress made. The indexing did work last night when I ran it on v0.4.0.

    2026/03/06 16:02:12 WARN watcher.root_gone project="c-Users-XanderBerry-..." path="/c:/Users/XanderBerry/..."

  9. DeusData commented on Mar 6, 2026

    @DeusData
    Owner

    v0.4.3 addresses the watcher path issue. The root cause was parseFileURI returning /C:/Users/... (with a leading /) from file:///C:/... URIs — Go's url.Parse includes the leading slash per RFC 3986, but Windows can't use it as a filesystem path. The watcher then failed os.Stat on every poll cycle, causing the watcher.root_gone loop.

    Could you update to v0.4.3 and test again? The watcher should now correctly resolve Windows drive letter paths.

  10. DeusData commented on Mar 6, 2026

    @DeusData
    Owner

    Correction: the fix with the unified version management is in v0.4.4 (v0.4.3 was built before the final commit). Please update to v0.4.4.

  11. DeusData commented on Mar 8, 2026

    @DeusData
    Owner

    Is this issue still active? Otherwise I will close it :)

  12. xberry1231 commented on Mar 8, 2026

    @xberry1231

    This issue is resolved for me. I do have another issue which I'm not sure is related to my dev env being windows or my package management strategy, but when I index a repository for the first time, it works (the db is created + shared memory / WAL) but then starts printing a bunch of warnings on a loop and the only way to correct it is to send a SIGINT to the terminal. Background here is I use pixi for my package management so my venvs are in my local repo directories, and the indexing seems to extend to those as well. I don't really think that's necessary but haven't figured out how to exclude the .pixi directory from being indexed. The warnings extend to other indexed repos as well (see below, this is two different repos i've indexed). Lmk if there's a solution for this or if you think I should open a separate issue.

    2026/03/08 15:54:46 WARN discover.skip_large_json path=opencommitx.pixi\envs\default\conda-meta\tzdata-2025c-hc9c84f9_1.json size=212118
    2026/03/08 15:54:46 WARN discover.skip_large_json path=.pixi\envs\default\conda-meta\python-3.13.12-h09917c8_100_cp313.json size=490300

  13. DeusData commented on Mar 9, 2026

    @DeusData
    Owner

    Will see if we can add a "ignore path matches" like a .gitignore. Would be a good feature :) Will note it down

  14. added 2 commits that reference this issue on Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions