{"record":{"id":"fcd95c979703eabb","repo":"coleam00/Archon","slug":"invalid-model-assignment-expected-small-m","errorCode":null,"errorMessage":"Invalid --model '${assignment}'. Expected <small|medium|large|@alias>=<model>.","messagePattern":"Invalid --model '(.+?)'\\. Expected <small\\|medium\\|large\\|@alias>=<model>\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/model-validation.ts","lineNumber":428,"sourceCode":"    defaultProvider: profile.defaultProvider,\n    aliases: {\n      ...profile.aliases,\n      ...overrides.tiers,\n      ...overrides.aliases,\n    },\n  };\n}\n\n/** Parse repeated CLI `name=spec` mappings into the shared transport shape. */\nexport function parseRunModelAssignments(assignments: readonly string[]): RunModelOverrides {\n  const tiers: Partial<Record<TierName, string>> = {};\n  const aliases: Record<string, string> = {};\n  const seen = new Set<string>();\n\n  for (const assignment of assignments) {\n    const equals = assignment.indexOf('=');\n    if (equals <= 0 || equals === assignment.length - 1) {\n      throw new Error(\n        `Invalid --model '${assignment}'. Expected <small|medium|large|@alias>=<model>.`\n      );\n    }\n    const name = assignment.slice(0, equals).trim();\n    const spec = assignment.slice(equals + 1).trim();\n    if (name.length === 0 || spec.length === 0) {\n      throw new Error(\n        `Invalid --model '${assignment}'. Expected <small|medium|large|@alias>=<model>.`\n      );\n    }\n    if (seen.has(name)) throw new Error(`Duplicate --model binding '${name}'.`);\n    seen.add(name);\n\n    if (isTierName(name)) {\n      tiers[name] = spec;\n    } else {\n      assertNotReserved(name);\n      assertCustomAliasPrefix(name);","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/model-validation.ts#L410-L446","documentation":"Thrown by parseRunModelAssignments when a --model assignment contains no usable '=' separator. Each assignment must be '<small|medium|large|@alias>=<model>'; one without '=' (or with '=' only at the end) cannot be split into name and spec.","triggerScenarios":"modelOverrides receives assignments like 'large' (no '='), '=openai/gpt-4o' (empty name ⇒ equals===0), or 'large=' (equals===length-1).","commonSituations":"CLI users separating multiple --model flags with spaces but forgetting '='; shell quoting dropping the '='; copy-pasted flags where the value was lost.","solutions":["Include '=' with both sides filled: '--model large=openai/gpt-4o'.","Quote the assignment in the shell so '=' is not consumed: --model \"@alias=my-model\".","Remove trailing '=' or leading '=' variants and supply the missing side.","Check for stray whitespace or line-wrap artifacts in scripts that build the flag."],"exampleFix":"// before\n--model large\n// after\n--model large=anthropic/claude-sonnet-4","handlingStrategy":"validation","validationCode":"function isValidAssignment(a: string): boolean {\n  const eq = a.indexOf('=');\n  return eq > 0 && eq < a.length - 1;\n}","typeGuard":"function isParsableAssignment(a: string): a is `${string}=${string}` {\n  const eq = a.indexOf('=');\n  return eq > 0 && eq < a.length - 1;\n}","tryCatchPattern":"try {\n  parseRunModelAssignments(rawAssignments);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Invalid --model')) {\n    console.error(`Bad --model flag: ${err.message}`);\n    process.exitCode = 2;\n    return;\n  }\n  throw err;\n}","preventionTips":["Always use NAME=value form for --model flags, e.g. large=openai/gpt-4o.","Quote flags in shell scripts so '=' survives argument splitting.","Validate assignments with a regex like /^[^=\\s]+=.+$/ before invoking the parser.","Avoid building flags via string concatenation; prefer arrays of arguments."],"tags":["cli","config","parsing"],"backgroundTag":"invalid-model-override-format","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}