agentscope-runtime-java
agentscope-runtime-java copied to clipboard
fix: support run_ipython_cell and run_shell_command for all sandbox types
Summary
修复了 generic 工具对沙箱类型的限制,使所有沙箱类型都支持 run_ipython_cell 和 run_shell_command 方法调用。
Changes
- 移除了 generic 工具(run_ipython_cell、run_shell_command)对特定沙箱实现类型(如 BaseSandbox)的 instanceof 检查
- 改为通过 Sandbox 接口的 callTool 方法统一调用,使任意沙箱实现均可支持这些工具
@CLAassistant check
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.