nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] Checkpoints skip files whose names contain non-ASCII characters

Open addyCooks opened this issue 2 weeks ago • 2 comments

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

  1. Create a git repo, commit café.txt and plain.txt, then modify both.
  2. Run new FileSnapshotService(root).getModifiedFiles().
  3. Run new CheckpointManager(root).saveCheckpoint('c1', [], 'p', 'm') and look at filesChanged and filesMissing.

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, :249 and :260: add -c core.quotePath=false to the git calls, or better use -z and split on \0. Check the parsing at lines 270-273.
  • Add a test with a file named café.txt and one with a CJK name.

addyCooks avatar Nov 14 '26 06:11 addyCooks

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!

addyCooks avatar Nov 14 '26 07:11 addyCooks

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.

bfs2021 avatar Nov 14 '26 07:11 bfs2021