bug: sandbox create leaves stale resource on ImagePullFailed, blocking retry
Open
@krishicks is already working on this.
Since Aug 13, 2026.
state:needs-info
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Agent Diagnostic
- Skills loaded: create-github-issue, openshell-cli
- OpenShell version tested: 0.0.101
- Latest release checked: unable to verify
- Known fixes reviewed: unable to verify
- Possible duplicates reviewed: searched "sandbox create failed cleanup stale", no results
- Findings: When
sandbox createfails during provisioning (e.g., ImagePullFailed), the sandbox resource persists in error state. A retry with the same name fails with "sandbox already exists". The user must manuallysandbox deletebefore retrying. - Remaining reason for filing: Failed provisioning should not leave behind stale resources that block retries.
Description
Actual behavior: When sandbox create fails (e.g., due to image pull failure), the sandbox resource remains:
$ openshell sandbox create --name my-sandbox --from some-image:latest --no-tty -- echo ready
Error: × sandbox entered error phase while provisioning: ImagePullFailed: ...
$ openshell sandbox create --name my-sandbox --from some-image:latest --no-tty -- echo ready
Error: × sandbox 'my-sandbox' already exists
hint: delete it first with: openshell sandbox delete <name>
Expected behavior: Either:
- Auto-cleanup: if provisioning fails, the gateway should remove the sandbox resource so the name is available for retry, or
- Offer
--replaceor--forceflag that deletes an existing failed sandbox before creating, or - At minimum, detect that the existing sandbox is in error state and offer to replace it instead of just saying "already exists"
Reproduction Steps
openshell sandbox create --name test --from nonexistent-image:latest --no-tty -- echo ready- Observe the ImagePullFailed error
openshell sandbox create --name test --from valid-image:latest --no-tty -- echo ready- Observe "sandbox 'test' already exists" error
Environment
- OpenShell CLI: 0.0.101
- Gateway: 0.0.102-dev.4
- Compute driver: Docker
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.