{"record":{"id":"159b334f4d5a9622","repo":"affaan-m/ECC","slug":"kimi-requires-an-explicit-profile-choice-in-this","errorCode":null,"errorMessage":"Kimi requires an explicit --profile choice in this mode.","messagePattern":"Kimi requires an explicit --profile choice in this mode\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":196,"sourceCode":"}\n\nfunction selectedHarnessIds(options) {\n  if (options.allHarnesses) return normalizeHarnessSelection(['all']);\n  if (options.harnesses.length === 0) return [];\n  return normalizeHarnessSelection(options.harnesses);\n}\n\nfunction validateExecutionMode(options, interactive) {\n  const harnesses = selectedHarnessIds(options);\n  if (!interactive && harnesses.length === 0) {\n    throw new Error('Non-interactive guided install requires at least one --harness.');\n  }\n  const requiresExplicit = !interactive || options.json;\n  if (requiresExplicit && harnesses.includes('claude') && (!options.claudeScope || !options.claudeHooks)) {\n    throw new Error('Claude requires explicit --claude-scope and --claude-hooks choices in this mode.');\n  }\n  if (requiresExplicit && harnesses.includes('kimi') && !options.profile) {\n    throw new Error('Kimi requires an explicit --profile choice in this mode.');\n  }\n  if ((!interactive || options.json) && !options.yes && !options.dryRun) {\n    throw new Error('Non-interactive and JSON mutations require --yes.');\n  }\n}\n\nfunction printPlan(plan, output) {\n  output.write('\\nECC guided install preview\\n\\n');\n  output.write('Harness       Channel           Destination\\n');\n  for (const entry of plan.harnesses) {\n    const harness = getHarnessCapability(entry.id);\n    output.write(`${harness.label.padEnd(13)} ${entry.channel.padEnd(17)} ${harness.destination}\\n`);\n  }\n  if (plan.request.harnesses.includes('kimi')) {\n    output.write('\\nKimi note: ECC hooks are not configured; model, provider, and authentication settings are unchanged.\\n');\n  }\n  if (plan.request.harnesses.includes('claude') && plan.request.claudeHooks && plan.request.claudeHooks !== 'off') {\n    output.write(","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/install-guided.js#L178-L214","documentation":"validateExecutionMode() requires an explicit --profile whenever the 'kimi' harness is selected in non-interactive or --json mode. Since no interactive prompt can choose the Kimi profile, the caller must pass --profile; otherwise the script throws to avoid installing Kimi with an unintended configuration.","triggerScenarios":"Non-interactive or JSON-mode run where options.harnesses includes 'kimi' and options.profile is falsy (--profile not provided).","commonSituations":"CI jobs adding kimi to the harness list; users copying a claude-only non-interactive command and appending --harness kimi without the profile flag; scripts where the profile variable is empty/unset.","solutions":["Add --profile <value> to the command for the desired Kimi profile.","Remove --harness kimi if Kimi installation is not intended.","Ensure the PROFILE variable in wrapper scripts is non-empty before invoking."],"exampleFix":"// before\nnode scripts/install-guided.js --harness kimi --yes\n// after\nnode scripts/install-guided.js --harness kimi --profile default --yes","handlingStrategy":"validation","validationCode":"if (harnesses.includes('kimi') && !profile) { throw new Error('kimi needs --profile'); }","typeGuard":null,"tryCatchPattern":"try { main(); } catch (e) { if (/Kimi requires an explicit --profile/.test(e.message)) { console.error('Supply --profile <name> when kimi is selected'); process.exit(2); } throw e; }","preventionTips":["Pair --harness kimi with --profile in every scripted invocation.","Use ${PROFILE:?PROFILE required} style shell guards for the profile variable.","Keep a canonical example command in team docs/CI templates."],"tags":["cli","non-interactive","missing-argument"],"backgroundTag":"missing-required-option","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"}