Checkpoint linking fails for non-ASCII filenames
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.1k
- Forks
- 475
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 178
Description
What happened?
In the interactive/default prompt-mode commit-linking path, getStagedFiles runs git diff --cached --name-only without -z and treats the newline-delimited output as literal repository paths.
Git quotes and C-escapes unusual pathnames in this output mode. For example, with the default core.quotePath=true, café.go is emitted as "caf\303\251.go". Entire then exact-compares that display string with the literal café.go stored in SessionState.FilesTouched. The comparison fails, so a related commit can be classified as containing no agent work and receive no Entire-Checkpoint trailer.
I reproduced this against current main using a focused exact-source test. An ASCII control received its trailer, while an otherwise equivalent UTF-8 canary did not. Parsing the same Git output with -z restored the literal path and the expected overlap.
The affected Git commit itself is still created. The demonstrated impact is missing commit-to-session linkage and incomplete provenance, including potentially incomplete entire explain attribution. I did not observe source loss, transcript deletion, remote checkpoint loss, or a security boundary violation.
Steps to reproduce
-
Use the default
core.quotePath=truesetting and default prompt-mode commit linking in an interactive terminal. -
Start an agent session that records only a non-ASCII file such as
café.goinFilesTouched, with no pending task record that would bypass overlap detection. -
Stage that file and make a manual commit:
git config core.quotePath true git add "café.go" git diff --cached --name-only git commit -m "update localized file" -
Inspect the commit message.
Expected: the related session is detected and an Entire-Checkpoint trailer is added.
Actual: Git's quoted display path does not match the literal FilesTouched path, the session is excluded, and the trailer is omitted.
Focused control/canary output:
ASCII control.go:
literal_match=true overlap=true
NUL-delimited path="control.go"
checkpoint_trailer=true
UTF-8 café.go:
getStagedFiles returned Git's quoted C-escaped display path
literal_match=false overlap=false
NUL-delimited path="café.go"
checkpoint_trailer=false
The focused test passed once and then passed three consecutive repeat runs.
Entire CLI version
v0.10.6
OS and architecture
Windows 11 amd64 (build 26200.9445)
Agent
Codex
Terminal
Codex integrated terminal, PowerShell 7.6.5
Logs / debug output
getStagedFiles("control.go") = ["control.go"]
literal_match=true overlap=true
checkpoint_trailer=true
getStagedFiles("café.go") = [Git quoted C-escaped display path]
literal_match=false overlap=false
checkpoint_trailer=false
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the getStagedFiles entry point and the focused exact-source test described in the issue. First reproduce the mismatch with core.quotePath=true, then inspect the staged-file parsing path; done means non-ASCII filenames are returned literally and the focused test verifies the Entire-Checkpoint trailer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100