[Bug]: Sandbox modal close is coupled to session open and can appear frozen
User report
A user reported sandbox setup looked frozen even after the worker was created.
Validation / research
The modal close happens only after optional onReady completes:
packages/app/src/app/context/workspace.ts:1661runsinput.onReady().- Modal close/clear happens later at
packages/app/src/app/context/workspace.ts:1671.
In the current wiring, onReady is createSessionAndOpen():
packages/app/src/app/app.tsx:6180passesonReady: async () => { await createSessionAndOpen(); }.
So if session-open hangs/fails after worker connection succeeds, the create-worker modal stays up and looks like provisioning is still blocked.
Expected behavior
Worker provisioning completion should not be held hostage by downstream session-open latency.
Suggested fix direction
- Decouple modal lifecycle from
onReady/session opening. - Mark sandbox creation done once worker connect succeeds.
- If session opening fails, surface a secondary non-blocking error/retry path.
Acceptance criteria
- With a successful worker connect and failed/stalled session-open, modal does not remain in creating state.
- User sees worker as connected and can retry opening a session independently.
- No regression for happy path where session opens immediately.
This looks fixed on current dev.
I traced the regression to 70795eba (fix(sandbox): stabilize worker creation flow and add debug cleanup tools), where createSandboxFlow waited for an onReady() callback and kept the flow in an "Opening session" phase before finishing the modal lifecycle.
That coupling was removed in a2f5d1df / PR #841 (fix(app): keep app and worker opens on new session screen). On current dev:
apps/app/src/app/app.tsxcallsworkspaceStore.createSandboxFlow(preset, folder)directly, without passing a session-open callback.apps/app/src/app/context/workspace.tsnow completes the sandbox flow as soon as the remote worker connection succeeds, marks the connect step done, and clears the create flow.- The remote workspace modal closes independently of downstream session opening.
So the right resolution here is to close this as fixed by #841. If someone can still reproduce it on an older shipped build, we should reopen or backport that fix to the affected release branch.