Conversation
🦋 Changeset detectedLatest commit: 3fd6132 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 784691b. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.12.2-feat-snapshots.0.tgzCLI ( npm install ./e2b-cli-2.7.2-feat-snapshots.0.tgzPython SDK ( pip install ./e2b-2.13.3+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".
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.
ValentaTomas
left a comment
There was a problem hiding this comment.
Left a note in one of the bot notes, but otherwise lgtm.
mishushakov
left a comment
There was a problem hiding this comment.
I'd like to ask to remove the AsyncIterableIterator from JS version. Use res.response.status for checking the status code (not res.error). Throw API Error/Pagination Error, instead of Sandbox error. In tests things like filename/contents and env vars should be accessed via env variables to avoid duplication.
packages/python-sdk/tests/async/sandbox_async/test_snapshot_api.py
Outdated
Show resolved
Hide resolved
- Extract BasePaginator class in JS and PaginatorBase in Python to deduplicate pagination logic between sandbox and snapshot - Remove SnapshotOpts in favor of SandboxApiOpts - Add instance-level list_snapshots method to Python SDKs - Remove async iterator from JS paginators - Simplify error handling in createSnapshot/deleteSnapshot - Add "sandbox will be paused" note to snapshot docs - Clean up snapshot tests to use variables for paths
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
Introduces new API surface and refactors pagination used by existing list calls, so regressions could affect listing behavior and snapshot lifecycle operations despite being additive overall.
Overview
Adds persistent sandbox snapshots to both SDKs: create a snapshot from a sandbox, list snapshots (optionally filtered by source sandbox), and delete snapshots (implemented via template deletion).
Updates the OpenAPI spec and generated clients to include
/sandboxes/{sandboxID}/snapshotsand/snapshots, introduces/v2/sandboxes/{sandboxID}/logswhile deprecating the old logs route, and extends sandbox schemas withautoResumeandvolumeMountsplus newTemplateTagand volume-related schemas/endpoints. JS pagination was refactored to a sharedBasePaginator, and new integration tests cover snapshot flows in JS and Python (sync/async).Written by Cursor Bugbot for commit 3fd6132. This will update automatically on new commits. Configure here.