Skip to content

feat(sandbox): add explicit suspend and resume lifecycle #4763

Open

Description

@drew

User Story

When validating OpenShell sandbox lifecycle, I need to suspend and resume a supported workload without restarting its execution, while preserving gateway authentication and lifecycle boundaries.

Problem Statement

OpenShell needs an explicit gateway lifecycle for retaining a sandbox workload across suspension, restoring it under a new generation, and reporting unsupported driver semantics consistently.

Impact / Why This Matters

Stopping and starting a sandbox discards live workload state. An explicit suspend/resume workflow lets operators pause a supported workload and continue it later.

Proposed Design

Expose sandbox suspend and resume through the gateway, CLI, and SDKs. Drivers advertise support. Suspension makes a sandbox unavailable while its backend retains the workload; resume creates a new runtime generation and restores it. A strict restore failure preserves the ability to retry. Explicit start, stop, and delete discard retained state.

The concrete V8 implementation and manual counter demonstration are tracked separately in #4857, on top of the lifecycle contracts in #4765.

Suggested UX

openshell sandbox suspend my-sandbox
openshell sandbox resume my-sandbox
openshell sandbox stop my-sandbox
openshell sandbox start my-sandbox

Acceptance Criteria

  • Supported sandboxes transition through Suspending and Suspended and resume into a fresh runtime generation.
  • The driver/backend contract supports retained workload progress without replaying initialization.
  • Failed restore launches preserve the ability to retry when retained state remains available.
  • Explicit start, stop, and delete discard retained state.
  • Unsupported compute drivers reject suspend/resume semantics.
  • CLI and SDK clients expose the new lifecycle operations and phases.
  • Lifecycle tests cover successful transitions, failed resume recovery, and exits racing suspension.

Alternatives Considered

Stop/start remains the clean-boot workflow. Backend-specific retained-state implementations are exercised separately from the shared lifecycle contracts.

Context

Related: #4352 discusses suspension initiated by a backend and supervisor reconnect behavior. This issue covers explicit gateway-driven suspend/resume. The dependent V8 example is tracked by #4857.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions