Skip to content

loopguard: count an edit named by a Windows path by its basename - #165

Merged
Aaron Li (aaron-jx-li) merged 1 commit into
microsoft:mainfrom
Bortlesboat:fix/loopguard-windows-basename
Nov 8, 2026
Merged

Aaron Li (aaron-jx-li) merged 1 commit into
microsoft:mainfrom
Bortlesboat:fix/loopguard-windows-basename

Conversation

@Bortlesboat

Copy link
Copy Markdown
Contributor

Claude Code on Windows passes an edit tool's file_path with backslashes (C:\repo\pkg\mod.py), and loopguard.state.basename split only on /, so the guard keyed that edit by the whole path. A later sed -i or git checkout -- pkg/mod.py of the same file then counted as a different file (inflating distinct_edit_files, and dropping the checkout because the turn had "not edited" mod.py), and the judge's digest and the redirect carried the full local path instead of the basename. basename now treats \ as a separator too. The new test in tests/test_live_core.py fails on main ({'C:\\w\\repo\\pkg\\mod.py': 1, 'mod.py': 1}) and passes with the change; python -m pytest tests on Windows otherwise shows the same results as main.

Claude Code on Windows gives an edit tool's file_path with backslashes, so the guard
counted the edit under the whole path: a later shell edit or `git checkout --` of the same
file counted as a different file, and the judge's digest carried the full path.
@aaron-jx-li
Aaron Li (aaron-jx-li) merged commit ff1a899 into microsoft:main Nov 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants