Skip to content

[Bug]: change JarSkillRepositoryAdapter to ClasspathSkillRepository, then can't load the skill correctly #834

@tcsp

Description

@tcsp

Describe the bug
my code before:

try (JarSkillRepositoryAdapter repository = new JarSkillRepositoryAdapter("skills")) {
                allSkills = repository.getAllSkills();
            } catch (Exception e) {
                log.error("{} loadAgentSkill repository error:{}", getClass().getSimpleName(), e);
            }

my code after:

try (ClasspathSkillRepository repository = new ClasspathSkillRepository("skills")) {
                allSkills = repository.getAllSkills();
            } catch (Exception e) {
                log.error("{} loadAgentSkill repository error:{}", getClass().getSimpleName(), e);
            }

My code before runs correctly with agentscope-java:1.0.8, but my code after runs failed with agentscope-java:1.0.9.

related log records:

ClasspathSkillRepository       : Resource URL: jar:nested:/opt/app/xxx-app.jar/!BOOT-INF/lib/ai-provider-1.0-SNAPSHOT.jar!/skills
ClasspathSkillRepository       : Actual resource path: BOOT-INF/lib/ai-provider-1.0-SNAPSHOT.jar
ClasspathSkillRepository       : is in Jar environment: true

java.lang.RuntimeException: Failed to list skill directories
	at io.agentscope.core.skill.util.SkillFileSystemHelper.getAllSkills(SkillFileSystemHelper.java:156)
	at io.agentscope.core.skill.repository.ClasspathSkillRepository.getAllSkills(ClasspathSkillRepository.java:192)

I think the bug should occur in this part of the code.
Image

Environment (please complete the following information):

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions