{"record":{"id":"0b9781f4eabb5db6","repo":"garrytan/gstack","slug":"unknown-model-val-use-all-model-names-join","errorCode":null,"errorMessage":"Unknown model: ${val}. Use ${ALL_MODEL_NAMES.join(', ')}, or a family variant (e.g., claude-opus-4-7, gpt-5.4-mini, o3).","messagePattern":"Unknown model: (.+?)\\. Use (.+?), or a family variant \\(e\\.g\\., claude-opus-4-7, gpt-5\\.4-mini, o3\\)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/gen-skill-docs.ts","lineNumber":108,"sourceCode":"  } catch {\n    throw new Error(`Unknown host: ${val}. Use ${ALL_HOST_NAMES.join(', ')}, or all.`);\n  }\n})();\n\n// For single-host mode, HOST is the host. For --host all, it's set per iteration below.\nlet HOST: Host = HOST_ARG_VAL === 'all' ? 'claude' : HOST_ARG_VAL;\n\n// ─── Model Overlay Selection ────────────────────────────────\n// --model is explicit. We do NOT auto-detect from host (host ≠ model).\n// Default is 'claude'. Missing overlay file → empty string (graceful).\nimport { ALL_MODEL_NAMES, resolveModel, type Model } from './models';\nconst MODEL_ARG = process.argv.find(a => a.startsWith('--model'));\nconst MODEL_ARG_VAL: Model = (() => {\n  if (!MODEL_ARG) return 'claude';\n  const val = MODEL_ARG.includes('=') ? MODEL_ARG.split('=')[1] : process.argv[process.argv.indexOf(MODEL_ARG) + 1];\n  const resolved = resolveModel(val);\n  if (!resolved) {\n    throw new Error(`Unknown model: ${val}. Use ${ALL_MODEL_NAMES.join(', ')}, or a family variant (e.g., claude-opus-4-7, gpt-5.4-mini, o3).`);\n  }\n  return resolved;\n})();\n\n// ─── Catalog Mode (v1.45.0.0 T4) ────────────────────────────\n// 'trim' (default): shorten frontmatter description to lead sentence,\n// move routing/voice prose into a \"## When to invoke\" body section, and\n// emit scripts/proactive-suggestions.json (single file across all skills).\n// 'full': legacy v1.44 behavior — full description stays in frontmatter.\nconst CATALOG_MODE_ARG = process.argv.find(a => a.startsWith('--catalog-mode'));\nconst CATALOG_MODE: 'trim' | 'full' = (() => {\n  if (!CATALOG_MODE_ARG) return 'trim';\n  const val = CATALOG_MODE_ARG.includes('=')\n    ? CATALOG_MODE_ARG.split('=')[1]\n    : process.argv[process.argv.indexOf(CATALOG_MODE_ARG) + 1];\n  if (val !== 'trim' && val !== 'full') {\n    throw new Error(`Unknown catalog mode: ${val}. Use 'trim' (default) or 'full'.`);\n  }","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/scripts/gen-skill-docs.ts#L90-L126","documentation":"Thrown by the MODEL_ARG_VAL IIFE in scripts/gen-skill-docs.ts:108 when resolveModel(val) returns falsy for the --model flag value. The message lists ALL_MODEL_NAMES and family-variant examples (e.g. claude-opus-4-7). Note host != model: the model overlay is selected explicitly and does not auto-derive from --host.","triggerScenarios":"Passing `--model gpt-99` (typo or non-existent). Using a family-variant string with wrong punctuation like `gpt-5.4.mini`. Referencing a model removed/renamed in a newer gstack.","commonSituations":"Confusing the model overlay name with the host name. Copying a model identifier from stale docs. Typo in a CI matrix variable.","solutions":["Omit --model to default to 'claude'","Use a literal from ALL_MODEL_NAMES exactly as exported","Use a documented family variant verbatim (e.g. claude-opus-4-7, gpt-5.4-mini, o3)","Inspect scripts/models.ts exports (ALL_MODEL_NAMES, resolveModel) for the supported set"],"exampleFix":"// before\nbun run gen:skill-docs -- --model gp5\n// after\nbun run gen:skill-docs -- --model gpt-5.4-mini","handlingStrategy":"type-guard","validationCode":"import { ALL_MODEL_NAMES, resolveModel } from './models';\nconst modelArg = process.argv.find(a => a.startsWith('--model'));\nconst modelVal = modelArg?.includes('=') ? modelArg.split('=')[1] : process.argv[process.argv.indexOf(modelArg!) + 1];\nif (modelVal != null && !resolveModel(modelVal)) {\n  console.error(`--model invalid; valid: ${ALL_MODEL_NAMES.join(', ')} (or a family variant)`);\n  process.exit(2);\n}","typeGuard":"import { ALL_MODEL_NAMES, resolveModel, type Model } from './models';\nfunction isModelName(v: string): v is Model {\n  return (ALL_MODEL_NAMES as readonly string[]).includes(v) || resolveModel(v) !== undefined;\n}","tryCatchPattern":null,"preventionTips":["Confirm the model exists in scripts/models.ts before referencing it","Reuse a known-good CI invocation rather than typing model names freehand","Remember host != model — do not derive the overlay from --host"],"tags":["cli","argument-validation","build","model"],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}