Skip to content

fix(skill): resolve Windows path compatibility issue in FileSystemSkillRepository#915

Closed
lifl00001 wants to merge 29 commits intoagentscope-ai:mainfrom
lifl00001:fix/windows-skill-source-path
Closed

fix(skill): resolve Windows path compatibility issue in FileSystemSkillRepository#915
lifl00001 wants to merge 29 commits intoagentscope-ai:mainfrom
lifl00001:fix/windows-skill-source-path

Conversation

@lifl00001
Copy link
Contributor

Description

Fixes Windows compatibility issue where FileSystemSkillRepository.getSource() returns source identifiers containing colons (e.g., filesystem:resources_skills), which causes InvalidPathException when used with
Path.resolve() on Windows file systems.

Fixes: Windows users can now use the Skill system without path errors.

Root Cause

On Windows, the colon (:) is a reserved character that can only be used for drive letters (e.g., C:). When Path.resolve() encounters a path string containing a colon, the Windows file system validator throws
InvalidPathException.

The error occurs in this call chain:
FileSystemSkillRepository.getSource() → returns "filesystem:resources_skills"

AgentSkill.getSkillId() → returns "skill-name_filesystem:resources_skills"

SkillBox.uploadSkillFiles() → calls targetDir.resolve(skillId)

InvalidPathException: Illegal char <:> at index X

Changes

  • FileSystemSkillRepository.java: Changed separator from : to _ in getSource() method
  • FileSystemSkillRepositoryTest.java: Updated 5 test cases to expect new format

Format Change

Before After
filesystem:parent_child filesystem_parent_child

Platform Impact

Platform Before After
Windows ❌ InvalidPathException ✅ Works
Linux ✅ Works ✅ Works
macOS ✅ Works ✅ Works

Testing

  • Updated unit tests pass
  • mvn spotless:apply executed
  • All existing tests continue to pass

Checklist

  • Code follows project style guidelines (Spotless)
  • Self-review completed
  • Changes are limited to the scope of the fix
  • Corresponding tests updated

flli10 and others added 28 commits December 30, 2025 22:00
…llRepository

The getSource() method in FileSystemSkillRepository returned source identifiers
containing colons (e.g., \"filesystem:resources_skills\"). When used with
Path.resolve() on Windows, this caused InvalidPathException because colons are
reserved characters on Windows file systems.

Changes:
- Changed separator from \":\" to \"_\" in getSource() method
- Updated corresponding tests to expect new format

Before: filesystem:parent_child
After:  filesystem_parent_child

Fixes: Windows users can now use Skill system without path errors
Platform impact: Windows (fixed), Linux/macOS (no impact, already worked)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lifl00001 lifl00001 requested a review from a team March 10, 2026 13:15
@cla-assistant
Copy link

cla-assistant bot commented Mar 10, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ lifl00001
❌ flli10


flli10 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Fix code style violations in DifyRAGExample.java:
- Remove unused import (UserAgent)
- Remove redundant empty line

This fixes the spotless check failure in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lifl00001
Copy link
Contributor Author

CLA signed

@lifl00001
Copy link
Contributor Author

I have signed the CLA at https://cla-assistant.io/agentscope-ai/agentscope-java?pullRequest=915. Please recheck.

@lifl00001 lifl00001 closed this Mar 11, 2026
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.

1 participant