Python Sandbox SDK v0.1.16
·
10 commits
to main
since this release
What's New
✨ Features
- Resilient HTTP transport — Async and sync clients now share a configurable retry transport with backoff, jitter,
Retry-Afterhandling, 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 useRetryPolicy.disabled(). User-supplied transports remain untouched, and streaming SSE requests bypass replay. #1372 - Sandbox lifecycle hooks —
Sandbox.createandSandboxSync.createnow accept optionalpreStartand 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_EXHAUSTEDandRetry-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 falseRemoteProtocolErrorfailures 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_bodybytes. HTTP 429 responses useSandboxRateLimitExceptionand expose parsedretry_afterwhen 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