Skip to content

Conversation

@OhYee
Copy link
Member

@OhYee OhYee commented Jan 21, 2026

…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

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

…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>
Copy link
Contributor

Copilot AI left a 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.CUSTOM enum and CustomSandbox class 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_sandbox to stop_sandbox for 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.

Comment on lines 16 to 23
"""Get CDP WebSocket URL for browser automation."""
api = DataAPI(
resource_name="",
resource_type=ResourceType.Template,
namespace="sandboxes",
config=config,
)

Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
"""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.

Copilot uses AI. Check for mistakes.
Sodawyx
Sodawyx previously approved these changes Jan 21, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: OhYee <oyohyee@oyohyee.com>
@OhYee OhYee merged commit 0590ae2 into main Jan 21, 2026
2 checks passed
@OhYee OhYee deleted the feat-custom-sandbox branch January 21, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants