[PR #209] [MERGED] feat(api): sync sandbox APIs with latest E2B specification #253

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

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/209
Author: @LSX-s-Software
Created: 8/24/2026
Status: ✅ Merged
Merged: 8/25/2026
Merged by: @yingdi-shan

Base: main ← Head: feat/sync-e2b


📝 Commits (3)

  • 0f595f0 feat(api): sync with E2B's latest API spec
  • 51fc603 feat(api): support more filters and order direction in sandbox list v2 API
  • fdd40ec chore(deps): bump ammonia to v4.1.4 (#208)

📊 Changes

21 files changed (+835 additions, -197 deletions)

View changed files

➕ .opencodereview/rule.json (+7 -0)
📝 Cargo.lock (+63 -82)
📝 crates/benchmarks/benches/orchestrator_store_benchmark.rs (+1 -2)
📝 services/gateway/internal/cluster_list.go (+83 -16)
➕ services/gateway/internal/cluster_list_test.go (+64 -0)
📝 services/gateway/internal/server_test.go (+110 -2)
📝 src/api/generated/src/apis/sandboxes.rs (+5 -0)
📝 src/api/generated/src/apis/templates.rs (+4 -1)
📝 src/api/generated/src/models.rs (+56 -27)
📝 src/api/generated/src/server/mod.rs (+80 -2)
📝 src/api/impls/admin.rs (+0 -1)
📝 src/api/impls/pagination.rs (+129 -14)
📝 src/api/impls/sandbox.rs (+47 -5)
📝 src/api/impls/snapshots.rs (+9 -3)
📝 src/api/impls/template.rs (+13 -6)
📝 src/api/openapi.yml (+55 -21)
📝 src/orchestrator/service.rs (+5 -2)
📝 src/orchestrator/store/in_memory.rs (+88 -10)
📝 src/orchestrator/store/mod.rs (+10 -0)
📝 src/orchestrator/tests.rs (+2 -3)

...and 1 more files

📄 Description

What

Synchronize AgentENV's sandbox APIs with the latest E2B API specification @ github.com/e2b-dev/infra@7c417f485c and extend the v2 sandbox listing capabilities.

Also bump ammonia to v4.1.4 to mitigate the vulnerability.

Why

Keep API responses and sandbox listing behavior compatible with E2B while supporting the filters and ordering required by the updated contract.

Fixes #208.

Scope and non-goals

  • Add shared pagination headers and x-total-running.
  • Add E2B-compatible 400/409 responses for connect and resume operations.
  • Remove the obsolete cachedBuilds node field.
  • Add sandbox list filters for startedAfter and template.
  • Add ascending/descending ordering by sandbox creation time.
  • Update pagination, orchestrator filtering, in-memory store logic, generated API code, and focused tests.
  • No changes to storage formats, configuration, or host/runtime requirements.

Design and behavior changes

  • GET /v2/sandboxes now supports:
    • order=asc|desc, defaulting to newest-first ordering.
    • startedAfter filtering by sandbox creation time.
    • template filtering by snapshot/template ID or alias.
  • Pagination cursor comparison is now direction-aware while preserving deterministic ID tie-breaking.
  • The orchestrator and metadata store apply the new filters before pagination.
  • Template and sandbox list responses expose the updated pagination headers.
  • Added coverage for ordering and template/time-based filtering.

Compatibility and operations

  • Public API or generated protocol: Updated to match the latest E2B sandbox API contract.
  • Configuration or defaults: N/A.
  • Snapshot manifest, artifact layout, or storage format: N/A.
  • Upgrade and rollback: No migration required.
  • Host requirements, permissions, ports, or dependencies: N/A.

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests
  • Generated clients/server regenerated with the documented API codegen target
  • Benchmarks or performance comparison completed

Risks and reviewer notes

The main compatibility surface is the v2 sandbox listing contract, especially filter semantics, ordering, and cursor pagination across pages.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by focused tests, although the checks were not rerun in this drafting pass.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/209 **Author:** [@LSX-s-Software](https://github.com/LSX-s-Software) **Created:** 8/24/2026 **Status:** ✅ Merged **Merged:** 8/25/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `feat/sync-e2b` --- ### 📝 Commits (3) - [`0f595f0`](https://github.com/kvcache-ai/AgentENV/commit/0f595f080f0692ea5a92799af8ff9c261d22fdda) feat(api): sync with E2B's latest API spec - [`51fc603`](https://github.com/kvcache-ai/AgentENV/commit/51fc603adce2b00673796af0dcec71c8af862f4c) feat(api): support more filters and order direction in sandbox list v2 API - [`fdd40ec`](https://github.com/kvcache-ai/AgentENV/commit/fdd40ec4da85f64709cc19a68bfc243ada3f00d5) chore(deps): bump ammonia to v4.1.4 (#208) ### 📊 Changes **21 files changed** (+835 additions, -197 deletions) <details> <summary>View changed files</summary> ➕ `.opencodereview/rule.json` (+7 -0) 📝 `Cargo.lock` (+63 -82) 📝 `crates/benchmarks/benches/orchestrator_store_benchmark.rs` (+1 -2) 📝 `services/gateway/internal/cluster_list.go` (+83 -16) ➕ `services/gateway/internal/cluster_list_test.go` (+64 -0) 📝 `services/gateway/internal/server_test.go` (+110 -2) 📝 `src/api/generated/src/apis/sandboxes.rs` (+5 -0) 📝 `src/api/generated/src/apis/templates.rs` (+4 -1) 📝 `src/api/generated/src/models.rs` (+56 -27) 📝 `src/api/generated/src/server/mod.rs` (+80 -2) 📝 `src/api/impls/admin.rs` (+0 -1) 📝 `src/api/impls/pagination.rs` (+129 -14) 📝 `src/api/impls/sandbox.rs` (+47 -5) 📝 `src/api/impls/snapshots.rs` (+9 -3) 📝 `src/api/impls/template.rs` (+13 -6) 📝 `src/api/openapi.yml` (+55 -21) 📝 `src/orchestrator/service.rs` (+5 -2) 📝 `src/orchestrator/store/in_memory.rs` (+88 -10) 📝 `src/orchestrator/store/mod.rs` (+10 -0) 📝 `src/orchestrator/tests.rs` (+2 -3) _...and 1 more files_ </details> ### 📄 Description ## What Synchronize AgentENV's sandbox APIs with the latest E2B API specification @ https://github.com/e2b-dev/infra/commit/7c417f485cdc38d710d335f1930c3d597da74601 and extend the v2 sandbox listing capabilities. Also bump ammonia to v4.1.4 to mitigate the vulnerability. ## Why Keep API responses and sandbox listing behavior compatible with E2B while supporting the filters and ordering required by the updated contract. ## Related issue Fixes #208. ## Scope and non-goals - Add shared pagination headers and `x-total-running`. - Add E2B-compatible `400`/`409` responses for connect and resume operations. - Remove the obsolete `cachedBuilds` node field. - Add sandbox list filters for `startedAfter` and `template`. - Add ascending/descending ordering by sandbox creation time. - Update pagination, orchestrator filtering, in-memory store logic, generated API code, and focused tests. - No changes to storage formats, configuration, or host/runtime requirements. ## Design and behavior changes - `GET /v2/sandboxes` now supports: - `order=asc|desc`, defaulting to newest-first ordering. - `startedAfter` filtering by sandbox creation time. - `template` filtering by snapshot/template ID or alias. - Pagination cursor comparison is now direction-aware while preserving deterministic ID tie-breaking. - The orchestrator and metadata store apply the new filters before pagination. - Template and sandbox list responses expose the updated pagination headers. - Added coverage for ordering and template/time-based filtering. ## Compatibility and operations - Public API or generated protocol: Updated to match the latest E2B sandbox API contract. - Configuration or defaults: N/A. - Snapshot manifest, artifact layout, or storage format: N/A. - Upgrade and rollback: No migration required. - Host requirements, permissions, ports, or dependencies: N/A. ## Validation - [x] `make fmt` - [x] `make clippy` - [x] `make test-unit` - [ ] Relevant Rust integration tests - [x] Generated clients/server regenerated with the documented API codegen target - [ ] Benchmarks or performance comparison completed ## Risks and reviewer notes The main compatibility surface is the v2 sandbox listing contract, especially filter semantics, ordering, and cursor pagination across pages. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by focused tests, although the checks were not rerun in this drafting pass. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:21:30 +00:00
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#253
No description provided.