You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 45f537a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(sandbox): expose Stop/Start RPCs in gateway API + CLI (#3)
The driver-layer stop_sandbox already exists for every compute backend
(podman, docker, kubernetes, vm) and the internal compute_driver.proto
exposes a StopSandbox RPC. But the gateway-facing openshell.proto only
surfaces DeleteSandbox, which destroys the workspace volume alongside
the container. Operators who want to halt a sandbox for resource reasons
have to delete it and lose state.
This patch adds:
- StopSandbox and StartSandbox RPCs to proto/openshell.proto with
matching Request/Response messages.
- Compute-runtime wrappers (stop_sandbox, start_sandbox) that look up
the sandbox by name, forward stop to the driver, and forward start
to the StartupResume hook so the existing Docker resume path is
reused.
- A resume_sandbox method on PodmanComputeDriver mirroring the Docker
implementation, plus a StartupResume impl wired in new_podman so the
Start verb works on podman too.
- gRPC handlers (handle_stop_sandbox, handle_start_sandbox), trait
wires, and matching authz entries (both gated on sandbox:write).
- CLI verbs: openshell sandbox stop [--all] and openshell sandbox start
with completion for sandbox names and the same forward-cleanup
behavior as delete.
Phase is left to the existing watch loop to update as containers
transition; no new SandboxPhase variant is required. Restart-from-
stopped works mid-session via Start and at gateway boot via the
existing resume_persisted_sandboxes sweep.
Tests:
- Podman driver: resume_sandbox returns Ok(false) when container is
missing, is a no-op when already running, and issues POST /start
when stopped.
- Compute wrappers: NotFound for missing sandboxes, Unimplemented when
no StartupResume hook is configured, forwards to the hook with the
correct id/name, surfaces the hook's Ok(false) verdict.
- gRPC handlers: empty-name InvalidArgument and missing-sandbox
NotFound for both Stop and Start.
The seven mock OpenShell impls in integration tests are updated to
satisfy the expanded trait surface.
0 commit comments