{"record":{"id":"099f39012accc2a9","repo":"affaan-m/ECC","slug":"the-managed-install-profile-requires-kimi-to-be-se","errorCode":null,"errorMessage":"The managed install profile requires Kimi to be selected.","messagePattern":"The managed install profile requires Kimi to be selected\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/multi-harness-setup.js","lineNumber":32,"sourceCode":"\nfunction catalogHelpers() {\n  return require('./harness-capabilities');\n}\n\nfunction normalizeGuidedInstallRequest(input = {}) {\n  const { normalizeHarnessSelection } = catalogHelpers();\n  const harnesses = normalizeHarnessSelection(input.harnesses || []);\n  if (harnesses.length === 0) {\n    throw new Error('Choose at least one guided harness: Claude, Codex, or Kimi.');\n  }\n\n  const includesClaude = harnesses.includes('claude');\n  const includesKimi = harnesses.includes('kimi');\n  if (!includesClaude && (input.claudeScope !== undefined || input.claudeHooks !== undefined)) {\n    throw new Error('Claude scope and hook options require Claude to be selected.');\n  }\n  if (!includesKimi && input.profile !== undefined) {\n    throw new Error('The managed install profile requires Kimi to be selected.');\n  }\n\n  const claudeScope = includesClaude ? (input.claudeScope || 'user') : undefined;\n  const claudeHooks = includesClaude ? (input.claudeHooks || 'standard') : undefined;\n  const profile = includesKimi ? (input.profile || 'core') : undefined;\n  if (claudeScope && !VALID_CLAUDE_SCOPES.has(claudeScope)) {\n    throw new Error(`Invalid Claude scope: ${claudeScope}`);\n  }\n  if (claudeHooks && !VALID_CLAUDE_HOOKS.has(claudeHooks)) {\n    throw new Error(`Invalid Claude hooks preference: ${claudeHooks}`);\n  }\n  if (profile && !VALID_PROFILES.has(profile)) {\n    throw new Error(`Invalid Kimi install profile: ${profile}`);\n  }\n\n  return {\n    harnesses,\n    ...(claudeHooks ? { claudeHooks } : {}),","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/multi-harness-setup.js#L14-L50","documentation":"normalizeGuidedInstallRequest throws this when input.profile (the Kimi managed install profile) is supplied but 'kimi' is not among the selected harnesses. The profile option only applies to Kimi installs; the library refuses to accept it to avoid the caller assuming it had any effect. Like the Claude guard, it checks mere presence of the option.","triggerScenarios":"Calling the guided install request API with a harnesses array that does not include 'kimi' while input.profile is defined (e.g. profile: 'core').","commonSituations":"Shared install config that always sets profile but Kimi was deselected; CLI wrapper forwarding --profile unconditionally; switching from a kimi-inclusive setup to codex/claude only without removing profile.","solutions":["Add 'kimi' to the harnesses array, or","Remove the profile option when Kimi is not selected","Conditionally build the request object so profile is only present when kimi is selected"],"exampleFix":"// before\nrunSetup({ harnesses: ['claude'], profile: 'core' })\n// after\nrunSetup({ harnesses: ['claude'] })\n// or\nrunSetup({ harnesses: ['claude', 'kimi'], profile: 'core' })","handlingStrategy":"validation","validationCode":"if (!harnesses.includes('kimi') && input.profile !== undefined) {\n  throw new Error('profile requires kimi to be selected')\n}","typeGuard":"const canUseProfile = (input) => Array.isArray(input.harnesses) && input.harnesses.includes('kimi')","tryCatchPattern":"try {\n  return normalizeGuidedInstallRequest(input)\n} catch (err) {\n  if (err.message.includes('managed install profile requires Kimi')) {\n    const { profile, ...rest } = input\n    return normalizeGuidedInstallRequest(rest)\n  }\n  throw err\n}","preventionTips":["Only set profile when the kimi harness is enabled","Derive request fields from the harness selection rather than static config files","Add a unit test asserting option/harness consistency"],"tags":["validation","config","guided-install"],"backgroundTag":"conflicting-config-options","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}