fix(volume): align API with E2B SDK - #263
Merged
Merged
Conversation
LSX-s-Software
force-pushed
the
fix/volume-api
branch
from
September 8, 2026 13:30
48d66c8 to
eaae528
Compare
Contributor
|
🔍 OpenCodeReview found 4 issue(s) in this PR.
|
yingdi-shan
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Align AgentENV's volume API boundary with the E2B OpenAPI contract while retaining AgentENV-specific volume fields.
{ name, path }arrays in requests and responses.Volumemodel from create/get operations because the direct E2B volume-content data plane is not supported.aenvclient's existing path-to-volume map at the HTTP boundary.Why
The official E2B SDK serializes
volumeMountsas an array, while AgentENV previously expected a map, so valid SDK sandbox creation failed with HTTP 422. The volume endpoints and models also differed enough to make the supported SDK control-plane behavior unclear and incomplete.This change makes the supported volume lifecycle usable through the official SDK and documents the remaining data-plane limitation without returning placeholder credentials.
Related issue
Closes #257.
Scope and non-goals
Included:
volumeMountsOpenAPI definitions.Not included:
VolumeAndTokenresponse model.tokenordomainvalues.Design and behavior changes
The public API now accepts and returns volume mounts as
SandboxVolumeMount[]. API handlers convert that representation to the existing internalHashMap<mount_path, volume_reference>and reject duplicate mount paths with HTTP 400. Empty internal mount sets are returned as empty arrays.Volume create, list, get, and delete keep AgentENV's existing size, mode, status, pagination, and image/COW extensions. Create and get return
Volume, notVolumeAndToken, because AgentENV supports mounted access through sandboxes but does not expose E2B's direct content data plane.The TypeScript compatibility suite uses
Volume.create, passes the returnedVolumedirectly toSandbox.create, verifies data after deleting and recreating the sandbox, and cleans up withVolume.destroy.Volume-manager logs now expose create/delete, reservation, backing materialization/publication, and publication-failure stages. Failure-state persistence errors are logged instead of being silently discarded.
Compatibility and operations
volumeMountschanges from a path-to-volume object to an E2B-compatible array. Volume routes/models are aligned with the E2B specification while retaining AgentENV extension fields.aenvclient. Rolling back restores the old wire contract.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Checklist