Conversation
🦋 Changeset detectedLatest commit: 881b310 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 |
8a8e564 to
ac979b8
Compare
0696278 to
01ff8d1
Compare
b2b2db3 to
2ed5cdd
Compare
Package ArtifactsBuilt from b2a92c3. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.12.2-feat-snapshots.0.tgzCLI ( npm install ./e2b-cli-2.7.1-feat-snapshots.0.tgzPython SDK ( pip install ./e2b-2.13.2+feat.snapshots-py3-none-any.whl |
305217c to
f1206f3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1206f378c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
packages/js-sdk/example.mts
Outdated
There was a problem hiding this comment.
Use a default/public template in the JS snapshot example
The example now hardcodes Sandbox.create('dobrac-test-bugs-simple-0'), which is account-specific and will fail for users who do not have that template, so the published example is no longer runnable out of the box. This is a regression from the previous default-template flow and will block users trying to validate snapshot support quickly.
Useful? React with 👍 / 👎.
packages/js-sdk/example.mts
Outdated
There was a problem hiding this comment.
Clean up sandboxes created by the snapshot example
The script creates two sandboxes (sandbox and sandbox2) but never calls kill() on either of them, so running this example leaves live sandboxes behind until TTL expiry. In real accounts this can consume quota/cost and is especially problematic when users repeatedly run the example while debugging.
Useful? React with 👍 / 👎.
packages/js-sdk/example.mts
Outdated
There was a problem hiding this comment.
Hardcoded personal template in example file
Low Severity
The example file uses a hardcoded personal template 'dobrac-test-bugs-simple-0' in Sandbox.create(). The previous version used Sandbox.create() with no arguments (defaulting to the base template). This template name appears only in this file and is clearly team/developer-specific debug code. The example also no longer calls sandbox.kill() on either sandbox, leaking resources when run.
f1206f3 to
046ee8a
Compare
Adds create, list, delete snapshot methods to both Sandbox and AsyncSandbox classes with paginated listing support. Renames JS SDK's sandbox.snapshot() to sandbox.createSnapshot() for consistency. Includes OpenAPI spec updates for snapshots, volumes, auto-resume, and v2 logs endpoint.
Co-authored-by: Cursor <cursoragent@cursor.com> fix: regenerate API clients with snapshots tag and add missing body param - Add 'snapshots' to codegen tag filter in JS SDK and Python SDK - Add required body parameter to createSnapshot API call - Regenerate all API clients from current OpenAPI spec fix: add missing body param to Python SDK create_snapshot calls fix: use unformatted schema.gen.ts output from openapi-typescript These files are in .prettierignore and should not be reformatted.
046ee8a to
ee06cb9
Compare
…ests Timestamp-based unique IDs caused flaky failures when parallel test workers (async/sync variants) generated the same value within the same second/millisecond.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| yield item | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Duplicated paginator boilerplate across JS SDK classes
Low Severity
SnapshotPaginator duplicates ~25 lines from SandboxPaginator — field declarations, constructor wiring (ConnectionConfig, ApiClient, _hasNext, _nextToken, limit), both property getters, and the [Symbol.asyncIterator]() method are identical. The Python SDK similarly introduces SnapshotPaginatorBase as a near-clone of SandboxPaginatorBase. A shared generic base class would eliminate this and ensure any future pagination bug fix applies to both.
Additional Locations (1)
There was a problem hiding this comment.
Seems reasonable, any reason to not do this?
There was a problem hiding this comment.
missed the comment, will do
ValentaTomas
left a comment
There was a problem hiding this comment.
Left a note in one of the bot notes, but otherwise lgtm.


Summary
Adds snapshot functionality to the SDK for creating persistent sandbox state that can be used to spawn new sandboxes.
Usage
JavaScript / TypeScript
Python (sync)
Python (async)
API
JS SDK
sandbox.createSnapshot()- Create snapshot from current sandboxSandbox.createSnapshot(sandboxId)- Create snapshot by sandbox IDSandbox.listSnapshots()- List all snapshots (paginated, async iterable)Sandbox.deleteSnapshot(snapshotId)- Delete a snapshotPython SDK
sandbox.create_snapshot()/Sandbox.create_snapshot(sandbox_id)- Create snapshotSandbox.list_snapshots(sandbox_id=None)- List snapshots (paginated)Sandbox.delete_snapshot(snapshot_id)- Delete a snapshotAsyncSandboxwith the same signaturesNote
Medium Risk
Touches public SDK APIs and regenerates OpenAPI client code; incorrect mapping of new endpoints/schemas or deletion semantics could break existing integrations despite limited security exposure.
Overview
Adds persistent snapshot support across the JS and Python SDKs, including creating snapshots from a sandbox, listing snapshots with pagination (and async iteration in JS), and deleting snapshots.
Updates the OpenAPI spec and generated clients to introduce
/sandboxes/{sandboxID}/snapshotsand/snapshots, deprecate the legacy/sandboxes/{sandboxID}/logsin favor of/v2/sandboxes/{sandboxID}/logs, and add new schema surface (e.g.SnapshotInfo, volume mounts, and sandbox auto-resume config). Includes new snapshot-focused test suites and minor test robustness tweaks (switch to UUIDs; paginator now throwsSandboxException).Written by Cursor Bugbot for commit 881b310. This will update automatically on new commits. Configure here.