feat(workers): new-workspace creation modal + async provisioning #86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/new-ws"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the full-page
/newworkspace-creation flow with a centered modal (full-screen sheet on mobile), redesigned from scratch, and moves worker provisioning to an async, server-driven flow whose status shows on the workspace card.NewWorkerModal.svelte): single column with purpose-named drawers — Worker image, Mounts (a reserved, disabled "soon" teaser), Advanced (name override). Opens from the workspaces list; closes on Escape / backdrop / ✕, with focus restored to the trigger.POST /api/workersinserts the row in aqueuedphase and returns201immediately (modal closes), then a backgroundprovisionWorkerpulls the image → creates → starts, advancing aprovision_phase(queued → pulling → creating → starting, terminalerror) that the existing poll renders as coarse text on the card. Boot-timefailStuckProvisioningfails rows orphaned by a restart./newroute,NewWorker.svelte,PullProgress.svelte, the client pull helper, and the pull SSE route (pull now runs server-side insideprovisionWorker).Design + plan:
docs/superpowers/specs/2026-07-21-new-workspace-modal-design.md,docs/superpowers/plans/2026-07-21-new-workspace-modal.md.Correctness fixes from review
A multi-agent review caught (and this branch fixes):
provisionWorkernow detects the removed-mid-flight race (viafinishProvisioning's row count) and on any post-create failure, and tears the container down.container_id, so a worker with no container offers only Remove (those buttons previously threw).ProvisionPhaseis single-sourced inapi/types.tsso server/client can't drift silently.Test plan
pnpm typecheck— clean.pnpm test— 845 passing (migration 0014, provisioning helpers incl. every in-flight phase +finishProvisioningreturn-count,provisionLabel).pulling/creating/starting → runningon a real container; failure path →Failed: <reason>card with only Remove and no orphan container; running card shows the full action row; full-screen mobile sheet; Escape/backdrop/autofocus.Notes
failStuckProvisioningreconciling a container that came up in the narrow crash→finish window (recoverable via Remove today); extracting the sharedslugify.