garrytan/gstack · error · Error

Unknown model: ${val}. Use ${ALL_MODEL_NAMES.join(', ')}, or

Error message

Unknown model: ${val}. Use ${ALL_MODEL_NAMES.join(', ')}, or a family variant (e.g., claude-opus-4-7, gpt-5.4-mini, o3).

What it means

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.

Source

Thrown at scripts/gen-skill-docs.ts:108

  } catch {
    throw new Error(`Unknown host: ${val}. Use ${ALL_HOST_NAMES.join(', ')}, or all.`);
  }
})();

// For single-host mode, HOST is the host. For --host all, it's set per iteration below.
let HOST: Host = HOST_ARG_VAL === 'all' ? 'claude' : HOST_ARG_VAL;

// ─── Model Overlay Selection ────────────────────────────────
// --model is explicit. We do NOT auto-detect from host (host ≠ model).
// Default is 'claude'. Missing overlay file → empty string (graceful).
import { ALL_MODEL_NAMES, resolveModel, type Model } from './models';
const MODEL_ARG = process.argv.find(a => a.startsWith('--model'));
const MODEL_ARG_VAL: Model = (() => {
  if (!MODEL_ARG) return 'claude';
  const val = MODEL_ARG.includes('=') ? MODEL_ARG.split('=')[1] : process.argv[process.argv.indexOf(MODEL_ARG) + 1];
  const resolved = resolveModel(val);
  if (!resolved) {
    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).`);
  }
  return resolved;
})();

// ─── Catalog Mode (v1.45.0.0 T4) ────────────────────────────
// 'trim' (default): shorten frontmatter description to lead sentence,
// move routing/voice prose into a "## When to invoke" body section, and
// emit scripts/proactive-suggestions.json (single file across all skills).
// 'full': legacy v1.44 behavior — full description stays in frontmatter.
const CATALOG_MODE_ARG = process.argv.find(a => a.startsWith('--catalog-mode'));
const CATALOG_MODE: 'trim' | 'full' = (() => {
  if (!CATALOG_MODE_ARG) return 'trim';
  const val = CATALOG_MODE_ARG.includes('=')
    ? CATALOG_MODE_ARG.split('=')[1]
    : process.argv[process.argv.indexOf(CATALOG_MODE_ARG) + 1];
  if (val !== 'trim' && val !== 'full') {
    throw new Error(`Unknown catalog mode: ${val}. Use 'trim' (default) or 'full'.`);
  }

View on GitHub (pinned to 94993f7401)

Solutions

  1. Omit --model to default to 'claude'
  2. Use a literal from ALL_MODEL_NAMES exactly as exported
  3. Use a documented family variant verbatim (e.g. claude-opus-4-7, gpt-5.4-mini, o3)
  4. Inspect scripts/models.ts exports (ALL_MODEL_NAMES, resolveModel) for the supported set

Example fix

// before
bun run gen:skill-docs -- --model gp5
// after
bun run gen:skill-docs -- --model gpt-5.4-mini
Defensive patterns

Strategy: type-guard

Validate before calling

import { ALL_MODEL_NAMES, resolveModel } from './models';
const modelArg = process.argv.find(a => a.startsWith('--model'));
const modelVal = modelArg?.includes('=') ? modelArg.split('=')[1] : process.argv[process.argv.indexOf(modelArg!) + 1];
if (modelVal != null && !resolveModel(modelVal)) {
  console.error(`--model invalid; valid: ${ALL_MODEL_NAMES.join(', ')} (or a family variant)`);
  process.exit(2);
}

Type guard

import { ALL_MODEL_NAMES, resolveModel, type Model } from './models';
function isModelName(v: string): v is Model {
  return (ALL_MODEL_NAMES as readonly string[]).includes(v) || resolveModel(v) !== undefined;
}

Prevention

When it happens

Trigger: 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.

Common situations: Confusing the model overlay name with the host name. Copying a model identifier from stale docs. Typo in a CI matrix variable.

Related errors


AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12). Data as JSON: /api/errors/0b9781f4eabb5db6. Report an issue: GitHub.