[Bug] Checkpoints skip files whose names contain non-ASCII characters
Description
The checkpoint code reads file names from git diff --name-only and git ls-files without turning off git's path quoting. A file such as café.txt comes back as "caf\303\251.txt" (with quotes), cannot be found, and is not saved in the checkpoint.
Environment
- OS: Windows 11 Home 10.0.26300
- Node version: v22.22.3
- Nanocoder version: 1.32.0 (built from main at f92cce9c)
- Provider: Not provider-specific
- Model: Not model-specific
Steps to Reproduce
- Create a git repo, commit
café.txtandplain.txt, then modify both. - Run
new FileSnapshotService(root).getModifiedFiles(). - Run
new CheckpointManager(root).saveCheckpoint('c1', [], 'p', 'm')and look atfilesChangedandfilesMissing.
Expected Behavior
getModifiedFiles() returns ["café.txt", "plain.txt"] and both appear in filesChanged.
Actual Behavior
café.txt is reported under its quoted, escaped name, is listed as missing, and is not saved. Restoring the checkpoint will not bring it back.
Logs/Screenshots
modified: ["\"caf\\303\\251.txt\"","plain.txt"]
filesChanged: [ 'plain.txt', '.nanocoder/.gitignore' ]
filesMissing: [ '"caf/303/251.txt"' ]
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs with the latest version of nanocoder (main)
Suggested fix:
source/services/file-snapshot.ts:238,:249and:260: add-c core.quotePath=falseto the git calls, or better use-zand split on\0. Check the parsing at lines 270-273.- Add a test with a file named
café.txtand one with a CJK name.
Hey @bfs2021, could you drop a quick comment here so I can assign this to you? In future, please comment on the issue and wait for assignment before starting work. Thanks!
Happy to be assigned, thanks! Noted on the process — I'll comment here and wait for assignment before starting next time. The fix for this is up in #2204.