different-ai/openwork · error

t("providers.no_providers_available")

Error message

t("providers.no_providers_available")

What it means

After loading provider auth methods, startProviderOAuth sorts the provider IDs from the server's response; if the map is empty the store throws providers.no_providers_available. The server is connected (otherwise error 42 fires first), but it reports zero providers that support auth. This signals a server-side configuration issue: no providers are configured/enabled on the connected instance.

Source

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

  };

  async function startProviderAuth(
    providerId?: string,
    methodIndex?: number,
  ): Promise<ProviderOAuthStartResult> {
    setStateField("providerAuthError", null);
    const c = options.client();
    if (!c) {
      throw new Error(t("providers.not_connected"));
    }
    try {
      const cachedMethods = state.providerAuthMethods;
      const authMethods = Object.keys(cachedMethods).length
        ? cachedMethods
        : await loadProviderAuthMethods(getProviderAuthWorkerType());
      const providerIds = Object.keys(authMethods).sort();
      if (!providerIds.length) {
        throw new Error(t("providers.no_providers_available"));
      }

      const resolved = providerId?.trim() ?? "";
      if (!resolved) {
        throw new Error(t("providers.provider_id_required"));
      }
      assertProviderAllowedByDesktopPolicy(resolved);

      const methods = authMethods[resolved];
      if (!methods || !methods.length) {
        throw new Error(`${t("providers.unknown_provider")}: ${resolved}`);
      }

      const oauthIndex =
        methodIndex !== undefined
          ? methodIndex
          : methods.find((method) => method.type === "oauth")?.methodIndex ?? -1;
      if (oauthIndex === -1) {

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Configure at least one provider on the opencode server (provider config or provider auth entries) and retry.
  2. Verify you are connected to the intended server/project — a misrouted connection may point at an unconfigured instance.
  3. Check the workerType ('local' vs 'remote'): providers configured for the other worker type will not appear.
  4. Inspect c.provider.auth() output directly to confirm what the server returns.

Example fix

// before: empty server config
{ "$schema": ".../config.json" }
// after: configure a provider
{ "provider": { "anthropic": { "api": { "type": "anthropic" } } } }
Defensive patterns

Strategy: validation

Validate before calling

const methods = await store.loadProviderAuthMethods(workerType);
if (Object.keys(methods).length === 0) {
  showToast("No providers are configured on this server. Add a provider in opencode config first.");
  return;
}

Type guard

function hasProviders(m: Record<string, unknown>): m is Record<string, unknown[]> & { length: never } {
  return Object.keys(m).length > 0;
}
// use: if (!hasProviders(authMethods)) { ... return; }

Try / catch

try {
  await store.startProviderOAuth(providerId);
} catch (e) {
  if (e instanceof Error && /no providers available/i.test(e.message)) {
    openProviderSetupGuide();
  } else throw e;
}

Prevention

When it happens

Trigger: Calling startProviderOAuth (or loadProviderAuthMethods with an empty cache) on a connected client whose c.provider.auth() returns an empty Record — Object.keys(authMethods).length === 0.

Common situations: Fresh/self-hosted opencode server with no provider configs (no config.json providers, no env API keys); remote worker type with providers configured only locally; server config stripped providers from the auth method list; wrong server/project connected that has no providers set up.

Related errors


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