Repository navigation
feat: suspend and resume sandboxes, and offer stop and start where they work - #151
Open
Gkrumbach07 wants to merge 1 commit into
Open
Gkrumbach07 wants to merge 1 commit into
Gkrumbach07 wants to merge 1 commit into
Conversation
…ey work
SuspendSandbox and ResumeSandbox have been in the gateway since 0.1.6 and
had no route and no button, and a sandbox suspended from the CLI showed a
grey unknown label with nothing to do but delete it.
BFF: POST .../sandboxes/{name}/suspend and /resume, through the SDK's
suspend and resume sub-client. A resume takes restartIfRestoreFails in an
optional body, as ResumeSandboxRequest.restart_if_restore_fails.
Frontend: the SUSPENDING and SUSPENDED phases, labelled as the CLI colours
them, and Suspend and Resume in the sandbox page's header and a list row's
actions.
Stop and Start follow what gateway 0.1.9 takes, as measured with the Docker
driver on 2026-11-20. Stop is offered from READY, COMPLETED, ERROR,
SUSPENDING and SUSPENDED: a sandbox in ERROR had no way on but a delete, and
a stop, then a start, runs it again. Start is offered from STOPPED only: the
gateway accepts one from COMPLETED too, and with the Docker driver that
start fails and leaves the sandbox in ERROR.
No compute driver upstream ships at 0.1.9 can suspend, so the compat test
asserts the refusal the Docker driver gives, and the page shows it. The
round trip is written for a driver that can and has never run.
Hard fact 1 in .claude/rules/openshell-api.md said there is no suspend. It
now says what 0.1.9 has, what was measured and what was only read.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
This branch has not been deployed
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.
What
SuspendSandboxandResumeSandboxhave been in the gateway since 0.1.6 and the dashboard had no route and no button for them.SUSPENDINGandSUSPENDEDwere missing from the frontend's phase type, so a sandbox suspended from the CLI showed a grey unknown label and could only be deleted.POST /api/v1/workspaces/{workspace}/sandboxes/{name}/suspendand/resume, through the SDK'sSandboxSuspendResume()sub-client. A resume takesrestartIfRestoreFailsin an optional body, asResumeSandboxRequest.restart_if_restore_fails.NewSandboxServicetakes the sub-client as a second argument, which is the one-line change in the other handler tests.openshell sandbox listcolours them;canSuspendSandboxandcanResumeSandbox; Suspend and Resume in the sandbox page's header and in a list row's actions. The mock fixtures get a suspended sandbox (ml-training/long-eval), the only place the phase and Resume can be seen without a gateway that can suspend.backend/test/compat/sandbox_phases_test.go..claude/rules/openshell-api.mdsaid there is no suspend. It now says what 0.1.9 has, what was measured and what was only read.Stop and Start changed too
Read at v0.1.9 (
QuiesceOperation::admit,start_sandbox_with_intentincrates/openshell-server/src/compute/mod.rs), then measured against gateway 0.1.9 by the pinned digest, Docker driver, 2026-11-20:compute driver does not support sandbox suspendstop the sandbox before retrying startSo the dashboard now offers:
For the reviewer to decide
Docker supervisor exited before becoming ready, about 100 ms after the new supervisor starts), six times out of six. Not from SUSPENDED: not measured, my call. The gateway boots the sandbox afresh and discards its memory state, which beside Resume reads as the same thing. Each is one line infrontend/src/utils/sandboxLifecycle.ts.openshell.compute.suspend-resume. The capability is inGET /gateway, which only a platform admin can read, so the button is offered to everyone and the gateway's refusal is shown.restartIfRestoreFailshas no control in the UI. The BFF and the API client carry it; the UI sends none, as the CLI'ssandbox resumesends false.Tested
make typecheckandmake test: green.make lint: eslint and prettier pass, golangci-lint v2.12.2 (the versionci.ymlruns) reports 0 issues.-count=1, against gateway 0.1.9:TestSandboxSuspendResume,TestSandboxStopAfterMainProcessExitandTestSandboxStopStartpass. The whole suite ran once locally on a heavily loaded machine: everything passed butTestSandboxCreateOptions, whose sandbox did not boot, and which passed on its own afterwards.Not tested
TestSandboxSuspendResumeasserts the Docker driver's refusal, in a workspace of its own. That proves both calls reach the gateway, not that the workspace arrives: the gateway checks the driver before it looks the sandbox up. The round trip is written for a driver that advertises the capability and has never run.Related
main. Whichever of the two merges second updates its entries forSuspendSandbox,ResumeSandboxandResumeSandboxRequest.restart_if_restore_fails.🤖 Generated with Claude Code