Repository navigation
feat(sandbox): add suspend and resume lifecycle - #4765
Conversation
486f5a5 to
0f8fd35
Compare
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. rust-sdk — No explicit risk acceptance foundThe SDK-exposed generated OpenShell server trait now requires suspend_sandbox and resume_sandbox, while the ComputeDriver trait now requires suspend_sandbox.
2. rust-sdk — No explicit risk acceptance foundraw::proto::compute::v1::StartSandboxRequest gains the public resume and restart_if_restore_fails fields beyond its baseline six-field shape.
3. rust-sdk — No explicit risk acceptance foundThe exhaustive raw ProtoSandboxPhase enum gains Suspending and Suspended variants beyond the baseline lifecycle variants.
4. go-sdk — No explicit risk acceptance foundClientInterface now requires SandboxSuspendResume(), and generated OpenShellClient now requires SuspendSandbox and ResumeSandbox.
5. typescript-sdk — No explicit risk acceptance foundSandboxPhaseName expands from its baseline closed union to include 'suspending' and 'suspended'.
Review details
Advisory review; publication gates are unchanged. |
mayawang
left a comment
There was a problem hiding this comment.
Thanks Drew, this reads well, and it maps cleanly onto how Agent Substrate suspends and resumes: SuspendBoundary to suspending the actor, the actor's snapshot as the restore reference, and ResumeBoundary to resuming it, possibly on another node.
A few questions inline. I'd like to settle the first one before merge, since it's about what the contract guarantees and is easier to get right now than to change later; it may only need a wording tweak. The other two are fine as follow-ups.
TaylorMutch
left a comment
There was a problem hiding this comment.
Two lifecycle issues need addressing: suspension requests are broadcast across hosted sandbox instances, and compensation after a successful resume can discard retained state while restoring a Suspended record. Details are inline.
Validation: reproduced SIGUSR1 delivery across two separate instance runtimes; focused Go lifecycle tests and both Python suspend/resume tests passed. The resume compensation finding is based on tracing the code and existing start-compensation failure tests. Full Rust and TypeScript suites were not run.
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
0f8fd35 to
94deba0
Compare
TaylorMutch
left a comment
There was a problem hiding this comment.
Re-reviewed the fixes and the subsequent deferred-restoration clarification. Both previous findings are addressed: hosted suspension requests are scoped per instance, and resume compensation no longer advertises consumed retained state as Suspended. No remaining actionable concerns found.
The hosted isolation/retry regression passed. Gateway compensation tests timed out during compilation, and the dedicated signal test was blocked by local sandbox restrictions on loopback binding. The latest deferred-restoration commit was reviewed by inspection.
Summary
Add explicit sandbox suspend and resume across the gateway, CLI, SDKs, and compute-driver contract. Backends can retain a workload while suspended; resume attaches a new supervisor generation with fresh credentials.
The V8 implementation and manual counter demo are extracted into dependent PR #4858, tracked by #4857.
Related Issue
Closes #4763
Related: #4352
The author has verified repository ADMIN access; the linked issue does not yet have an acceptance label.
Changes
Testing
cargo check --manifest-path examples/isolation-backend-v8/Cargo.toml --locked --all-targets.The native V8 end-to-end evidence and retained-state tests belong to the dependent example PR. This parent defines and tests the shared contracts; it does not enable suspension in the existing example or bundled production drivers.
Checklist