feat(sandbox): add Aliyun AgentRun sandbox client#3418
Open
iridescentWen wants to merge 1 commit into
Open
Conversation
Wires agentrun-sdk's CodeInterpreterSandbox into the optional agents.extensions.sandbox namespace alongside the other hosted backends. Credentials live on the session/client instance rather than on the serialized SandboxSessionState so persisted state never carries access keys to disk. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new optional sandbox backend that targets the Alibaba Cloud AgentRun
CodeInterpreterSandbox. The integration follows the same patterns as the existing hosted clients (Vercel/Cloudflare/Blaxel): an optional[aliyun]extra, guarded re-exports underagents.extensions.sandbox, and a single-file example runner.Notable design decisions:
access_key_id,access_key_secret,account_id,api_key) live on theAliyunSandboxSessionandAliyunSandboxClientinstances, never onAliyunSandboxSessionState. Serialized session state therefore never carries secrets to disk; a regression test pins this._resolve_exposed_portraisesExposedPortUnavailableErrorand nomounts.pymodule is added.Test plan
make format,make lint,make typecheck,make tests— aliyun changes produce zero new errors; 50/50tests/extensions/sandbox/test_aliyun.pycases pass.make build-docsbuilds without new warnings.agentrun-sdk==0.0.35installed:uv run python -c "from agents.extensions.sandbox import AliyunSandboxClient, AliyunSandboxClientOptions, AliyunSandboxSession, AliyunSandboxSessionState; print('ok')".examples/sandbox/extensions/aliyun_runner.py --streamis available for end-to-end verification when valid Alibaba Cloud credentials are present.Issue number
N/A
Checks
make lintandmake format