Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .agents/evidence/verify/2026-11-24-bound-provider-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Verification: Explicit Provider binding and runtime preparation

- Date: 2026-11-24
- Change: Explicit Python Provider client on the SDK main baseline a9a572d81847fe99216bf1bb454b91810dacc676
- Result: PARTIAL
- Environment: Python 3.11.15, Linux x86-64 glibc, fixed Node 22.22.2 and OpenSandbox 0.5.1.
Credentials supplied from an existing private environment and excluded from this record.

## What was verified

Three reviewers ran independent adversarial checks of contract and target routing, artifact
integrity and cache behavior, and the standalone Node path. Initial review eliminated dependency
on ambient SDK/CLI configuration. Implementation review identified bounded preparation, empty
handshake features, unsupported create inputs, and independent shutdown requirements. The third
round checked the corrections and independently reproduced colliding process IDs across two
Sandbox handles, cancelling a close waiter, and closing during in-flight initialization.

## Commands run

- `pytest -q -p no:cacheprovider e2e/test_bound_provider.py`: live Express result 1 pass.
A tagged sandbox returned the expected command output and file content. The exact sandbox
was deleted and follow-up get raised the typed NotFound.
- `pytest -q -p no:cacheprovider client-sdk/tests/test_providers/test_bound_client.py client-sdk/tests/test_providers/test_epp.py`:
development run 38 passed. An initial native fixture misused the Provider object as
its sandbox protocol. The test was corrected to use a separate protocol object.
- Stock Node and OpenSandbox published archives were retrieved over HTTPS, verified against
fixed lengths and SHA-256 values, and prepared through the Python API. Independent harness
runs included a rootless mount namespace masking system Node and a blank caller PATH.
Cold, warm, and offline all succeeded. The EPP calls covered create, get, list, connect,
renew, command streaming, files, ports, PTY, delete and absent state against an
OpenSandbox backend test double. Concurrent streams used the same native process ID.
- The latest complete local test and CI status is recorded in the pull request.

## Cleanup

The real Express sandbox was deleted and verified by direct ID. Standalone component runs reaped
all of their subprocesses and removed temporary workspaces. Test sandbox records were empty.
No database, deployment, key, or image was created.

## Not verified

Live OpenSandbox backend verification requires a reachable OpenSandbox server or a supported
container runtime. No such target was configured in the workspace. The component tests exercised
real runtime and plugin bytes with a backend test double. Release of a signed catalog and automatic
native package installation remains outside the implemented lock-driven path.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Decision: Prepare explicitly bound Provider implementations

Status: proposed

## Problem

Python's existing installed Node Provider path uses the user's shared abx engine. It also
resolves several sandbox behaviors from the global Provider registry after creating a handle.
An application that uses a single standalone Provider should be able to bind its own target
and prepare only the executable artifacts needed by that implementation.

## Decision

Use an explicitly supplied, already installed Python Provider when it meets the required feature
set. Otherwise select a standalone EPP entry from an operator-approved release lock. Filter
platform and feature requirements before opening any artifact, prefer the host language, then use
the documented priority. Preflight of the selected implementation terminates on failure. The
approved lock binds opaque compressed bytes to their source, digest, size, and archive member.
The host retrieves public HTTPS archives only during explicit online preparation and reuses
verified private cache blobs offline.

Reuse the EPP transport and its operation contract. Give each bound Sandbox handle its own
transport because EPP/1 process notifications identify a process without its Sandbox ID. Share
only verified artifacts and the account configuration within a client. Each handle receives its
negotiated Provider object for endpoint resolution, refresh and terminal calls. Close tasks own
local cleanup, including cancellation of a caller waiting for close. Remote deletion is explicit.

The dependency-free OpenSandbox plugin is the first standalone Node example. The source
fixture pins the existing published Provider and official Node archives. The built-in Express
route uses an explicit Sandbox key and endpoint without account discovery. The current Node CLI
continues to load compatible installed Node modules through its existing ProviderKit.

## API Design

- `ProviderClient.prepare(ProviderLock, TransportConfig, native=..., required_features=..., cache_dir=..., download=False)`
- `create(SandboxConfig, request_timeout=..., on_created=...)`, `connect`, `list`, `get`,
`set_timeout`, `delete`, `close`, and async context management
- `ProviderLock` fixes a release and its approved standalone implementations. Each
`EppImplementation` declares language, platform, priority, features, entrypoint and artifact,
with an optional `ProviderRuntime` and required target keys.
- Public usage and prerequisites are in [the English guide](../../../../docs/en/guide/provider-runtime.md)
and [the Chinese guide](../../../../docs/zh/guide/provider-runtime.md).

## Alternatives considered

- Bundling the abx executable or interpreters into the SDK would charge direct HTTP callers
for unrelated assets and would retain CLI configuration and subprocess discovery coupling.
- Reusing the ambient catalog index as a trust root would let bytes and the expected hash
change together. Start with an independently approved lock. A signed multi-implementation
publishing workflow is a separate milestone.
- Sharing the EPP process between Sandbox handles can route notifications to the wrong
stream when two backends reuse a bare process ID. Retain per-handle isolation.

## Dependencies

Use the installed Python package dependencies, existing EPP/1 protocol and fixed Node and
OpenSandbox distributions. No interpreter or Provider binary is included in the SDK wheel.
The example host is Linux x86-64 with glibc. Native packages are installed by the application
owner. Additional platforms, native package auto-installation and catalog release automation
require their own published artifacts and acceptance.

## Test Strategy

Review separate native binding, artifact verification and Node operation boundaries. Run an
explicit Express cloud lifecycle with command and file round-trip and confirmed cleanup. Run the
published Node and OpenSandbox artifacts against the exact protocol with system Node masked,
using cold, warm and offline preparation. Exercise same-ID concurrent streams and cancellation
during process startup and shutdown. A live OpenSandbox deployment is a separate acceptance gate
from the protocol backend test.

## Acceptance criteria

1. Required features and explicit target are checked before dispatch. Native use makes no
Provider artifact request. Cross-language launch uses the exact verified interpreter/entry.
2. Normal and cancelled shutdown reaps owned local processes. Closing one handle leaves siblings
usable. After client close, a stale handle cannot reuse HttpClient or the EPP process.
3. Asset mismatch fails closed. Cache readers see a complete verified blob. Offline preparation
never opens the artifact network connection.
4. The supported backend, operation and platform set in the public guides follows real evidence.
Record missing gates distinctly before making release claims.

## Evidence

- [Delivery issue #166](https://github.com/Alibaba-Agent-Sandbox/python-sdk/issues/166)
- [Verification and review results](../../../evidence/verify/2026-11-24-bound-provider-runtime.md)
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Release candidate: matching client/server **0.4.0a7**. / 候选版本:客户

### Added

- Add explicit Python Provider binding and locked standalone EPP runtime preparation with offline cache reuse. / 新增 Python Provider 显式绑定与固定 EPP 运行时准备,支持离线复用缓存。

- Optional managed Agents API Gateway, Worker and Dispatcher with durable Sessions, explicit queue receipts, files/artifacts, safe cancellation and a restart-aware private guest bridge. / 新增可选托管 Agents API Gateway、Worker、Dispatcher,支持持久 Session、显式队列收据、文件与产物、安全取消和可识别重启的私有沙箱桥接。

- Add explicit application command `invoke` arguments, Express network creation and STS SecurityToken handoff. / 新增应用命令 invoke 显式业务参数、极速版创建时网络配置和 STS SecurityToken 传递。
Expand Down
Loading
Loading