mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #306] [MERGED] feat(api): support E2B v2 sandbox create and connect #333
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#333
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/306
Author: @LSX-s-Software
Created: 9/20/2026
Status: ✅ Merged
Merged: 9/21/2026
Merged by: @yingdi-shan
Base:
main← Head:api/e2b-v2📝 Commits (1)
08bec99feat(api): support E2B v2 sandbox create and connect📊 Changes
11 files changed (+1470 additions, -85 deletions)
View changed files
📝
scripts/tests/e2e/suites/02_sandbox_lifecycle.sh(+47 -0)📝
services/gateway/internal/schedule_hint.go(+1 -1)📝
services/gateway/internal/schedule_hint_test.go(+22 -18)📝
services/gateway/internal/server.go(+4 -1)📝
services/gateway/internal/server_test.go(+59 -50)📝
src/api/generated/src/apis/sandboxes.rs(+66 -0)📝
src/api/generated/src/models.rs(+447 -0)📝
src/api/generated/src/server/mod.rs(+434 -1)📝
src/api/impls/sandbox.rs(+97 -0)📝
src/api/openapi.yml(+145 -13)📝
src/api/server.rs(+148 -1)📄 Description
What
Support E2B v2 sandbox creation and connection in the node API and gateway. The TypeScript SDK can create a sandbox through
POST /v2/sandboxesand connect throughPOST /v2/sandboxes/{sandboxID}/connect.Why
E2B TypeScript SDK 2.51.0 uses these v2 endpoints. AgentENV previously registered only GET on
/v2/sandboxes, so SDK creation failed with HTTP 405 after template and volume creation succeeded.Related issue
Closes #305
Scope and non-goals
Includes OpenAPI and regenerated server changes, v2 handlers, gateway routing and assignment handling, and regression coverage. The schema also marks legacy create/connect deprecated, adds list-operation metadata, and removes obsolete access-token references. This does not implement E2B filesystem-only pause/resume or change storage formats.
Design and behavior changes
null, which the generatedJson<Option<ConnectSandboxV2>>extractor accepts. Non-empty bodies retain JSON validation and Axum body-size limits. The generator is unchanged.Compatibility and operations
autoPause=truedefault, which differs from E2B's default.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetThe author reports that tests on the final pushed branch passed. Tests were not rerun for PR creation. Recorded implementation validation:
E2E runs used isolated state and runtime dependency directories. The SDK check covers template build, volume persistence, lifecycle operations, and command execution. HTTP tests cover omitted bodies, JSON validation, body-size limits, and unchanged legacy handling.
Skipped checks and reasons: full
make test-unit, separate Rust integration targets, and benchmarks are not claimed by the recorded command list. No documentation files changed; the public contract is documented in OpenAPI.Risks and reviewer notes
Review timeout/security defaults and response mapping in
src/api/impls/sandbox.rs, gateway scheduling/binding changes, and the exact route match insrc/api/server.rs. The compatibility middleware buffers v2 connect bodies within the existing Axum limit; empty bodies have their content headers normalized, while non-empty requests still require a JSON content type. Cluster behavior has Go test coverage; the recorded VM E2E runs used single-node mode.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.