Skip to content

Commit 2c815db

Browse files
mjlzzclaude
andcommitted
fix(adk): normalize path separators in InMemoryBackend for Windows compatibility
On Windows, filepath.Clean converts forward slashes to backslashes, but all path operations in LsInfo, GlobInfo, GrepRaw, Read, Write, and Edit hardcode "/" as the path separator. This mismatch causes every prefix check to fail, making the InMemoryBackend completely unusable on Windows. The fix wraps filepath.Clean with filepath.ToSlash to ensure paths always use forward slashes internally, matching the hardcoded "/" separators used throughout the backend. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 30f5961 commit 2c815db

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

adk/filesystem/backend_inmemory.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ func normalizePath(path string) string {
697697
path = "/" + path
698698
}
699699

700-
return filepath.Clean(path)
700+
// Use ToSlash so paths always use forward-slash internally, regardless of OS.
701+
return filepath.ToSlash(filepath.Clean(path))
701702
}
702703

703704
type grepCollector struct {

0 commit comments

Comments
 (0)