feat: add OpenSandbox sandbox provider - #2655
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
c127cf2 to
df5b985
Compare
df5b985 to
92ef949
Compare
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR introduces a new OpenSandbox sandbox provider for the AgentScope Java SDK, enabling users to create and manage sandboxes through OpenSandbox Cloud's REST API. The implementation is well-structured with comprehensive test coverage, clean separation of concerns, and good documentation. The provider supports core sandbox lifecycle operations (create, start, stop, delete) and file operations, with proper error handling and timeout management.
Key strengths:
- Complete implementation following existing provider patterns (similar to E2B, Daytona)
- Comprehensive unit and integration tests with realistic mock scenarios
- Clean separation between API client, provider, state, and filesystem classes
- Good Javadoc documentation with usage examples
Areas for improvement:
- The
OpenSandboxApiExceptionclass is defined but never actually used in the codebase (dead code) - The retry logic in
OpenSandboxApi.createSandbox()has a subtle bug where the retry loop condition is inverted - The integration test
OpenSandboxProviderITmakes real HTTP calls to localhost which will fail in CI environments - The
OpenSandboxSandboxStatedoesn't implementgetWorkspaceRoot()which is needed by the harness runtime
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
|
有人审核下这个PR吗,想用这个功能 |
可以本地打包帮试用下有无问题,暂时抽不出人力来审 |
覆盖空沙箱标识、幂等关闭、临时归档清理、挂载排除、参数校验及官方 SDK 空输出等边界场景。
|
Addressed the review by checking each item against the current implementation and updating the branch to the latest upstream
I also added coverage for lifecycle, configuration, archive, and SDK edge cases. The previous Ubuntu CI failure was in Local verification after the update:
|
AgentScope-Java Version
2.0.3-SNAPSHOT
Description
Add OpenSandbox as a standalone Harness sandbox extension.
WorkspaceSpeccontract and expose it throughOpenSandbox#getWorkspaceRoot().OPEN_SANDBOX_ENDPOINTandOPEN_SANDBOX_API_KEYare configured.The branch has been synchronized with the current upstream
main. Additional regression coverage exercises blank sandbox IDs, lifecycle idempotency and failure composition, bind-mount archive exclusions, temporary archive cleanup, option validation, SDK output normalization, and lazy official-client construction.Testing
mvn -B -T1 -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-opensandbox -am verify -DskipTests: 6/6 reactor modules successful, including Spotless, compilation, Javadoc, and packaging.Checklist
mvn spotless:check