nexu-io/open-design · error · Error

Editable design system not found

Error message

Editable design system not found

What it means

The revision job reads the existing DESIGN.md body to apply feedback to. If neither input.body nor the stored design system at input.designSystemId yields a body (readExistingDesignSystem returns null), there is nothing to revise and the 'read-draft' step fails.

Source

Thrown at apps/daemon/src/design-systems/generation-jobs.ts:245

      failJob(job, err instanceof Error ? err.message : String(err));
    }
  }

  async function runRevision(job: MutableJob, input: DesignSystemRevisionInput): Promise<void> {
    try {
      const jobRoot = input.root ?? options.root;
      markJob(job, 'running', 'Starting revision');
      const feedback = cleanFeedback(input.feedback);
      if (!feedback) throw new Error('Revision feedback is required');
      let body = input.body;
      let proposedBody = '';
      await runStep(job, 'read-draft', async () => {
        if (!body) {
          body = await readExistingDesignSystem(jobRoot, input.designSystemId, {
            idPrefix: 'user:',
          }) ?? undefined;
        }
        if (!body) throw new Error('Editable design system not found');
        setStepMessage(job, 'read-draft', `Loaded ${input.designSystemId}`);
      });
      await runStep(job, 'apply-feedback', async () => {
        await sleep(delayMs);
        proposedBody = applyRevisionToBody(body ?? '', {
          feedback,
          ...(input.sectionTitle ? { sectionTitle: input.sectionTitle } : {}),
        });
        setStepMessage(job, 'apply-feedback', input.sectionTitle ? `Updated ${input.sectionTitle}` : 'Updated DESIGN.md');
      });
      await runStep(job, 'create-revision', async () => {
        if (!body) throw new Error('Editable design system not found');
        const revision = await createRevision(jobRoot, input.designSystemId, {
          feedback,
          baseBody: body,
          proposedBody,
          ...(input.sectionTitle ? { sectionTitle: input.sectionTitle } : {}),
          jobId: job.id,

View on GitHub (pinned to 5be4028344)

Solutions

  1. Verify the design system ID still exists in the design-systems list.
  2. Re-open the design system from the current list to refresh the ID.
  3. If the source is an import-only snapshot, generate a fresh editable draft instead of revising.
  4. Check the daemon data dir is intact and readable.
Defensive patterns

Strategy: validation

Validate before calling

const existing = await readDesignSystem(root, designSystemId, { idPrefix: 'user:' });
if (!existing) {
  throw new Error(`Design system ${designSystemId} has no editable body; cannot revise.`);
}
await startRevision({ designSystemId, root });

Type guard

async function designSystemHasEditableBody(root: string, id: string): Promise<boolean> {
  const body = await readDesignSystem(root, id, { idPrefix: 'user:' });
  return typeof body === 'string' && body.trim().length > 0;
}

Try / catch

try {
  await startRevision({ designSystemId, root });
} catch (err) {
  if (err instanceof Error && /Editable design system not found/i.test(err.message)) {
    // refresh the design-system list and have the user re-open it
  } else throw err;
}

Prevention

When it happens

Trigger: runRevision called with a designSystemId whose stored DESIGN.md is missing, deleted, or never written, and no input.body override is supplied. readExistingDesignSystem resolves the design system and returns null.

Common situations: Stale designSystemId held by the client after the design system was deleted; imported snapshot without an editable body; daemon data dir moved so the stored file is unreachable; permissions issue reading the file.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/d93c04fcdd5de04c. Report an issue: GitHub.