Conversation
🦋 Changeset detectedLatest commit: 7995449 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 |
|
@djeebus no need to review, it's a draft |
019d887 to
e11378c
Compare
Package ArtifactsBuilt from d0b3ca7. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.14.2-mishushakov-volume-crud-sdk.0.tgzCLI ( npm install ./e2b-cli-2.8.2-mishushakov-volume-crud-sdk.0.tgzPython SDK ( pip install ./e2b-2.15.2+mishushakov.volume.crud.sdk-py3-none-any.whl |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ae99f53cf
ℹ️ 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".
4cd8756 to
2632556
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
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.
| if (!(err instanceof NotFoundError)) { | ||
| throw err | ||
| } | ||
| } |
There was a problem hiding this comment.
Volume remove makes redundant API call on every invocation
Medium Severity
The remove method always makes an extra getInfo/get_info API call before every delete operation to determine if the path is a file or directory (to choose between DELETE /file and DELETE /dir). This doubles the number of API requests for every remove operation. For non-existent paths, this results in two failed requests: getInfo returns 404 (caught and swallowed), then DELETE /file also returns 404 (thrown). There's also a TOCTOU race condition: the entry type could change between the getInfo check and the DELETE call, causing the wrong endpoint to be used.
Additional Locations (1)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Volume content API uses wrong paths, missing volumeID
- Updated all volume content API methods (list, makeDir, getInfo, readFile, writeFile, updateMetadata, remove) to use the correct schema paths (/volumecontent/{volumeID}/dir, /volumecontent/{volumeID}/file, /volumecontent/{volumeID}/stat) and include the volumeID path parameter in params.path.
Or push these changes by commenting:
@cursor push 2cfc103f88
Preview (2cfc103f88)
diff --git a/packages/js-sdk/src/volume/index.ts b/packages/js-sdk/src/volume/index.ts
--- a/packages/js-sdk/src/volume/index.ts
+++ b/packages/js-sdk/src/volume/index.ts
@@ -227,8 +227,11 @@
const config = new VolumeConnectionConfig(this, opts)
const client = new VolumeApiClient(config)
- const res = await client.api.GET('/dir', {
+ const res = await client.api.GET('/volumecontent/{volumeID}/dir', {
params: {
+ path: {
+ volumeID: this.volumeId,
+ },
query: {
path,
depth: opts?.depth,
@@ -265,8 +268,11 @@
const config = new VolumeConnectionConfig(this, opts)
const client = new VolumeApiClient(config)
- const res = await client.api.POST('/dir', {
+ const res = await client.api.POST('/volumecontent/{volumeID}/dir', {
params: {
+ path: {
+ volumeID: this.volumeId,
+ },
query: {
path,
uid: opts?.uid,
@@ -308,8 +314,11 @@
const config = new VolumeConnectionConfig(this, opts)
const client = new VolumeApiClient(config)
- const res = await client.api.GET('/stat', {
+ const res = await client.api.GET('/volumecontent/{volumeID}/stat', {
params: {
+ path: {
+ volumeID: this.volumeId,
+ },
query: {
path,
},
@@ -375,8 +384,11 @@
const config = new VolumeConnectionConfig(this, opts)
const client = new VolumeApiClient(config)
- const res = await client.api.PATCH('/file', {
+ const res = await client.api.PATCH('/volumecontent/{volumeID}/file', {
params: {
+ path: {
+ volumeID: this.volumeId,
+ },
query: {
path,
},
@@ -477,8 +489,11 @@
const config = new VolumeConnectionConfig(this, opts)
const client = new VolumeApiClient(config)
- const res = await client.api.GET('/file', {
+ const res = await client.api.GET('/volumecontent/{volumeID}/file', {
params: {
+ path: {
+ volumeID: this.volumeId,
+ },
query: {
path,
},
@@ -535,8 +550,11 @@
const blob = await toBlob(data)
- const res = await client.api.PUT('/file', {
+ const res = await client.api.PUT('/volumecontent/{volumeID}/file', {
params: {
+ path: {
+ volumeID: this.volumeId,
+ },
query: {
path,
uid: opts?.uid,
@@ -595,10 +613,13 @@
}
}
- const endpoint = isDirectory ? '/dir' : '/file'
+ const endpoint = isDirectory ? '/volumecontent/{volumeID}/dir' : '/volumecontent/{volumeID}/file'
const res = await client.api.DELETE(endpoint, {
params: {
+ path: {
+ volumeID: this.volumeId,
+ },
query: {
path,
recursive: isDirectory ? opts?.recursive : undefined,There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.



Summary
Add Volume CRUD operations to both TypeScript and Python SDKs. Volumes are persistent storage that can be mounted to sandboxes. Includes create, list, get_info, and destroy methods. Sandbox creation now supports volumeMounts parameter.
Usage Examples
TypeScript
Python (async)
Python (sync)
Testing
Note
Medium Risk
Introduces new client surface area for volume CRUD and file operations plus wiring volume mounts into sandbox creation, which affects API request shapes and authentication tokens. Risk is moderate due to largely additive changes but touches core SDK entrypoints and generated API models.
Overview
Adds first-class Volumes support to both SDKs: JS exports a new
Volumeclient (CRUD plus directory/file ops via a new volume-content OpenAPI client), and Python exposesVolume/AsyncVolumewith generated volume endpoints and content client.Extends sandbox creation in both JS and Python to accept
volumeMounts/volume_mounts(mount-path → volume name or instance) and propagates mounts into returned sandbox info. Also updates generated API schemas (new/volumesendpoints,VolumeAndToken, log filtering params), bumps tooling/scripts for volume spec generation, and adds comprehensive JS volume tests/fixtures plus a changeset for minor releases.Written by Cursor Bugbot for commit 7995449. This will update automatically on new commits. Configure here.