Repository navigation
Conversation
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>
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.
| // backend integration. In that case OpenBoundary reports RESTORED, or | ||
| // COLD_START_FALLBACK only when the driver explicitly permitted it. The | ||
| // backend enforces this choice; reference handoff is private to the driver | ||
| // and backend and does not require supervisor bootstrap fields. |
There was a problem hiding this comment.
On the ResumeBoundary comment just below ("keeping the restored workload frozen until StartAgent"):
Agent Substrate brings an actor back running when it resumes a memory snapshot. There isn't a way today to restore it and hold it paused until StartAgent.
One way we could meet this is to defer the actual resume until StartAgent arrives, but then a failed restore would only show up at StartAgent, not when ResumeBoundary returns. Would that be acceptable? Or is the real requirement that no untrusted instruction reaches the workload before StartAgent, rather than that the whole workload is frozen?
| allowed; a fresh launch accepts only `FRESH`. A replay that reports a different | ||
| handle or outcome is denied. `BoundBoundary::launch_outcome` reports the | ||
| validated outcome. Attach accepts a snapshot that already lists restored | ||
| processes, and StartAgent proceeds as for a fresh launch. |
There was a problem hiding this comment.
For a RESTORED boundary, what should StartAgent do: start a new agent process, or hand back the restored one? And provider_env / provider_files: the restored processes keep the environment they had at suspend, so if a credential rotated while the sandbox was suspended, is UpdateProviderEnvironment the expected way to deliver it after resume?
| // state handle through its native backend integration, and ensures the old | ||
| // generation is fenced. The gateway | ||
| // never receives the restore reference. | ||
| rpc SuspendSandbox(SuspendSandboxRequest) returns (SuspendSandboxResponse); |
There was a problem hiding this comment.
This covers suspends the gateway asks for. On backends that suspend idle sandboxes themselves, which is the case in #4352, the driver would need a way to report a sandbox as Suspended through WatchSandboxes, and a connection to a suspended sandbox might trigger a resume. Is that planned as a follow-up on this contract? Not needed for this PR.
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