fix(filesystem): treat "." as root equivalent in CompositeFilesystem#1830
Conversation
WorkspacePathNormalizer.tryStrip() returns "." when the input path equals the workspace root, but CompositeFilesystem.ls/grep/glob only merged route entries when path was exactly "/". This caused list_files at the workspace root to miss all routed virtual directories (skills/, memory/, knowledge/, etc.), returning "Empty or not a directory". Fixes #1737
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This is a correct and well-scoped fix for #1737. WorkspacePathNormalizer.tryStrip() returns "." when the input path equals the workspace root, but CompositeFilesystem.ls(), grep(), and glob() only treated "/" as root, causing workspace-root listing to fail. The fix adds "." as a root-equivalent path in all three methods. One inconsistency is worth addressing: ls() normalizes "." to "/" before delegating to the default backend, but grep() and glob() pass the raw "." through — this works with LocalFilesystem but would break with RemoteFilesystem (whose normalizePath(".") yields "/.") and is inconsistent within the same class. No tests are added for the regression scenario.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This is a correct and well-scoped fix for #1737. WorkspacePathNormalizer.tryStrip() returns "." when the input path equals the workspace root, but CompositeFilesystem.ls(), grep(), and glob() only treated "/" as root, causing workspace-root listing to fail. The fix adds "." as a root-equivalent path in all three methods. One inconsistency is worth addressing: ls() normalizes "." to "/" before delegating to the default backend, but grep() and glob() pass the raw "." through — this works with LocalFilesystem but would break with RemoteFilesystem (whose normalizePath(".") yields "/.") and is inconsistent within the same class. No tests are added for the regression scenario.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
Summary
WorkspacePathNormalizer.tryStrip()returns"."when the input path equals the workspace root prefix, butCompositeFilesystem.ls(),grep(), andglob()only merged routed virtual directories (e.g.skills/,memory/,knowledge/) when the path was exactly"/".list_filesat the workspace root to return"Empty or not a directory", making the agent unable to browse the workspace."."as equivalent to"/"in all three methods.Fixes #1737