[GH-ISSUE #257] Official E2B SDK cannot mount or access AgentENV volumes #72

Closed
opened 2026-10-29 14:19:10 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @LSX-s-Software on GitHub (Sep 7, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/257

Affected component

API server / proxy

AgentENV version

Host environment

  • OS: Ubuntu 24.04.4 LTS
  • Kernel: Linux 6.8.0-138-generic
  • Architecture: x86_64
  • SDK: official JavaScript SDK e2b@2.38.0

Operation and configuration

AgentENV was running at `http://127.0.0.1:8000`.

The official SDK was configured with the AgentENV URL and managed API key:


import { Sandbox, Volume } from "e2b"

const opts = {
  apiUrl: "http://127.0.0.1:8000",
  apiKey: process.env.AENV_API_KEY,
}

const volume = await Volume.create("e2b-sdk-test", opts)

await Volume.getInfo(volume.volumeId, opts)
await Volume.connect(volume.volumeId, opts)

await Sandbox.create("ubuntu", {
  ...opts,
  volumeMounts: {
    "/mnt/data": volume,
  },
})

Steps to reproduce

  1. Start AgentENV on port 8000.
  2. Install the official JavaScript SDK with npm install e2b@2.38.0.
  3. Create a volume using Volume.create.
  4. Inspect the returned Volume.token and Volume.domain.
  5. Call a volume content operation such as volume.list("/").
  6. Create a sandbox with the volume in volumeMounts.

Expected behavior

The official E2B SDK should be able to use AgentENV's E2B-compatible volume API:

  • Volume.create and Volume.connect should return a usable volume object.
  • Volume content requests should be sent to the AgentENV deployment with valid
    authentication.
  • Sandbox.create should accept the mount representation emitted by the SDK.
  • A valid SDK request should not fail during JSON deserialization.

Actual behavior

Volume control-plane CRUD succeeds, but POST /volumes and
GET /volumes/{volumeID} return AgentENV's Volume model without the token
and domain expected by the SDK's VolumeAndToken model.

The SDK silently constructs:

token: undefined
domain: e2b.app

Consequences:

  • Volume content requests contain no Authorization header.
  • A content request to AgentENV returns 401 Unauthorized.
  • Without an explicit content apiUrl override, the SDK defaults to
    https://api.e2b.app instead of the AgentENV deployment.

Sandbox creation fails because the SDK sends the E2B array representation:

{
  "volumeMounts": [
    {
      "name": "e2b-sdk-test",
      "path": "/mnt/data"
    }
  ]
}

AgentENV expects a path-to-volume map and returns:

422: Failed to deserialize the JSON body into the target type:
volumeMounts: invalid type: sequence, expected a map

Volume.list() also sends GET /volumes without pagination parameters and
does not consume X-Next-Token. AgentENV's paginated endpoint can therefore
silently hide volumes after the first page.

Logs and diagnostics

AuthenticationError: Unauthorized, please check your credentials.

SandboxError: 422: Failed to deserialize the JSON body into the target type:
volumeMounts: invalid type: sequence, expected a map at line 1 column 143

Reproduction frequency

Always

Regression information

  • Last known good: none
  • First known bad: the initial persistent-volume API introduced for #211

Additional context

The current E2B OpenAPI contract defines:

  • volumeMounts as SandboxVolumeMount[]
  • NewVolume with only name
  • Volume with volumeID and name
  • VolumeAndToken with volumeID, name, token, and optional domain
  • An unpaginated GET /volumes

AgentENV-specific internal fields such as size, mode, status, backing layers, and reservation state can remain internal. The API boundary should use the E2B wire representation.

The fix must not return an empty or placeholder token. If the volume-content data plane remains unsupported, token/domain behavior should be explicitly scoped rather than claiming complete SDK compatibility.

Pre-submission checklist

  • I searched existing open and closed issues and did not find a duplicate.
  • I provided a minimal reproduction or explained why one cannot be provided.
  • I removed credentials, tokens, private image references, and other sensitive information.
  • This is not a security vulnerability.
Originally created by @LSX-s-Software on GitHub (Sep 7, 2026). Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/257 ### Affected component API server / proxy ### AgentENV version - Commit: 0d9027e3c4e3acb1539ff12601372b622512bf55 - Local modifications: none ### Host environment - OS: Ubuntu 24.04.4 LTS - Kernel: Linux 6.8.0-138-generic - Architecture: x86_64 - SDK: official JavaScript SDK `e2b@2.38.0` ### Operation and configuration ```shell AgentENV was running at `http://127.0.0.1:8000`. The official SDK was configured with the AgentENV URL and managed API key: import { Sandbox, Volume } from "e2b" const opts = { apiUrl: "http://127.0.0.1:8000", apiKey: process.env.AENV_API_KEY, } const volume = await Volume.create("e2b-sdk-test", opts) await Volume.getInfo(volume.volumeId, opts) await Volume.connect(volume.volumeId, opts) await Sandbox.create("ubuntu", { ...opts, volumeMounts: { "/mnt/data": volume, }, }) ``` ### Steps to reproduce 1. Start AgentENV on port 8000. 2. Install the official JavaScript SDK with `npm install e2b@2.38.0`. 3. Create a volume using `Volume.create`. 4. Inspect the returned `Volume.token` and `Volume.domain`. 5. Call a volume content operation such as `volume.list("/")`. 6. Create a sandbox with the volume in `volumeMounts`. ### Expected behavior The official E2B SDK should be able to use AgentENV's E2B-compatible volume API: - `Volume.create` and `Volume.connect` should return a usable volume object. - Volume content requests should be sent to the AgentENV deployment with valid authentication. - `Sandbox.create` should accept the mount representation emitted by the SDK. - A valid SDK request should not fail during JSON deserialization. ### Actual behavior Volume control-plane CRUD succeeds, but `POST /volumes` and `GET /volumes/{volumeID}` return AgentENV's `Volume` model without the `token` and `domain` expected by the SDK's `VolumeAndToken` model. The SDK silently constructs: ```text token: undefined domain: e2b.app ``` Consequences: - Volume content requests contain no `Authorization` header. - A content request to AgentENV returns `401 Unauthorized`. - Without an explicit content `apiUrl` override, the SDK defaults to `https://api.e2b.app` instead of the AgentENV deployment. Sandbox creation fails because the SDK sends the E2B array representation: ```json { "volumeMounts": [ { "name": "e2b-sdk-test", "path": "/mnt/data" } ] } ``` AgentENV expects a path-to-volume map and returns: ```text 422: Failed to deserialize the JSON body into the target type: volumeMounts: invalid type: sequence, expected a map ``` `Volume.list()` also sends `GET /volumes` without pagination parameters and does not consume `X-Next-Token`. AgentENV's paginated endpoint can therefore silently hide volumes after the first page. ### Logs and diagnostics ```text AuthenticationError: Unauthorized, please check your credentials. SandboxError: 422: Failed to deserialize the JSON body into the target type: volumeMounts: invalid type: sequence, expected a map at line 1 column 143 ``` ### Reproduction frequency Always ### Regression information - Last known good: none - First known bad: the initial persistent-volume API introduced for #211 ### Additional context The current E2B OpenAPI contract defines: - `volumeMounts` as `SandboxVolumeMount[]` - `NewVolume` with only `name` - `Volume` with `volumeID` and `name` - `VolumeAndToken` with `volumeID`, `name`, `token`, and optional `domain` - An unpaginated `GET /volumes` AgentENV-specific internal fields such as size, mode, status, backing layers, and reservation state can remain internal. The API boundary should use the E2B wire representation. The fix must not return an empty or placeholder token. If the volume-content data plane remains unsupported, token/domain behavior should be explicitly scoped rather than claiming complete SDK compatibility. ### Pre-submission checklist - [x] I searched existing open and closed issues and did not find a duplicate. - [x] I provided a minimal reproduction or explained why one cannot be provided. - [x] I removed credentials, tokens, private image references, and other sensitive information. - [x] This is not a security vulnerability.
bsakaguchi 2026-10-29 14:19:10 +00:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#72
No description provided.