{"record":{"id":"76739594d320c0e1","repo":"different-ai/openwork","slug":"extensions-add-description-required","errorCode":"extensions.add_description_required","errorMessage":"extensions.add_description_required","messagePattern":"extensions\\.add_description_required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/app/src/react-app/domains/settings/state/extensions-store.ts","lineNumber":2254,"sourceCode":"  }\n\n  async function createLibraryItem(\n    kind: LibraryAuthorableKind,\n    input: CreateLibraryItemInput,\n  ): Promise<string> {\n    const description = input.description.trim();\n    const instructions = input.instructions.trim();\n    const drafts = input.components?.filter((component) => component.name.trim() && component.content.trim()) ?? [];\n    if (!input.name.trim()) {\n      throw new Error(t(\"extensions.add_name_required\"));\n    }\n    if (kind === \"mcp\") {\n      if (!instructions) {\n        throw new Error(t(\"extensions.add_mcp_url_required\"));\n      }\n    } else if (kind !== \"plugin\") {\n      if (!description) {\n        throw new Error(t(\"extensions.add_description_required\"));\n      }\n      if (!instructions) {\n        throw new Error(t(\"extensions.add_instructions_required\"));\n      }\n    }\n    if (kind === \"plugin\" && drafts.length === 0) {\n      throw new Error(t(\"extensions.add_plugin_component_required\"));\n    }\n\n    const settings = readDenSettings();\n    const token = settings.authToken?.trim() ?? \"\";\n    const orgId = settings.activeOrgId?.trim() ?? \"\";\n    if (!token || !orgId) {\n      throw new Error(t(\"extensions.add_sign_in_required\"));\n    }\n    const client = createDenClient({\n      baseUrl: settings.baseUrl,\n      token,","sourceCodeStart":2236,"sourceCodeEnd":2272,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/state/extensions-store.ts#L2236-L2272","documentation":"For library kinds other than 'mcp' and 'plugin' (e.g. skill/command/agent), createLibraryItem requires a description. If input.description trims to empty, the localized message t('extensions.add_description_required') is thrown.","triggerScenarios":"Calling createLibraryItem(kind, input) where kind is neither 'mcp' nor 'plugin' and input.description is empty or whitespace-only.","commonSituations":"Submitting the add-library form's description textarea empty; generating inputs programmatically and omitting description for non-MCP kinds; a form that hides the description field for some kinds but still submits it empty.","solutions":["Fill in input.description before calling for non-MCP, non-plugin kinds.","Validate the description field in the form layer before submit.","If the item really needs no description, supply a minimal placeholder description until the schema allows omission."],"exampleFix":"// before\nawait createLibraryItem('command', { name: 'deploy', description: '', instructions: '...' });\n// after\nconst description = form.description.trim();\nif (!description) { showFieldError('description', t('extensions.add_description_required')); return; }\nawait createLibraryItem('command', { ...form, description });","handlingStrategy":"validation","validationCode":"if (kind !== 'mcp' && kind !== 'plugin' && !input.description.trim()) {\n  showFieldError('description', t('extensions.add_description_required')); return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await createLibraryItem(kind, input);\n} catch (e) {\n  if (e instanceof Error && e.message === t('extensions.add_description_required')) {\n    showFieldError('description', e.message);\n  } else throw e;\n}","preventionTips":["Make description required in the form schema for skill/command/agent kinds","Never render the add dialog with an empty description binding","Trim before submit","Keep field-level errors in sync with the store's i18n keys"],"tags":["validation","i18n","form"],"backgroundTag":"missing-required-argument","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}