fix(harness): resolve shared skill cache paths#2183
Conversation
|
你好,有联系方式吗?可以发我主页邮箱 |
发送给您了 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
Fixes shared skill cache path resolution for remote filesystems. Ensures cache paths are resolved relative to the workspace root.
Findings
- [Info] Minimal change — adds path resolution logic. No obvious issues.
Verdict
LGTM.
Automated review by github-manager
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
Clean, targeted fix for issue #2181. The root cause was correctly identified: WorkspacePathNormalizer was stripping .skills-cache paths to relative form, causing LocalFilesystem.applyNamespacePrefix to inject a user namespace prefix and resolve to the wrong location. The fix preserves .skills-cache as a workspace-absolute path, skipping namespace injection.
One minor concern: the string ".skills-cache" is now defined as constants in both WorkspacePathNormalizer and MarketplaceStager. If one is modified without the other, it would cause a silent regression. Consider having WorkspacePathNormalizer reference MarketplaceStager.CACHE_DIR, or extract to a shared constants class if module dependency direction prevents it.
The end-to-end path resolution flow was verified correct, and the test coverage (unit + integration) is thorough with 33 tests passing.
| */ | ||
| public final class WorkspacePathNormalizer { | ||
|
|
||
| private static final String SHARED_SKILL_CACHE = ".skills-cache"; |
There was a problem hiding this comment.
[minor] The string ".skills-cache" is also defined as MarketplaceStager.CACHE_DIR. If one changes without the other, the normalizer will silently stop recognizing cache paths. Consider referencing MarketplaceStager.CACHE_DIR directly, or extracting to a shared constants class to eliminate the duplication risk.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
Clean, targeted fix for issue #2181. The root cause was correctly identified: WorkspacePathNormalizer was stripping .skills-cache paths to relative form, causing LocalFilesystem.applyNamespacePrefix to inject a user namespace prefix and resolve to the wrong location. The fix preserves .skills-cache as a workspace-absolute path, skipping namespace injection.
One minor concern: the string ".skills-cache" is now defined as constants in both WorkspacePathNormalizer and MarketplaceStager. If one is modified without the other, it would cause a silent regression. Consider having WorkspacePathNormalizer reference MarketplaceStager.CACHE_DIR, or extract to a shared constants class if module dependency direction prevents it.
The end-to-end path resolution flow was verified correct, and the test coverage (unit + integration) is thorough with 33 tests passing.
| */ | ||
| public final class WorkspacePathNormalizer { | ||
|
|
||
| private static final String SHARED_SKILL_CACHE = ".skills-cache"; |
There was a problem hiding this comment.
[minor] The string ".skills-cache" is also defined as MarketplaceStager.CACHE_DIR. If one changes without the other, the normalizer will silently stop recognizing cache paths. Consider referencing MarketplaceStager.CACHE_DIR directly, or extracting to a shared constants class to eliminate the duplication risk.
AgentScope-Java Version
2.0.1-SNAPSHOT
Description
Fixes #2181.
Marketplace skill resources are staged in the shared workspace cache:
/workspace/.skills-cache/<source>/<skill>/With
IsolationScope.USER,WorkspacePathNormalizerpreviously converted this into a relative path.LocalFilesystemthen applied the user namespace and incorrectly resolved it as:/workspace/<userId>/.skills-cache/<source>/<skill>/This caused auxiliary marketplace skill files, such as
docx-js.md, to be inaccessible through filesystem tools.This PR keeps
.skills-cacheas a virtual workspace-absolute path so it remains in the shared workspace root. Other paths, includingskills/..., continue to use the existing user namespace behavior.Tests
Added regression coverage for:
IsolationScope.USERFilesystemTool→WorkspacePathNormalizer→LocalFilesystempathRelated test suites passed:
WorkspacePathNormalizerTestFilesystemToolTestLocalFilesystemModeTestMarketplaceStagerExecBitTestSandboxLifecycleMiddlewareCallbackTestResult: 33 tests passed with no failures or errors.
Checklist