CL-6556: dev seeder fails loudly; picker no longer dead-ends on setup-agent race - #268
Merged
Conversation
Reproduces the live bug verbatim (a personal bench with a real membership and 0 rows in workflow_definition) and asserts on the same read findMyraDefinition and the /provisioning-status route depend on (an "assistant" asset with a live deployment) after provisionPersonalTenantIfNeeded runs with a seed model — not just that seedTenant was invoked.
The dev bootstrap's readiness wait for the hub could time out and fall straight into the sign-in/sign-up attempt anyway, and every failure past that point only logged one line and returned — the exact shape that left alice@example.com created but with none of her default agents ever deployed, and nothing on screen to say so. A timed-out wait or a real seeding failure now exits the whole dev bootstrap loudly, matching every other prerequisite check in this script.
…error Clicking a template before this bench's default agents finish deploying threw "No default setup agent found for this workbench." — system vocabulary describing an internal precondition, shown at the exact moment someone first tries to do anything. The picker now checks agent readiness before treating that precondition as a dead end, and shows a retryable "still setting up" message instead of a toast with the raw error. WorkbenchPreconditionError gains a `kind` discriminant so this only applies to the missing-setup-agent case, not a genuinely unavailable template.
stubFailingCreate served an empty definitions list, so every "failed create" test was actually hitting the missing-setup-agent precondition before any create request was sent — CL-6510's retry-panel change correctly stopped that path from toasting, which is what broke this suite. The stub now serves a deployed assistant definition so the flow reaches the real create request and that 500s instead, restoring the suite's actual purpose: proving exactly one toast fires on a genuine create failure. Also pins the new contract directly: a missing setup agent shows the retry panel and fires no toast at all.
TheGreatAxios
force-pushed
the
cl-seed-race-fix
branch
from
August 22, 2026 02:44
65e0796 to
73d8f4b
Compare
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
scripts/dev.ts's account seeding used to poll for hub readiness, then silently proceed even on timeout, and swallow every subsequent failure behind oneconsole.errorline. This is exactly what left the seededalice@example.comaccount created but with none of her default agents ever deployed (0 rows inworkflow_definition), with nothing visible pointing at why. It now fails the whole dev bootstrap loudly on either a readiness timeout or a real seeding failure.provisionPersonalTenantIfNeeded's existing sign-in reconcile path recovers a tenant with zero workflow-definition rows into a liveassistantdeployment — verified via the same readfindMyraDefinitionand the/provisioning-statusroute depend on, not just "seedTenant was called".new-workbench-picker.tsx) threw the raw, system-vocabularyWorkbenchPreconditionErrormessage ("No default setup agent found for this workbench.") straight into a toast the moment a person clicked a template on a bench whose default agents hadn't finished deploying yet.WorkbenchPreconditionErrornow carries akinddiscriminant so the picker can checkfetchAgentReadiness()before treating that specific precondition as a dead end, showing a retryable "Still setting up your workbench" state instead.Root cause
Live data showed tenant
tnt_b780a4d8050c8d679f107642809ab7ab("alice's team") with 0 rows inworkflow_definitionversus 11 for a tenant that completed real onboarding.provisionPersonalTenantIfNeededalready reconciles missingDEFAULT_WORKFLOWSon every sign-in when a hub-owned seed model is configured — the gap is (a) the dev seeder's own race left the account created without ever reaching that reconcile path cleanly, and (b) nothing gated the create-UI on readiness, so the failure mode a person actually saw was a raw internal error rather than an honest wait state.A follow-up ticket (CL-6556) covers the harder product question: in the self-serve shape with no hub-owned seed model, a brand-new tenant genuinely can't have a deployed assistant until the person supplies their own inference credential — this PR makes that wait honest, not instant, since a workflow cannot deploy without a model.
Test plan
bun testinpackages/onboarding(166 tests, includes the new regression test)bun testinapps/webfor the touched files (instant-agent-create.test.ts,new-workbench-picker.test.ts,test/new-workbench-picker.test.tsx)bun run typecheckin bothapps/webandpackages/onboardingbun run check:structuralat the repo rootbunx eslint+bunx prettier --checkon all changed fileshttps://linear.app/abklabs/issue/CL-6556/onboarding-first-sign-in-can-hit-no-default-setup-agent-found-with-no