affaan-m/ECC · error · Error

Invalid Kimi install profile

Error message

Invalid Kimi install profile: ${profile}

What it means

normalizeGuidedInstallRequest validates the resolved Kimi profile (defaulting to 'core' when Kimi is selected) against the VALID_PROFILES whitelist. An unrecognized profile name throws this error with the offending value interpolated. It is the Kimi-side enum check mirroring the Claude scope/hooks guards.

Solutions

  1. Use a profile listed in VALID_PROFILES in scripts/lib/multi-harness-setup.js (e.g. 'core')
  2. Omit profile to use the 'core' default
  3. Check the current version's docs for renamed profiles after upgrading

Example fix

// before
runSetup({ harnesses: ['kimi'], profile: 'complete' })
// after
runSetup({ harnesses: ['kimi'], profile: 'core' })
Defensive patterns

Strategy: validation

Validate before calling

const VALID_PROFILES = ['core'] // confirm against VALID_PROFILES in the library
if (input.profile !== undefined && !VALID_PROFILES.includes(input.profile)) {
  throw new Error(`profile must be one of: ${VALID_PROFILES.join(', ')}`)
}

Type guard

const isValidProfile = (s) => typeof s === 'string' && ['core'].includes(s)

Try / catch

try {
  return normalizeGuidedInstallRequest(input)
} catch (err) {
  if (err.message.startsWith('Invalid Kimi install profile:')) {
    return normalizeGuidedInstallRequest({ ...input, profile: 'core' })
  }
  throw err
}

Prevention

When it happens

Trigger: Calling the guided install request API with input.profile set to a string not in VALID_PROFILES while 'kimi' is selected (e.g. profile: 'full' or 'everything' when only 'core' etc. are valid).

Common situations: Typo in scripts or docs; profile names renamed between library versions; copying profile names from another installer with different tiers.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/feab1408a9050905. Report an issue: GitHub.

Appendix: source

Thrown at scripts/lib/multi-harness-setup.js:45

  const includesKimi = harnesses.includes('kimi');
  if (!includesClaude && (input.claudeScope !== undefined || input.claudeHooks !== undefined)) {
    throw new Error('Claude scope and hook options require Claude to be selected.');
  }
  if (!includesKimi && input.profile !== undefined) {
    throw new Error('The managed install profile requires Kimi to be selected.');
  }

  const claudeScope = includesClaude ? (input.claudeScope || 'user') : undefined;
  const claudeHooks = includesClaude ? (input.claudeHooks || 'standard') : undefined;
  const profile = includesKimi ? (input.profile || 'core') : undefined;
  if (claudeScope && !VALID_CLAUDE_SCOPES.has(claudeScope)) {
    throw new Error(`Invalid Claude scope: ${claudeScope}`);
  }
  if (claudeHooks && !VALID_CLAUDE_HOOKS.has(claudeHooks)) {
    throw new Error(`Invalid Claude hooks preference: ${claudeHooks}`);
  }
  if (profile && !VALID_PROFILES.has(profile)) {
    throw new Error(`Invalid Kimi install profile: ${profile}`);
  }

  return {
    harnesses,
    ...(claudeHooks ? { claudeHooks } : {}),
    ...(claudeScope ? { claudeScope } : {}),
    dryRun: Boolean(input.dryRun),
    json: Boolean(input.json),
    ...(profile ? { profile } : {}),
    yes: Boolean(input.yes),
  };
}

function canonicalPath(filePath) {
  return realpathNearestExisting(filePath);
}

function pathsMatch(left, right) {

View on GitHub (pinned to 8321021c54)