Skip to main content
The reviewed Python package is stateset-sandbox 2.7.0, requiring Python 3.10+. It does not share the TypeScript SDK’s version or automatically expose its newest task-team and candidate tunnel controls. Inspect your installed client and deployed controller.

Install and configure

From the reviewed repository:
A published compatible client can instead be installed as stateset-sandbox. Supply the API origin without /api/v1, and keep the API key in the environment:
A client context manager closes HTTP resources; it is not a substitute for explicit sandbox cleanup. Check stop acknowledgement and runtime status separately. API keys use ApiKey authentication through the client; JWT support has its own credential path.

Execution recovery

Save execution IDs before consuming streamed output with the supported on_execution_id callback. A persisted idempotency_key on streaming execution follows the original receipt. Replay with client.executions.events(..., after=saved_event_id); process each event before saving its opaque cursor. A replay reset means replace accumulated output with the retained result snapshot, not append it again. Typed sync/async receipt APIs return terminal failures, cancellation, timeout, or unknown outcomes for inspection; do not infer success merely because a wait returned. A local wait expiry or asyncio cancellation stops waiting and can leave the remote command running. Close abandoned sync/async generators to release their stream connection. Client request timeout configuration uses milliseconds; the execution-receipt wait API uses seconds. Preserve each method’s documented units instead of copying values between them.

Python cells and background workers

CodeInterpreter uses one Python Jupyter kernel per interpreter by default, preserving variables across cells. Calls serialize. stateful=False or non-Python script execution uses a fresh process. When REPL is unavailable, the documented fallback is explicit rather than a claim that state survived. The process API provides start/get/list/logs/stdin/signals and resumable log followers. Keep process ID, stream, continuation offset, rotated/truncated flags, and observed exit separate. Command completion does not establish semantic correctness of a model’s work. The Python client includes durable-workflow helpers for the separate Temporal service and a local multi-agent orchestrator. Neither turns an in-memory caller into a durable workflow or supplies the TypeScript prepared-task filesystem protocol automatically. Source: sdk-python/README.md, pyproject.toml, and execution/client modules, checked October 20, 2026. See execution recovery, TypeScript task support, and Sandbox MCP.
Last modified on October 20, 2026