agentscope-runtime-java icon indicating copy to clipboard operation
agentscope-runtime-java copied to clipboard

fix: support run_ipython_cell and run_shell_command for all sandbox types

Open andyyehx opened this issue 6 months ago • 2 comments

Summary

修复了 generic 工具对沙箱类型的限制,使所有沙箱类型都支持 run_ipython_cell 和 run_shell_command 方法调用。

Changes

  • 移除了 generic 工具(run_ipython_cell、run_shell_command)对特定沙箱实现类型(如 BaseSandbox)的 instanceof 检查
  • 改为通过 Sandbox 接口的 callTool 方法统一调用,使任意沙箱实现均可支持这些工具

andyyehx avatar May 25 '26 08:05 andyyehx

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 25 '26 08:05 CLAassistant

@CLAassistant check

andyyehx avatar May 26 '26 15:05 andyyehx

Good refactor! Removing the BaseSandbox dependency and using Sandbox.callTool() instead makes the tools work with any sandbox implementation. This is a clean dependency inversion — the tools no longer need to know about the concrete sandbox class. The getSandboxClass() change to return Sandbox.class is the right call too.

itxaiohanglover avatar Jun 26 '26 04:06 itxaiohanglover