fix(sandbox): retry openshell create once on early-fail (bxm)#39
Merged
Conversation
openshell's supervisor can transiently report Error during first-handshake (Provisioning→Error→Provisioning within ~20ms on cold gateway) and exit the create command. The session.ts 2s early-fail guard correctly catches the exit but surfaces it to the user; second attempt typically succeeds once the gateway is warm. Wrap create + early-fail detection in a 2-attempt loop. On first early-fail, best-effort `openshell sandbox delete` the half-created container, sleep 1s, retry. Final failure preserves the exit code in the thrown error message. Discovered 2026-05-25 during interactive Mac podman smoke. Root race is upstream openshell; this is a TS-side mitigation. Closes openlock-bxm
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.
Summary
openshell sandbox createcan exit transiently during the first-handshake race on a cold gateway (Provisioning→Error→Provisioning within ~20ms). The session.ts 2s early-fail guard surfaces that exit to the user; a second attempt usually succeeds once the gateway is warm.openshell sandbox deletethe half-created container, sleep 1s, retry. Final failure preserves the exit code.Closes bd
openlock-bxm. Root race is upstream openshell; TS-side mitigation only.Test plan
bun run lintcleanbun run typecheckcleanbun test src/sandbox/session.test.ts— 12/12 passbun test— 589 pass / 1 pre-existing fail / 1 pre-existing error (z3 submodule), parity with mainbun src/cli.ts sandboxin fresh tmp repo; first attempt previously triggered the race, with this change should retry and succeed silently