{"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":null,"httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":195,"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}\n","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/install-guided.js#L177-L213","documentation":"In non-interactive or --json mode, selecting the kimi harness requires an explicit --profile choice (the content profile Kimi receives). Without a TTY the installer cannot prompt, so a missing --profile throws.","triggerScenarios":"Running --harness kimi --yes without --profile, or adding --json to a Kimi install that did not specify a profile.","commonSituations":"Assuming Kimi uses the same default profile as interactive mode, or a CI template that selects kimi but forgets the profile flag.","solutions":["Add --profile <id> (e.g. core) to the command","Use --dry-run to preview without mutating, then run the real install with --profile","Drop kimi from --harness if you do not need it configured"],"exampleFix":"// before\nnode scripts/install-guided.js --harness kimi --yes\n// after\nnode scripts/install-guided.js --harness kimi --profile core --yes","handlingStrategy":"validation","validationCode":"const interactive = process.stdin.isTTY === true;\nconst explicitMode = !interactive || argv.includes('--json');\nif (explicitMode && selectsKimi(argv) && !argv.includes('--profile')) {\n  throw new Error('Kimi needs --profile in non-interactive/JSON mode');\n}","typeGuard":"function hasKimiProfile(argv) {\n  return argv.includes('--profile');\n}","tryCatchPattern":"try { validateExecutionMode(options, interactive); }\ncatch (err) {\n  if (/Kimi requires an explicit --profile/.test(err.message)) {\n    console.error(`${err.message} Add --profile <id>.`);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Remember Kimi requires a content profile in automation","Standardize on a profile id (e.g. core) in CI templates","Use --dry-run to catch missing-choice errors before applying"],"tags":["cli","non-interactive","install-guided","kimi"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}