different-ai/openwork · warning

t("providers.custom_providers_disabled")

Error message

t("providers.custom_providers_disabled")

What it means

openProviderAuthModal throws the localized 'providers.custom_providers_disabled' message when isProviderAddRestricted(...) is true, i.e. a desktop policy restricts adding the requested provider. Before throwing, it resets the auth modal state and stores the message in providerAuthError so the UI can display why the modal did not open.

Source

Thrown at apps/app/src/react-app/domains/connections/provider-auth/store.ts:2219

      checkRestriction: options.checkDesktopAppRestriction,
    });
  }

  async function openProviderAuthModal(optionsArg?: {
    returnFocusTarget?: ProviderReturnFocusTarget;
    preferredProviderId?: string;
  }) {
    if (isProviderAddRestricted(optionsArg?.preferredProviderId)) {
      const message = t("providers.custom_providers_disabled");
      mutateState((current) => ({
        ...current,
        providerAuthReturnFocusTarget: "none",
        providerAuthPreferredProviderId: null,
        providerAuthBusy: false,
        providerAuthModalOpen: false,
        providerAuthError: message,
      }));
      throw new Error(message);
    }

    mutateState((current) => ({
      ...current,
      providerAuthReturnFocusTarget: optionsArg?.returnFocusTarget ?? "none",
      providerAuthPreferredProviderId: optionsArg?.preferredProviderId?.trim() || null,
      providerAuthBusy: true,
      providerAuthError: null,
    }));

    try {
      const methods = await loadProviderAuthMethods(getProviderAuthWorkerType());
      mutateState((current) => ({
        ...current,
        providerAuthMethods: methods,
        providerAuthModalOpen: true,
      }));
    } catch (error) {

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Ask the org admin to relax the desktop-app provider restriction policy
  2. Open the modal with a provider id that is not restricted (preferredProviderId of an allowed provider)
  3. Handle the thrown error / providerAuthError in the UI and show an 'admin disabled custom providers' notice
  4. Verify checkDesktopAppRestriction wiring is not over-restricting (false-positive policy match)

Example fix

// before
await openProviderAuthModal({ preferredProviderId: "my-custom-provider" });
// after
if (isProviderAddRestrictedByDesktopPolicy({ providerId: "my-custom-provider", checkRestriction })) {
  showError(t("providers.custom_providers_disabled"));
} else {
  await openProviderAuthModal({ preferredProviderId: "my-custom-provider" });
}
Defensive patterns

Strategy: validation

Validate before calling

if (isProviderAddRestrictedByDesktopPolicy({ providerId, checkRestriction: checkDesktopAppRestriction })) {
  showToast(t("providers.custom_providers_disabled"));
  return;
}

Type guard

function canAddProvider(id: string | undefined): boolean {
  return !isProviderAddRestrictedByDesktopPolicy({ providerId: id, checkRestriction });
}

Try / catch

try {
  await openProviderAuthModal({ preferredProviderId: id });
} catch (err) {
  if (err.message === t("providers.custom_providers_disabled")) {
    showPolicyBlockedNotice();
  } else throw err;
}

Prevention

When it happens

Trigger: Calling openProviderAuthModal (optionally with preferredProviderId) when options.checkDesktopAppRestriction reports the provider as restricted by desktop policy — org-managed devices can forbid adding custom providers.

Common situations: Users on org-managed desktops trying to add an arbitrary/custom model provider; a policy pushed by OpenWork Den that blocks custom provider additions; testing the modal with a provider id covered by the restriction list.

Related errors


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