Skip to content

[Bug]: InvalidPathException when using default FileSystemSkillRepository on Windows due to illegal character : #842

Closed

Description

@xiongbw

Describe the bug
When creating an AgentSkill object using FileSystemSkillRepository constructor without passing the source field on Windows system, an InvalidPathException is thrown when building the ReActAgent object with .skillBox(skillBox). The exception occurs because the default path contains the illegal character : which is not allowed in Windows file paths.

To Reproduce
Steps to reproduce the behavior:

  1. Create an AgentSkill object without specifying the source field:

    // ...
    // Use FileSystemSkillRepository constructor without source param
    FileSystemSkillRepository repository = new FileSystemSkillRepository(resourcesDir, false);
    AgentSkill skillCreator = repository.getSkill(SKILL_NAME);
    skillBox.registration().skill(skillCreator).apply();
    // ...
    // Exception thrown while creating ReActAgent when loading skillBox.
    ReActAgent agent = ReActAgent.builder()
        .name("agent")
        .model(model)
        .skillBox(skillBox) // Because the skillBox has no source set, and the default value used contains a ':' character.
        .build();
  2. Execute on Windows(You can directly run the AgentSkillExample file on Windows.)

  3. See error
    Expected behavior
    When using the default source field (without passing it explicitly), the ReActAgent should be able to load the SkillBox normally, rather than failing due to illegal path characters. The default source field should be a valid file system path that does not contain characters illegal on Windows systems.

Error messages

Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 24: skill-creator_filesystem:resources_skills
	at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
	at java.base/java.nio.file.Path.resolve(Path.java:515)
	at io.agentscope.core.skill.SkillBox.uploadSkillFiles(SkillBox.java:748)
	at io.agentscope.core.ReActAgent$Builder.configureSkillBox(ReActAgent.java:1549)
	at io.agentscope.core.ReActAgent$Builder.build(ReActAgent.java:1379)
	at io.agentscope.examples.quickstart.AgentSkillExample.main(AgentSkillExample.java:102)

Environment:

  • AgentScope-Java Version: 1.0.9
  • Java Version: 17
  • OS: Windows

Additional context
The problematic path is skill-creator_filesystem:resources_skills, where the colon : is an illegal character in Windows file systems, causing the Path.resolve() method to throw an exception. This issue may not occur on Linux/Mac systems as their file systems allow colons in paths.

Activity

  1. added
    bug
    on Feb 27, 2026
  2. changed the title [-][Bug]: `InvalidPathException` when using default FileSystemSkillRepository on **Windows** due to illegal character `:`[/-] [+][Bug]: `InvalidPathException` when using default FileSystemSkillRepository on Windows due to illegal character `:`[/+] on Feb 27, 2026
  3. changed the title [-][Bug]: `InvalidPathException` when using default FileSystemSkillRepository on Windows due to illegal character `:`[/-] [+][Bug]: `InvalidPathException` when using default FileSystemSkillRepository on `Windows` due to illegal character `:`[/+] on Feb 27, 2026
  4. amyaxy commented on Mar 5, 2026

    @amyaxy
    Contributor

    me too.

  5. duanfangrui commented on Mar 9, 2026

    @duanfangrui

    Modify the colon in the getSource method of the FileSystemSkillRepository class to an underscore.
    Then you can run it normally.

        @Override
        public String getSource() {
    //        return source != null ? source : "filesystem:" + buildDefaultSourceSuffix();
            return source != null ? source : "filesystem_" + buildDefaultSourceSuffix();
        }
    
  6. xiongbw commented on Mar 9, 2026

    @xiongbw
    Author

    Modify the colon in the getSource method of the FileSystemSkillRepository class to an underscore. Then you can run it normally.

        @Override
        public String getSource() {
    //        return source != null ? source : "filesystem:" + buildDefaultSourceSuffix();
            return source != null ? source : "filesystem_" + buildDefaultSourceSuffix();
        }
    

    Yes, it's also possible to directly specify the source param value like example-skill at the FileSystemSkillRepository repository = new FileSystemSkillRepository(resourcesDir, false, "example-skill"); , and that would be fine as well.

  7. moved this from Backlog to In progress in AgentScope Javaon Mar 9, 2026
  8. added a commit that references this issue on Mar 11, 2026
    ba78729
  9. moved this from In progress to Done in AgentScope Javaon Mar 11, 2026
  10. added a commit that references this issue on May 21, 2026
    fa73bd7
  11. added a commit that references this issue on Aug 12, 2026
    b6a94b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions