different-ai/openwork · warning

extensions.add_name_required

extensions.add_name_required

Error message

extensions.add_name_required

What it means

createLibraryItem validates the new library item (skill/command/agent/mcp/plugin) before talking to the Den API. A missing name is the first check; the localized validation message t('extensions.add_name_required') is thrown as the Error message so UI code can match on the i18n key string.

Source

Thrown at apps/app/src/react-app/domains/settings/state/extensions-store.ts:2246

      }
      await refreshSkills({ force: true });
    } catch (error) {
      const message = error instanceof Error ? error.message : t("skills.unknown_error");
      options.setError(addOpencodeCacheHint(message));
    } finally {
      options.setBusy(false);
    }
  }

  async function createLibraryItem(
    kind: LibraryAuthorableKind,
    input: CreateLibraryItemInput,
  ): Promise<string> {
    const description = input.description.trim();
    const instructions = input.instructions.trim();
    const drafts = input.components?.filter((component) => component.name.trim() && component.content.trim()) ?? [];
    if (!input.name.trim()) {
      throw new Error(t("extensions.add_name_required"));
    }
    if (kind === "mcp") {
      if (!instructions) {
        throw new Error(t("extensions.add_mcp_url_required"));
      }
    } else if (kind !== "plugin") {
      if (!description) {
        throw new Error(t("extensions.add_description_required"));
      }
      if (!instructions) {
        throw new Error(t("extensions.add_instructions_required"));
      }
    }
    if (kind === "plugin" && drafts.length === 0) {
      throw new Error(t("extensions.add_plugin_component_required"));
    }

    const settings = readDenSettings();

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Set a non-empty name on the input before calling createLibraryItem.
  2. Validate in the form/UI layer (disable submit until name.trim() is non-empty) so the API-layer error never fires.
  3. If the error appears despite a filled field, check for stray whitespace-only input or a binding bug where input.name is undefined at call time.

Example fix

// before
await createLibraryItem('skill', { name: '', description: '...', instructions: '...' });
// after
const name = form.name.trim();
if (!name) { showFieldError('name', t('extensions.add_name_required')); return; }
await createLibraryItem('skill', { ...form, name });
Defensive patterns

Strategy: validation

Validate before calling

const name = input.name.trim();
if (!name) { showFieldError('name', t('extensions.add_name_required')); return; }

Try / catch

try {
  await createLibraryItem(kind, input);
} catch (e) {
  if (e instanceof Error && e.message === t('extensions.add_name_required')) {
    showFieldError('name', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling createLibraryItem(kind, input) with input.name empty or whitespace-only ('', ' ') — the trim() leaves an empty string.

Common situations: Submitting the 'Add to library' form without typing a name; programmatically building CreateLibraryItemInput and forgetting the name field; copying an input object where name was nulled by a form reset.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/ad95ac55af4bfdb7. Report an issue: GitHub.