different-ai/openwork · warning

extensions.add_sign_in_required

extensions.add_sign_in_required

Error message

extensions.add_sign_in_required

What it means

Publishing a library item to an organization requires Den authentication: readDenSettings() must yield both an authToken and an activeOrgId. If either is missing/blank, createLibraryItem throws the localized t('extensions.add_sign_in_required') before creating the Den client.

Source

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

        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();
    const token = settings.authToken?.trim() ?? "";
    const orgId = settings.activeOrgId?.trim() ?? "";
    if (!token || !orgId) {
      throw new Error(t("extensions.add_sign_in_required"));
    }
    const client = createDenClient({
      baseUrl: settings.baseUrl,
      token,
    });
    const body = denLibraryPluginCreateRequest(kind, {
      ...input,
      components: kind === "plugin" ? drafts : input.components,
    });
    try {
      await client.setActiveOrganization({ organizationId: orgId });
      const pluginId = await client.createOrgPlugin(orgId, body);
      await waitForListedLibraryPlugin(
        () => client.listMeLibraryPlugins(orgId),
        pluginId,
      );
      clearCloudInventoryCache();
      return pluginId;

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Sign in to Den (Account → Sign in) so settings.authToken is populated, then retry.
  2. Select an active organization in settings so activeOrgId is set.
  3. Persist/refresh Den settings before opening the publish flow; gate the submit button on token && orgId being present.
  4. Handle 401 follow-ups separately — this specific error means credentials were absent, not rejected.

Example fix

// before
await createLibraryItem('skill', input); // throws when signed out
// after
const settings = readDenSettings();
if (!settings.authToken?.trim() || !settings.activeOrgId?.trim()) {
  openSignInDialog();
  return;
}
await createLibraryItem('skill', input);
Defensive patterns

Strategy: validation

Validate before calling

const settings = readDenSettings();
if (!settings.authToken?.trim() || !settings.activeOrgId?.trim()) {
  openSignInDialog(); return;
}

Type guard

function isDenAuthenticated(s: { authToken?: string | null; activeOrgId?: string | null }): boolean {
  return !!s.authToken?.trim() && !!s.activeOrgId?.trim();
}

Try / catch

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

Prevention

When it happens

Trigger: Calling createLibraryItem after all field validations pass while the user is signed out of Den, or signed in but with no active organization selected (settings.authToken or settings.activeOrgId empty).

Common situations: Token expired and cleared from settings but the UI still allows the add dialog; fresh install where the user never signed into Den; org selection lost after settings reset or workspace switch.

Related errors


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