Repository navigation
Validate sandbox node, allocation and deployment responses strictly in the client - #156
Merged
Merged
Conversation
SandboxAdminClient cast the node list, node detail, allocation list and deployment JSON without checking it. Project each response against Core's serialization (store.RuntimeNode, RuntimeNodeDetail, RuntimeNodeAllocation, RuntimeDeploymentView): an unknown or missing member or a wrong type rejects it with 502 invalid_admin_response, so no unlisted member (such as a reflected E2B key) passes through. A node diagnostic is absent or a code; an unknown code reads as provider_unavailable, as Core documents.
This was referenced Sep 26, 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.
Summary
Adds strict runtime validation for sandbox administration responses in
packages/agents-client. This matches the admin client's other projections.listNodes,retrieveNode,listAllocations, and the deployment read and writes (retrieveDeployment,initializeDeployment,updateDeployment,setMaintenance).invalid_admin_responseif it has an unknown member, is missing a required member, or has a member of the wrong type. Because unknown members are rejected, a reflected E2B key can't pass through. An invalid response to an E2B write becomessandbox_configuration_unconfirmed.diagnosticis omitted when a node is ready. An unknown diagnostic code is read asprovider_unavailable, for forward compatibility.enrollment_idandcore_urlare required.hostandhistory.specificationandspecification_digestmust appear together, ande2bmust appear exactly when the provider is E2B.contracts/agents-api/sandbox-deployment.mdgets a short paragraph describing this validation.Review and verification
094c71f4(Playwright browser cases skipped on the server; Chrome is unavailable there, and the skip is approved).Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.