python/sandbox/v0.1.15

opensandbox-group/OpenSandboxpython/sandbox/v0.1.15Jul 24, 2026by ninan-nn

AI Summary

The Python SDK introduces retrying pool acquire policies, sandbox create metrics, and a one-call destroy helper for cleaner resource management.

Key Highlights

  • Retrying pool acquire policies to skip stale idle candidates
  • Sandbox create metrics reporting latency events
  • Attach to isolated sessions for stateless workers

New Features

  • Retrying pool acquire policies
  • Sandbox create metrics
  • Client IP header detection
  • Attach to isolated sessions
  • UID mode availability probing
  • Exact snapshot name filtering
  • One-call destroy helper

Full Release Notes

## What's New

### ✨ Features

- **Retrying pool acquire policies** — Python sandbox pools now support `RETRY_NEXT_IDLE` and `RETRY_NEXT_IDLE_THEN_CREATE`, allowing `acquire` to skip stale idle candidates before failing or falling back to direct create. Existing policies keep their current behavior; `max_acquire_retries` defaults to 3. #1347
- **Sandbox create metrics** — async and sync `Sandbox.create` now report fire-and-forget `sandbox.create` latency events to the lifecycle server. Reporting never blocks callers and can be disabled with `OPENSANDBOX_DISABLE_METRICS=1`. #1307
- **Client IP header** — the SDK now best-effort detects the host intranet IPv4 and sends it as `OPEN-SANDBOX-CLIENT-IP` on outbound requests. Detection is cached and never overwrites a user-provided header. #1326
- **Attach to isolated sessions** — `sandbox.isolation.attach(session_id)` lets stateless workers rebuild a handle for an existing execd isolated session while that in-memory session is still alive. #1295
- **UID mode availability** — isolated session responses now expose per-mode `setpriv` / `userns` availability, and unavailable requested modes fail with `503 NOT_SUPPORTED`. #1320
- **Exact snapshot name filtering** — snapshot listing now supports an exact `name` filter. #1301
- **One-call destroy helper** — `Sandbox.destroy()` and `SandboxSync.destroy()` now perform remote termination plus local cleanup, preserving the original termination exception if `kill()` fails. #1291

### 📦 Misc

- Bumped Python sandbox SDK version, default User-Agent strings, and generated lifecycle client comments for this release. #1384

### 👥 Contributors

- @FAUST-BENCHOU
- @Pangjiping
- @jianpingpei
- @ninan-nn
- @ruirui6946