Windows: watcher never polls a project whose root path has non-ASCII characters (root_stat_error errno=42)

Offen
#3,043 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
c
Bereich
devtools

Rechercherichtung

Start in src/watcher/watcher.c at root_status() and the .git probe; the report identifies raw stat() calls and notes cbm_path_info_utf8 as an existing Windows path handling reference. Reproduce on Windows with a project under a CJK path and compare against an ASCII path. Done when the watcher polls and detects edits for both git and non-git roots with non-ASCII paths.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug parsing/quality ux/behavior windows
Version

codebase-memory-mcp 0.12.1

Platform

Windows (x64), Windows 11

Install channel

Prebuilt Windows binary in %LOCALAPPDATA%\Programs\codebase-memory-mcp

Binary variant

ui

What happened, and what did you expect?

When a project's root path contains non-ASCII characters (for example a CJK folder name), the background watcher never polls it. index_status keeps reporting watch.watched: true, watch.strategy: pending, and the daemon log repeats watcher.root_stat_error ... errno=42 on every poll.

Indexing itself works on the same path: both a manual index_repository and auto_index on session start succeed. Only auto-refresh is broken. It affects git roots and non-git roots (with watch_non_git=true).

The same fixture under an ASCII-only path is refreshed about 10 s after an edit (strategy: tree).

Expected: a root with non-ASCII characters in its path is polled the same way as an ASCII one.

Reproduction
  1. Dummy code, under a folder with a CJK name, for example C:\tmp\測試父層:
    • repoA\src\OrderService.cs (git init in repoA):
      namespace Shop { public class OrderService { public void PlaceOrder() {} } }
      
    • repoB\src\PaymentGateway.cs (git init in repoB):
      namespace Shop { public class PaymentGateway { public void ChargeCard() {} } }
      
  2. codebase-memory-mcp config set auto_index true, codebase-memory-mcp config set watch_non_git true, then start a fresh daemon.
  3. Open an MCP session with cwd C:\tmp\測試父層 (non-git root). The project is auto-indexed correctly.
  4. Add public void RefundCard() {} to PaymentGateway.cs.
  5. Call search_graph with name_pattern: ".*RefundCard.*" every 5 s for 3 minutes: always 0 results. index_status still shows strategy: pending and the original indexed_at.
  6. Same result with cwd C:\tmp\測試父層\repoA (a git root): edit not picked up after 90 s, strategy: pending.

Control: the identical fixture under C:\tmp\asciiparent: the new symbol is found about 10 s after the edit, strategy: tree.

Logs
level=warn msg=watcher.root_stat_error project=<...>-e6b8ace8a9a6e788b6e5b1a4 path=C:\tmp\測試父層 errno=42
level=warn msg=watcher.root_stat_error project=<...>-e6b8ace8a9a6e788b6e5b1a4-repoA path=C:\tmp\測試父層\repoA errno=42

(repeated on every poll)

Likely cause

errno 42 is EILSEQ in the MSVC CRT. poll_project() calls root_status() (src/watcher/watcher.c, line 994 at v0.12.1), which uses raw stat(root_path, &st) on the UTF-8 root path. The narrow CRT stat() does not accept UTF-8 CJK bytes, so it fails, the root is classified ROOT_UNCERTAIN, and poll_project() returns before the first poll. The comment near line 650 already notes that cbm_path_info_utf8 handles non-ASCII paths on Windows; root_status() and the raw stat() in the .git probe around line 532 do not use it.

Vorherrschende Sprache
C
Sterne
45.8k
Forks
3.8k
Ø Merge
2 T. 18 Std.
Gemergte PRs (30 T.)
108

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus DeusData/codebase-memory-mcp

Alle Issues in DeusData/codebase-memory-mcp

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.