musistudio/claude-code-router · warning

[plugin:${pluginConfig.id}] Disabled after startup failure:

Error message

[plugin:${pluginConfig.id}] Disabled after startup failure: ${formatError(error)}

What it means

Logged by GatewayPluginService.start after loadConfiguredPlugin throws during startup: the service rolls the plugin back to its pre-load snapshot (rollbackConfiguredPluginLoad) and marks it disabled, but startup continues for other plugins. The plugin will not be active this session.

Source

Thrown at packages/core/src/plugins/service.ts:284

  async start(config: AppConfig): Promise<void> {
    await this.stop({ nextConfig: config });
    this.config = config;
    this.registerBuiltInGatewayRequestTransforms();

    for (const pluginConfig of config.plugins ?? []) {
      if (pluginConfig.enabled === false) {
        continue;
      }
      if (!pluginAvailableInCurrentRuntime(pluginConfig)) {
        continue;
      }
      const snapshot = this.createStateSnapshot();
      this.resourceOwnerIds.add(pluginConfig.id);
      try {
        await this.loadConfiguredPlugin(pluginConfig);
      } catch (error) {
        await this.rollbackConfiguredPluginLoad(pluginConfig.id, snapshot);
        console.warn(`[plugin:${pluginConfig.id}] Disabled after startup failure: ${formatError(error)}`);
      }
    }
  }

  async stop(options: { nextConfig?: AppConfig } = {}): Promise<void> {
    const stopHooks = [...this.stopHooks].reverse();
    const nextEnabledPluginIds = options.nextConfig ? enabledPluginIds(options.nextConfig) : undefined;
    this.stopHooks = [];

    for (const stopHook of stopHooks) {
      try {
        await stopHook.stop({ reason: stopReasonForPlugin(stopHook.pluginId, nextEnabledPluginIds) });
      } catch (error) {
        console.warn(`[plugin] Stop hook failed: ${formatError(error)}`);
      }
    }

    const resourceOwnerIds = [...this.resourceOwnerIds].reverse();

View on GitHub (pinned to 99f24806c6)

Solutions

  1. Check the formatted error for the real cause (module not found, init exception, config validation).
  2. Update or reinstall the plugin package to a version compatible with your core version.
  3. Fix the plugin's configuration (env vars, credentials) before restarting.
  4. Temporarily remove the plugin from config to start clean, then re-add once fixed.

Example fix

// before
"plugins": [{"id":"my-plugin","path":"./plugins/my-plugin"}]
// after (verify install & compatibility first)
"plugins": [{"id":"my-plugin","path":"./plugins/my-plugin","enabled":false}]
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: A configured plugin whose module fails to load (missing dependency, incompatible API version), whose init throws, or whose registration fails validation. The catch runs rollback then warns.

Common situations: Plugin installed for an older gateway API version after upgrading core; plugin package not installed or with broken node_modules; plugin config invalid (bad credentials, missing env vars its init requires).

Related errors


AI-assisted analysis of musistudio/claude-code-router@99f24806c6 (2026-08-27). Data as JSON: /api/errors/935cd3a10a4a1b09. Report an issue: GitHub.