Skip to content

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

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

feat: add optional name to createSnapshot and return snapshot names#1277
mishushakov wants to merge 5 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

Medium Risk
SDK surface changes add a new names field to SnapshotInfo and extend snapshot creation signatures, which may require consumer updates (TypeScript typing) and relies on backend support for the new request/response fields.

Overview
Adds support for named snapshots in both JS and Python SDKs by introducing an optional name parameter on createSnapshot/create_snapshot, and wiring it through to the POST /sandboxes/{id}/snapshots request body when provided.

Extends SnapshotInfo to include returned snapshot template names (namespaced + tagged), and propagates this field through snapshot creation responses and snapshot listing paginators; adds integration tests covering named snapshot creation and names being populated. Also includes a patch changeset for e2b and @e2b/python-sdk.

Reviewed by Cursor Bugbot for commit 75843a9. 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 c9a97a0. 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
@mishushakov mishushakov enabled auto-merge (squash) April 24, 2026 13:44
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