Skip to content

Python Sandbox SDK v0.1.16

Choose a tag to compare

@ninan-nn ninan-nn released this 26 Aug 08:01
· 10 commits to main since this release
169adf7

What's New

✨ Features

  • Resilient HTTP transport — Async and sync clients now share a configurable retry transport with backoff, jitter, Retry-After handling, per-attempt timeouts, an overall deadline, and retry callbacks. Retries are enabled by default for idempotent requests on HTTP 429, 502, and 503; callers that require the previous fast-fail behavior can use RetryPolicy.disabled(). User-supplied transports remain untouched, and streaming SSE requests bypass replay. #1372
  • Sandbox lifecycle hooksSandbox.create and SandboxSync.create now accept optional preStart and periodic lifecycle hooks, with stable Python models and server-aligned validation. Hook timeout ranges remain server-authoritative. #1588 #1605
  • Background runs in isolated sessions — Isolated sessions can start detached work and poll its status and incremental combined output. Active background runs suspend idle collection; read-only workspaces reject background execution because they cannot persist run logs. #1456
  • Runtime allocation and hardening visibility — Sandbox responses can expose confirmed Pool allocation summaries, while isolated capabilities include execd init mode and hardening-layer state. These fields are additive and remain absent when the server cannot confirm the corresponding state. #1481 #1474
  • Pool capacity back-pressure — Compatible lifecycle servers can now surface exhausted Kubernetes Pool capacity as HTTP 429 with KUBERNETES::POOL_CAPACITY_EXHAUSTED and Retry-After, instead of eventually reporting a generic readiness timeout. Sandbox creation remains non-idempotent and is not automatically replayed on this status. #1581

⚡ Performance

  • Faster sandbox startup — Async sandbox creation, connection, and resume resolve execd and egress endpoints concurrently, reducing the two management API lookups to one parallel wait. Failure propagation and create cleanup semantics remain unchanged. #1531
  • Bounded parallel Pool cleanup — Idle sandbox release uses bounded concurrency while preserving best-effort cleanup and legacy public behavior. The measured 100-sandbox cleanup in the PR dropped from about 8.3 seconds to 0.8 seconds. #1475

🐛 Bug Fixes

  • Standards-compliant SSE parsing — Command and isolated execution streams now use SSE-specific framing, preserving Unicode separators inside JSON strings while remaining compatible with legacy bare-JSON frames. #1444
  • Reliable background command completion — Background command streams stop after execution_complete, preventing false RemoteProtocolError failures when the peer closes before the final HTTP terminator. Foreground streaming behavior is unchanged. #1532
  • Endpoint cache race fix — Completing an older endpoint fetch no longer removes a newer replacement inflight fetch in async or sync clients. #1567
  • More useful API errors — Unstructured 4xx and 5xx response bodies are included in exception messages and remain available as raw response_body bytes. HTTP 429 responses use SandboxRateLimitException and expose parsed retry_after when present. #1496 #1372
  • Cleaner readiness diagnostics — Readiness timeout messages retain timing, connection context, and the last health-check error without suggesting deployment-specific network fixes that may not apply. #1493

📦 Misc

  • Regenerated lifecycle models, bumped the package fallback version to 0.1.16, and aligned async and sync default User-Agent strings with the release. #1622 #1623

👥 Contributors