Skip to content

Bug: org creation is not recoverable — a failed scaffold leaves a permanently half-provisioned org with no error, no retry, no full repair path #2636

Closed

Description

@yannickmonney

Problem

org.create succeeds first, then the scaffold/init steps run afterwards (afterCreateOrganization hook → scaffoldNewOrganization, initializeDefaultWorkflows). If those post-create steps fail, the org exists in the database but has no config dir at all — no agents, no providers, no governance policies, no branding. Nothing records or surfaces the failure, nothing retries it, and the wizard can't be re-run (the retry 400s as a duplicate, #2635).

The resulting org looks innocently empty: agents page shows "No agents yet — Create your first agent…", chat shows "No agents available. Please publish an agent first." A user (or admin) has no signal that provisioning failed rather than "this org is new".

Current behaviour

Observed live 2026-07-11 (main @ 94ef84e), org created while node actions were down (#2631):

  • Org QA Friction Lab exists and is reachable, $TALE_CONFIG_DIR/<org-slug>/ was never created.
  • Agents/chat/settings all render normal empty states; no banner, no toast, no audit trail visible.
  • Partial manual repair exists but is incomplete and undiscoverable: the per-domain "Update from catalog" action (hidden inside e.g. the Create agent menu as "Update built-in agents", developer-settings only) restored the seeded agents when run. But CatalogSyncDomain covers only agents | integrations | automations | skills — providers, governance, branding, workflows, prompts, token-sources cannot be restored from the UI, so chat stays broken ("No API key configured") even after the visible repair.

Code pointers

  • services/platform/convex/organizations/scaffold.ts — scaffoldNewOrganization (post-create, async; failure leaves no marker)
  • services/platform/convex/auth.ts — afterCreateOrganization hook wiring
  • services/platform/app/components/catalog/use-catalog-sync.tsx — the partial repair (CatalogSyncDomain = 'agents' | 'integrations' | 'automations' | 'skills')
  • services/platform/convex/organizations/builtin_sync.ts — syncDomainFromBuiltin

Proposed change

Make org provisioning observable and recoverable:

  • Record scaffold failure on the org (or retry it automatically with backoff);
  • Surface a "this workspace didn't finish provisioning — Retry" banner to owners/admins while unprovisioned;
  • Extend the repair path (or the retry) to cover every scaffolded domain, including providers and governance, not just the four catalog domains.

Acceptance criteria

  • A failed scaffold is persisted/queryable and visibly surfaced to org owners
  • A one-click retry re-runs the full scaffold idempotently and restores all domains (providers + governance included)
  • A test simulates scaffold failure at org create and drives the recovery to a fully-provisioned org

Related: #2631 (the failure mode that exposed it), #2635 (wizard-side silence).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: highservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions