feat(sdk): filesystem-only auto-pause via lifecycle.keepMemory#1471
feat(sdk): filesystem-only auto-pause via lifecycle.keepMemory#1471bchalios wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 09c9826 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
PR SummaryMedium Risk Overview The create API field Tests cover payload serialization, validation errors, and live e2e cold-boot on connect in JS and Python (sync/async). Minor version bumps in the changeset for Reviewed by Cursor Bugbot for commit 09c9826. Bugbot is set up for automated code reviews on this repo. Configure here. |
Package ArtifactsBuilt from 57125b4. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.30.4-feat-auto-pause-filesystem-only.0.tgzCLI ( npm install ./e2b-cli-2.12.2-feat-auto-pause-filesystem-only.0.tgzPython SDK ( pip install ./e2b-2.29.3+feat.auto.pause.filesystem.only-py3-none-any.whl |
Adds a keepMemory option (keep_memory in Python) to the sandbox lifecycle config. When false and onTimeout is pause, a timeout auto-pause takes a filesystem-only snapshot (no memory) instead of a full memory one, so the sandbox cold-boots on resume. Defaults to true. The option maps to the autoPauseMemory create field. Combining it with auto-resume is rejected client-side, since a filesystem-only snapshot can only be resumed explicitly. Applies the change to JS and both sync and async Python, with payload, validation, and end-to-end tests, plus a changeset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Babis Chalios <babis.chalios@e2b.dev>
814e9f7 to
09c9826
Compare
|
Addressed the two actionable points from the Cursor summary (pushed):
The third point (live cold-boot e2e depends on the backend JS typecheck/lint and Python ruff all pass. |
Filesystem-only auto-pause (
lifecycle.keepMemory)Adds a
keepMemoryoption (keep_memoryin Python) to the sandbox lifecycle config. WhenfalseandonTimeoutispause, a timeout auto-pause takes a filesystem-only snapshot (no memory) instead of a full memory one, so the sandbox cold-boots (reboots) from disk on resume — losing running processes and open connections. Defaults totrue(full memory snapshot), so existing callers are unaffected.It's the create-time / auto-pause counterpart to the explicit
pause(keepMemory=false)added in #1465: samekeepMemorynaming, mapped onto the newautoPauseMemorycreate field.Behavior & validation
onTimeout/on_timeoutispause; rejected client-side otherwise.keepMemory: falsewithautoResumeis rejected client-side.Usage
Changes
spec/openapi.yml:autoPauseMemoryon the create body (+ regenerated JS/Python clients).SandboxLifecycle.keepMemoryand PythonSandboxLifecycle.keep_memory, wired throughcreateSandbox/_create_sandbox(sync + async) toautoPauseMemory, with the two client-side guards.e2b+@e2b/python-sdk, minor).This branch is stacked on top of #1465 (
feat/pause-filesystem-only); its base is that branch, so the diff here is only the auto-pause commit. #1465 must merge first. There is no conflict between the two — this branch was rebased cleanly on top of #1465 (both touchspec/openapi.yml, the generated clients, and changesets, but in non-overlapping regions, and stacking incorporates #1465's changes first). Once #1465 merges, GitHub auto-retargets this PR's base tomain.Backend dependency
The live e2e tests exercise the real auto-pause→cold-boot path and require the infra-side
autoPauseMemorysupport (e2b-dev/infra#3055) to be merged and deployed; until then they'll be red in CI. The offline payload/validation tests pass independently.🤖 Generated with Claude Code