affaan-m/ECC · error · Error

Unsupported install request mode: ${request.mode}

Error message

Unsupported install request mode: ${request.mode}

What it means

Thrown by createInstallPlanFromRequest() when request.mode is defined but is not one of the three supported values ('manifest', 'legacy-compat', 'legacy'). It is the defensive default branch after all known modes have been checked.

Source

Thrown at scripts/lib/install/runtime.js:51

      projectRoot: options.projectRoot,
      homeDir: options.homeDir,
      claudeRulesDir: options.claudeRulesDir,
      sourceRoot: options.sourceRoot,
    });
  }

  if (request.mode === 'legacy') {
    return createLegacyInstallPlan({
      target: request.target,
      languages: request.languages,
      projectRoot: options.projectRoot,
      homeDir: options.homeDir,
      claudeRulesDir: options.claudeRulesDir,
      sourceRoot: options.sourceRoot,
    });
  }

  throw new Error(`Unsupported install request mode: ${request.mode}`);
}

module.exports = {
  createInstallPlanFromRequest,
};

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Use normalizeInstallRequest() to produce the request so the mode is always one of the supported values.
  2. Align versions: ensure the code that builds the request and the runtime that consumes it are the same ECC version.
  3. If you must build the request manually, restrict mode to 'manifest', 'legacy-compat', or 'legacy'.

Example fix

// before
const plan = createInstallPlanFromRequest({ mode: 'auto', target: 'claude' });
// after
const plan = createInstallPlanFromRequest({ mode: 'manifest', target: 'claude', profileId: 'base', moduleIds: [], includeComponentIds: [], excludeComponentIds: [] });
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_MODES = new Set(['manifest','legacy-compat','legacy']);
if (!SUPPORTED_MODES.has(request?.mode)) {
  throw new Error(`Unsupported install request mode: ${request?.mode}. Supported: ${[...SUPPORTED_MODES].join(', ')}`);
}

Type guard

function isSupportedMode(mode) {
  return mode === 'manifest' || mode === 'legacy-compat' || mode === 'legacy';
}

Try / catch

try {
  plan = createInstallPlanFromRequest(request, options);
} catch (e) {
  if (/^Unsupported install request mode:/.test(e.message)) {
    request = { ...request, mode: 'manifest' };
    plan = createInstallPlanFromRequest(request, options);
  } else throw e;
}

Prevention

When it happens

Trigger: Constructing a request object by hand and setting mode to an invented value like 'custom' or 'auto'; a future ECC version introduces a new mode that this older runtime does not understand; a typo in the mode string.

Common situations: Version skew between the request producer and the runtime; serializing/deserializing requests through a format that mutates the mode; hand-built request objects in tests.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/6af8e77110276b3b. Report an issue: GitHub.