Skip to content

feat: add optional name to createSnapshot and return snapshot names#1277

Open
mishushakov wants to merge 4 commits intomainfrom
mishushakov/snapshot-name
Open

feat: add optional name to createSnapshot and return snapshot names#1277
mishushakov wants to merge 4 commits intomainfrom
mishushakov/snapshot-name

Conversation

@mishushakov
Copy link
Copy Markdown
Member

@mishushakov mishushakov commented Apr 20, 2026

Summary

  • Add optional name parameter to createSnapshot / create_snapshot in the JS and Python SDKs so callers can name the resulting snapshot template.
  • Return the names field from the snapshot API on SnapshotInfo (both in createSnapshot responses and in listSnapshots paginator results) so callers can discover the namespaced snapshot names.
  • Includes a changeset (patch for e2b and @e2b/python-sdk).

Test plan

  • pnpm run format, pnpm run lint, pnpm run typecheck all pass locally
  • Integration tests on a sandbox with valid credentials: sandbox.createSnapshot({ name: 'my-snap' }) returns non-empty names

Resolves #1249

…ot names

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 20, 2026

🦋 Changeset detected

Latest commit: 3d934ef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@e2b/python-sdk Patch
e2b Patch

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

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 20, 2026

PR Summary

Low Risk
Small, additive SDK API surface change that only affects snapshot create/list response shapes and request payloads; primary risk is minor backward-compat/typing impact for consumers expecting SnapshotInfo to only contain snapshotId/snapshot_id.

Overview
Adds support in the JS and Python SDKs to optionally name snapshots on creation (new CreateSnapshotOpts / name parameter), sending the name through to the POST /sandboxes/{sandboxID}/snapshots request.

Extends SnapshotInfo to include returned names (namespaced snapshot template names) and plumbs it through both snapshot creation and snapshot listing/paginators, with new integration tests covering named snapshot creation plus a changeset bumping e2b and @e2b/python-sdk as patch releases.

Reviewed by Cursor Bugbot for commit 3d934ef. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

Package Artifacts

Built from e79cad3. Download artifacts from this workflow run.

JS SDK (e2b@2.19.1-mishushakov-snapshot-name.0):

npm install ./e2b-2.19.1-mishushakov-snapshot-name.0.tgz

CLI (@e2b/cli@2.9.1-mishushakov-snapshot-name.0):

npm install ./e2b-cli-2.9.1-mishushakov-snapshot-name.0.tgz

Python SDK (e2b==2.20.0+mishushakov-snapshot-name):

pip install ./e2b-2.20.0+mishushakov.snapshot.name-py3-none-any.whl

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b118044. Configure here.

Comment thread packages/js-sdk/src/sandbox/sandboxApi.ts
Copy link
Copy Markdown

@Crunchyman-ralph Crunchyman-ralph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

mishushakov and others added 2 commits April 22, 2026 11:46
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d934ef6d2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/python-sdk/e2b/sandbox_sync/sandbox_api.py
Comment thread packages/js-sdk/src/sandbox/sandboxApi.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS SDK: createSnapshot does not forward the 'name' parameter to the REST API

2 participants