Close sandbox API parity gaps: network policy, image builds, snapshot get/delete, list pagination - #107
Open
shrisukhani wants to merge 1 commit into
Open
Close sandbox API parity gaps: network policy, image builds, snapshot get/delete, list pagination#107shrisukhani wants to merge 1 commit into
shrisukhani wants to merge 1 commit into
Conversation
…st pagination parity
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
The Node SDK lagged the API (and the Python SDK) on several sandbox surfaces. This closes the gaps found in a full API/SDK parity audit.
Changes
CreateSandboxParams): newallowInternetAccess,allowOut,denyOutfields, serialized on both image and snapshot launches (the API and Python SDK already supported these).sandboxes.updateNetwork(id, patch)(PUT /sandbox/:id/network) plusSandboxHandle.updateNetwork()/clearNetwork();Sandboxnow carriesnetwork: SandboxNetworkPolicyandtimeoutMinutes.createImageBuild,getImageBuild,listImageBuilds,completeImageBuild,cancelImageBuild+SandboxImageBuild*types (status enum matches the server'sFirecrackerImageBuildStatus).getSnapshot(key)/deleteSnapshot(key)(GET/DELETE /snapshots/:key).listImagesnow acceptssource/search/page/limit;listSnapshotsaddssearch/page;volumes.listaddssearch/page/limit; image/snapshot/volume list responses now includetotalCount/page/perPage(replacing the TODO comments) — all matching the server's query schemas.updateNetwork/clearNetwork, and the new list call shapes.Validation
yarn lintyarn buildyarn vitest run tests/sandbox/e2e/{sandbox-contract,list-contract,volumes-contract,process-api,runtime-transport}.test.ts tests/integration— 31 passedLink to Devin session: https://app.devin.ai/sessions/96909fa41fe54593b992ff11bc7b6074
Requested by: @shrisukhani
Note
Medium Risk
Adds new API surface and makes
Sandbox.networkrequired on typed responses; callers must supply network in mocks/tests, but changes are additive SDK wrappers over existing endpoints.Overview
Brings the Node SDK in line with the control API and Python SDK on sandbox management surfaces.
Network policy:
CreateSandboxParamsnow serializesallowInternetAccess,allowOut, anddenyOuton image and snapshot launches.Sandboxincludesnetworkand optionaltimeoutMinutes.SandboxesService.updateNetwork(PUT /sandbox/:id/network) plusSandboxHandle.updateNetwork/clearNetworkupdate cached handle state.Image builds & snapshots: Adds
createImageBuild,getImageBuild,listImageBuilds,completeImageBuild, andcancelImageBuildwith matching types. AddsgetSnapshotanddeleteSnapshotfor individual snapshot keys.Listing:
listImages,listSnapshots, andvolumes.listaccept search/page/limit (andsourcefor images); image, snapshot, and volume list responses now exposetotalCount,page, andperPage. Contract tests cover network serialization, network updates, and list query forwarding.Reviewed by Cursor Bugbot for commit d57a912. Bugbot is set up for automated code reviews on this repo. Configure here.