Skip to content

[Bug]:agentscope-builder模块本地运行skills加载报错 #1985

Description

@DoubleLuXu

AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.

Describe the bug
本地运行agentscope-builder模块,界面skills list加载失败报错

To Reproduce
Steps to reproduce the behavior:

  1. 本地运行agentscope-builder模块代码
  2. http://localhost:8081/agents/default/skills 界面
  3. 界面报错:Failed to list workspace skills (500)

Expected behavior
正常展示skills列表

Error messages
页面:

Image

控制台报错:
ava.lang.SecurityException: Absolute path /skills is not within an allowed root. Filesystem root: /Users/xululu/.agentscope/builder/workspace; additional roots: [/Users/xululu/Documents/code/github-ai/agentscope-java, /Users/xululu/.agentscope/builder/workspace]
at io.agentscope.harness.agent.filesystem.local.LocalFilesystem.resolveRooted(LocalFilesystem.java:640)
Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below:
Error has been observed at the following site(s):
*__checkpoint ⇢ Handler io.agentscope.builder.web.api.AgentSkillsController#listWorkspaceSkills(String, Authentication) [DispatcherHandler]
*__checkpoint ⇢ AuthorizationWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ExceptionTranslationWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ LogoutWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ServerRequestCacheWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ JwtAuthFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ReactorContextWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ CorsWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ HttpHeaderWriterWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy@10357889
*__checkpoint ⇢ HTTP GET "/api/agents/default/skills/workspace" [ExceptionHandlingWebHandler]
Original Stack Trace:
at io.agentscope.harness.agent.filesystem.local.LocalFilesystem.resolveRooted(LocalFilesystem.java:640)
at io.agentscope.harness.agent.filesystem.local.LocalFilesystem.resolvePath(LocalFilesystem.java:598)
at io.agentscope.harness.agent.filesystem.local.LocalFilesystem.ls(LocalFilesystem.java:239)
at io.agentscope.harness.agent.filesystem.OverlayFilesystem.ls(OverlayFilesystem.java:140)
at io.agentscope.harness.agent.filesystem.BakedContextFilesystem.ls(BakedContextFilesystem.java:53)
at io.agentscope.builder.web.api.AgentSkillsController.lambda$listWorkspaceSkills$0(AgentSkillsController.java:137)
at reactor.core.publisher.MonoCallable$MonoCallableSubscription.request(MonoCallable.java:134)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:172)
at reactor.core.publisher.MonoSingle$SingleSubscriber.doOnRequest(MonoSingle.java:104)
at reactor.core.publisher.Operators$MonoInnerProducerBase.request(Operators.java:2925)

Environment (please complete the following information):

  • AgentScope-Java Version: [2.0.0-SNAPSHOT]
  • Java Version: [17]
  • OS: [macos]

Additional context
我使用qoder帮我修复下之后,程序正常,修改内容为
agentscope-java/agentscope-examples/agents/agentscope-builder/src/main/java/io/agentscope/builder/web/config/BuilderConfig.java

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions