-
Notifications
You must be signed in to change notification settings - Fork 4
feat(sandbox): add custom sandbox support with template type and clie… #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nt methods Add support for custom sandbox templates with new TemplateType.CUSTOM enum, implement CustomSandbox creation and validation, update union types to include CustomSandbox, and modify container configuration model with ACR instance and registry type fields. Also fix release workflow regex pattern and update alibabacloud-agentrun dependency. feat: 添加自定义沙箱支持和模板类型及客户端方法 添加对自定义沙箱模板的支持,新增 TemplateType.CUSTOM 枚举, 实现 CustomSandbox 创建和验证,更新联合类型包含 CustomSandbox, 并修改容器配置模型增加 ACR 实例和注册表类型字段。 同时修复发布工作流正则表达式模式并更新 alibabacloud-agentrun 依赖。 Change-Id: Ieb1e39c1acd49a43f54f22c113704a5046ab0458 Signed-off-by: OhYee <oyohyee@oyohyee.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for custom sandbox templates with a new TemplateType.CUSTOM enum value. It updates the sandbox creation infrastructure to handle custom image-based sandboxes alongside existing code interpreter, browser, and all-in-one sandbox types.
Changes:
- Added
TemplateType.CUSTOMenum andCustomSandboxclass for custom image support - Updated sandbox creation methods with overloads for custom sandbox type
- Enhanced container configuration model with ACR instance and registry type fields
- Fixed method naming from
delete_sandboxtostop_sandboxfor consistency - Corrected mypy Python version configuration and updated dependency version
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updated alibabacloud-agentrun dependency to 5.3.1 and fixed mypy python_version from invalid "0.0.15" to "3.10" |
| agentrun/sandbox/model.py | Added CUSTOM template type enum and new optional fields (acr_instance_id, image_registry_type, port) to TemplateContainerConfiguration |
| agentrun/sandbox/custom_sandbox.py | New CustomSandbox class implementation with get_base_url method |
| agentrun/sandbox/sandbox.py | Added CustomSandbox overloads, updated union types, imports, and changed delete_sandbox to stop_sandbox method calls |
| agentrun/sandbox/__sandbox_async_template.py | Parallel changes to async template for CustomSandbox support and stop_sandbox method naming |
| .github/workflows/release.yml | Fixed sed regex pattern with anchor (^) to ensure version replacement only matches start of line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agentrun/sandbox/custom_sandbox.py
Outdated
| """Get CDP WebSocket URL for browser automation.""" | ||
| api = DataAPI( | ||
| resource_name="", | ||
| resource_type=ResourceType.Template, | ||
| namespace="sandboxes", | ||
| config=config, | ||
| ) | ||
|
|
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get_base_url method implementation appears incomplete. It creates a DataAPI instance with empty resource_name and path, then returns the result of with_path("") which just returns a base URL. This doesn't seem to provide a meaningful URL for CustomSandbox. Consider clarifying the purpose of this method or implementing it properly to return a useful URL for custom sandboxes.
| """Get CDP WebSocket URL for browser automation.""" | |
| api = DataAPI( | |
| resource_name="", | |
| resource_type=ResourceType.Template, | |
| namespace="sandboxes", | |
| config=config, | |
| ) | |
| """Get the base DataAPI URL associated with this custom sandbox.""" | |
| api = DataAPI( | |
| resource_name="custom-sandbox", | |
| resource_type=ResourceType.Template, | |
| namespace="sandboxes", | |
| config=config, | |
| ) | |
| # An empty path returns the base URL for this DataAPI resource. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: OhYee <oyohyee@oyohyee.com>
…nt methods
Add support for custom sandbox templates with new TemplateType.CUSTOM enum, implement CustomSandbox creation and validation, update union types to include CustomSandbox, and modify container configuration model with ACR instance and registry type fields.
Also fix release workflow regex pattern and update alibabacloud-agentrun dependency.
feat: 添加自定义沙箱支持和模板类型及客户端方法
添加对自定义沙箱模板的支持,新增 TemplateType.CUSTOM 枚举,
实现 CustomSandbox 创建和验证,更新联合类型包含 CustomSandbox,
并修改容器配置模型增加 ACR 实例和注册表类型字段。
同时修复发布工作流正则表达式模式并更新 alibabacloud-agentrun 依赖。
Change-Id: Ieb1e39c1acd49a43f54f22c113704a5046ab0458
Fix bugs
Bug detail
Pull request tasks
Update docs
Reason for update
Pull request tasks
Add contributor
Contributed content
Content detail
Others
Reason for update