-
Notifications
You must be signed in to change notification settings - Fork 463
Description
Describe the bug
The skill loads successfully, but the Python script within the skill is not triggered. The model only returns instructions on how to use the skill's commands instead of actually executing the script.
mycode
@GetMapping(value = "/AgentWithSkill")
public String AgentWithSkill() throws IOException {
OpenAIChatModel model =getModel_GLM5();
ClasspathSkillRepository repository = new ClasspathSkillRepository("skills");
AgentSkill findAPISkills = repository.getSkill("swagger_api_search");
Toolkit toolkit = new Toolkit();
SkillBox skillBox = new SkillBox(toolkit);
ShellCommandTool customShell = new ShellCommandTool(
null,
Set.of("python3", "node", "npm"),
null
);
skillBox.codeExecution()
.withShell(customShell)
.workDir("src/main/java/cn/wzhospital/appagentscope")
.withRead()
.withWrite()
.enable();
skillBox.registerSkill(findAPISkills);
ReActAgent agent = ReActAgent.builder()
.name("Assistant")
.sysPrompt("swagger接口解读")
.model(model)
.memory(new InMemoryMemory())
.skillBox(skillBox)
.build();
Msg response = agent.call(Msg.builder()
.textContent("在appointment中找下预约接口的详细信息")
.build()).block();
System.out.println(response.getTextContent());
return response.getTextContent();
}Log snippet
-----log begin------
2026-03-25T14:43:30.953+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] i.a.c.s.r.ClasspathSkillRepository : Resource URL: file:/C:/java_workspace/ai/app-agentscope/target/classes/skills
2026-03-25T14:43:30.955+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] i.a.c.s.r.ClasspathSkillRepository : is in Jar environment: false
2026-03-25T14:43:31.383+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] i.agentscope.core.tool.ToolGroupManager : Created tool group 'skill_code_execution_tool_group': Code execution tools for skills
2026-03-25T14:43:31.383+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] i.a.core.tool.coding.ShellCommandTool : ShellCommandTool initialized with base directory: C:\java_workspace\ai\app-agentscope\src\main\java\cn\wzhospital\appagentscope
2026-03-25T14:43:31.384+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.tool.Toolkit : Registered tool 'execute_shell_command' in group 'skill_code_execution_tool_group'
2026-03-25T14:43:31.385+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] i.a.core.tool.file.ReadFileTool : ReadFileTool initialized with base directory: C:\java_workspace\ai\app-agentscope\src\main\java\cn\wzhospital\appagentscope
2026-03-25T14:43:31.386+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.tool.Toolkit : Registered tool 'view_text_file' in group 'skill_code_execution_tool_group'
2026-03-25T14:43:31.386+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.tool.Toolkit : Registered tool 'list_directory' in group 'skill_code_execution_tool_group'
2026-03-25T14:43:31.387+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] i.a.core.tool.file.WriteFileTool : WriteFileTool initialized with base directory: C:\java_workspace\ai\app-agentscope\src\main\java\cn\wzhospital\appagentscope
2026-03-25T14:43:31.387+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.tool.Toolkit : Registered tool 'insert_text_file' in group 'skill_code_execution_tool_group'
2026-03-25T14:43:31.388+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.tool.Toolkit : Registered tool 'write_text_file' in group 'skill_code_execution_tool_group'
2026-03-25T14:43:31.388+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.skill.SkillBox : Code execution enabled with workDir: C:\java_workspace\ai\app-agentscope\src\main\java\cn\wzhospital\appagentscope, uploadDir: C:\java_workspace\ai\app-agentscope\src\main\java\cn\wzhospital\appagentscope\skills, tools: [shell=true, read=true, write=true]
2026-03-25T14:43:31.389+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.skill.SkillBox : Registered skill 'swagger_api_search_classpath-skills'
2026-03-25T14:43:31.395+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] i.agentscope.core.tool.ToolGroupManager : Created tool group 'skill-build-in-tools': skill build-in tools, could contain(load_skill_through_path)
2026-03-25T14:43:31.396+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.tool.Toolkit : Registered tool 'load_skill_through_path' in group 'skill-build-in-tools'
2026-03-25T14:43:31.396+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.skill.SkillBox : Registered skill load tools to toolkit
2026-03-25T14:43:31.399+08:00 INFO 42720 --- [app-agentscope] [nio-8080-exec-1] io.agentscope.core.skill.SkillBox : Uploaded 2 skill files to: C:\java_workspace\ai\app-agentscope\src\main\java\cn\wzhospital\appagentscope\skills
2026-03-25T14:49:07.206+08:00 INFO 42720 --- [app-agentscope] [oundedElastic-2] i.a.core.skill.SkillToolFactory : Activated skill: swagger_api_search_classpath-skills
2026-03-25T14:49:16.758+08:00 INFO 42720 --- [app-agentscope] [oundedElastic-3] i.a.core.skill.SkillToolFactory : Activated skill: swagger_api_search_classpath-skills
2026-03-25T14:49:22.554+08:00 INFO 42720 --- [app-agentscope] [oundedElastic-1] i.a.core.skill.SkillToolFactory : Activated skill: swagger_api_search_classpath-skills
根据 Swagger API 搜索 Skill,我为您提供了查找 appointment 服务预约接口的方法。appointment 服务是"门诊预约服务,包含门诊排班、门诊预约、签到等业务"。 ## 🔍 查找命令 您可以使用以下命令来查找 appointment 服务的接口: ### 1. 查看 appointment 服务的所有接口 bash python scripts/search_api.py -s appointment ### 2. 搜索与"预约"相关的接口 bash python scripts/search_api.py -k "预约" ### 3. 组合搜索 - 在 appointment 服务中搜索预约 bash python scripts/search_api.py -s appointment -k "预约" ### 4. 查看特定接口的详细信息 找到接口路径后,使用 -d 参数查看详情: bash python scripts/search_api.py -p "/api/appointment/list" -d --- ## 📋 常用预约相关接口路径(参考) 根据 appointment 服务的功能,常见的接口可能包括: | 功能 | 可能的接口路径 | |------|---------------| | 查询排班 | /api/appointment/scheduling/list | | 创建预约 | /api/appointment/booking/create | | 取消预约 | /api/appointment/booking/cancel | | 签到 | /api/appointment/checkin | | 查询预约记录 | /api/appointment/record/list | | 获取可预约时间段 | /api/appointment/time-slots | --- ## 💡 建议 1. 首次使用会缓存所有 Swagger 文档,可能需要一些时间 2. 使用 -r 参数可以强制刷新缓存: bash python scripts/search_api.py -s appointment -r 3. 如果您知道具体的接口路径,可以直接使用 -p 参数查询详情 您可以运行上述命令来获取 appointment 服务的实际接口列表。如果您找到具体的接口路径后想要查看详细信息,请告诉我,我可以帮您进一步分析!
-----log end------
Expected behavior
The Agent should execute the skill's Python script (e.g., scripts/search_api.py) and return the actual interface information from the script output, similar to the behavior when running the same skill in OpenClaw or OpenCode.
Error messages
No error messages are displayed. Logs show the skill is successfully loaded and activated, but the model does not execute the script—it directly generates command usage instructions instead.
Environment (please complete the following information):
AgentScope-Java Version: 1.0.10
Java Version: 21
Python Version: 3.12.7
OS: Windows11
Additional context
The same skill works correctly with the same LLM (GLM-5) in OpenCode—it executes the Python script and returns actual data.

Metadata
Metadata
Assignees
Labels
Type
Projects
Status