mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #263] [MERGED] fix(volume): align API with E2B SDK #300
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/263
Author: @LSX-s-Software
Created: 9/8/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/volume-api📝 Commits (3)
8933a7afix(api): fix E2B SDK volume mounts compatibility6e46d56feat(volume): enhance logging for volume operationseaae528refactor(gateway): preserve sandbox fields during list aggregation📊 Changes
18 files changed (+1166 additions, -504 deletions)
View changed files
📝
crates/aenv/src/client/sandboxes.rs(+21 -4)📝
docs/src/concepts/volumes.md(+6 -3)📝
docs/src/integration/e2b.md(+32 -0)📝
scripts/tests/e2e/e2b_ts_sdk_compat.ts(+178 -27)📝
scripts/tests/e2e/suites/09_e2b_compat.sh(+2 -2)📝
scripts/tests/e2e/suites/15_volume.sh(+3 -2)📝
scripts/tests/e2e/suites/16_volume_randomized.sh(+4 -3)📝
services/gateway/internal/cluster_list.go(+45 -26)📝
services/gateway/internal/cluster_list_test.go(+2 -2)📝
services/gateway/internal/server_test.go(+72 -15)📝
src/api/generated/src/apis/volumes.rs(+20 -14)📝
src/api/generated/src/models.rs(+185 -35)📝
src/api/generated/src/server/mod.rs(+185 -136)📝
src/api/impls/sandbox.rs(+73 -9)📝
src/api/impls/volumes.rs(+33 -21)📝
src/api/openapi.yml(+204 -182)📝
src/api/proxy.rs(+5 -12)📝
src/volume.rs(+96 -11)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.