Skip to content

fix(filesystem): treat "." as root equivalent in CompositeFilesystem#1830

Merged
oss-maintainer merged 2 commits into
mainfrom
fix/1737-composite-filesystem-root-path
Jun 25, 2026
Merged

fix(filesystem): treat "." as root equivalent in CompositeFilesystem#1830
oss-maintainer merged 2 commits into
mainfrom
fix/1737-composite-filesystem-root-path

Conversation

@chickenlj

Copy link
Copy Markdown
Collaborator

Summary

  • WorkspacePathNormalizer.tryStrip() returns "." when the input path equals the workspace root prefix, but CompositeFilesystem.ls(), grep(), and glob() only merged routed virtual directories (e.g. skills/, memory/, knowledge/) when the path was exactly "/".
  • This caused list_files at the workspace root to return "Empty or not a directory", making the agent unable to browse the workspace.
  • Fix: treat "." as equivalent to "/" in all three methods.

Fixes #1737

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
@chickenlj chickenlj requested review from a team and Copilot June 18, 2026 06:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../harness/agent/filesystem/CompositeFilesystem.java 0.00% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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 AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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 AgentScopeJavaBot added bug Something isn't working area/harness agentscope-harness (test/runtime support) labels Jun 19, 2026
@oss-maintainer oss-maintainer merged commit 8cfd70d into main Jun 25, 2026
10 of 11 checks passed
@oss-maintainer oss-maintainer deleted the fix/1737-composite-filesystem-root-path branch June 25, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/harness agentscope-harness (test/runtime support) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:CompositeFilesystem.ls() 根目录不显示路由条目 — WorkspacePathNormalizer.tryStrip() 返回 "." 而非 "/"

4 participants