Skip to content

fix(sandbox): retry openshell create once on early-fail (bxm)#39

Merged
vessux merged 1 commit into
mainfrom
fix/session-create-retry-bxm
May 25, 2026
Merged

fix(sandbox): retry openshell create once on early-fail (bxm)#39
vessux merged 1 commit into
mainfrom
fix/session-create-retry-bxm

Conversation

@vessux
Copy link
Copy Markdown
Owner

@vessux vessux commented May 25, 2026

Summary

  • openshell sandbox create can 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.
  • 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.

Closes bd openlock-bxm. Root race is upstream openshell; TS-side mitigation only.

Test plan

  • bun run lint clean
  • bun run typecheck clean
  • bun test src/sandbox/session.test.ts — 12/12 pass
  • Full bun test — 589 pass / 1 pre-existing fail / 1 pre-existing error (z3 submodule), parity with main
  • Mac podman smoke: cold gateway → bun src/cli.ts sandbox in fresh tmp repo; first attempt previously triggered the race, with this change should retry and succeed silently

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
@vessux vessux merged commit 25be484 into main May 25, 2026
5 checks passed
@vessux vessux deleted the fix/session-create-retry-bxm branch May 25, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant