Skip to content

fix(harness): skip composite routes for PathPolicy host mounts - #2892

Open
jialiuyang wants to merge 1 commit into
agentscope-ai:mainfrom
jialiuyang:fix/composite-fs-host-mount-routes
Open

fix(harness): skip composite routes for PathPolicy host mounts#2892
jialiuyang wants to merge 1 commit into
agentscope-ai:mainfrom
jialiuyang:fix/composite-fs-host-mount-routes

Conversation

@jialiuyang

Copy link
Copy Markdown

AgentScope-Java Version

2.0.x (main)

Description

CompositeFilesystem.routeForPath strips a leading slash before prefix matching so /skills/foo and skills/foo hit the same store. That also makes a host path such as /knowledge/services.md match the knowledge/ route. The request is forwarded to the remote/overlay segment (usually empty) and the file on the host mount is never read — no exception, just a failed result.

This change treats extra PathPolicy roots on a LocalFilesystem default backend (anything other than the workspace cwd) as host mounts and keeps those absolute paths on the default backend. An optional constructor argument accepts the same roots when the default store is not LocalFilesystem. Workspace-relative knowledge/... paths still use the route.

Fixes #2690

Checklist

  • Code has been formatted with mvn spotless:apply
  • Targeted tests passing (CompositeFilesystemTest)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated — N/A
  • Code is ready for review

Strip-leading-slash routing made /knowledge/file.md match the knowledge/
store, so a host mount at that path was never read. Extra PathPolicy roots
outside the workspace (and optional constructor hostRoots) now stay on the
default backend. Workspace-relative knowledge/ paths still use the route.

Fixes agentscope-ai#2690
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.

[Bug]:CompositeFilesystem 的路由前缀会劫持同名的宿主挂载点(/knowledge、/skills…),静默读不到文件

1 participant