{"record":{"id":"37c3e736c44192ba","repo":"coleam00/Archon","slug":"alias-name-has-invalid-model-must-be-a-non","errorCode":null,"errorMessage":"Alias '${name}' has invalid model — must be a non-empty string.","messagePattern":"Alias '(.+?)' has invalid model — must be a non-empty string\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/model-validation.ts","lineNumber":104,"sourceCode":"      `Alias name '${name}' is reserved (small/medium/large are tier keywords). Use a different name.`\n    );\n  }\n}\n\nfunction assertCustomAliasPrefix(name: string): void {\n  if (!name.startsWith('@')) {\n    throw new Error(\n      `Alias name '${name}' must start with '@' (e.g. '@${name}'). Reserved tier names (small/medium/large) do not need '@'.`\n    );\n  }\n}\n\nfunction assertValidEntry(name: string, entry: RawAliasEntry): void {\n  if (typeof entry.provider !== 'string' || entry.provider.length === 0) {\n    throw new Error(`Alias '${name}' has invalid provider — must be a non-empty string.`);\n  }\n  if (typeof entry.model !== 'string' || entry.model.length === 0) {\n    throw new Error(`Alias '${name}' has invalid model — must be a non-empty string.`);\n  }\n}\n\nfunction assertValidPersistedPreset(name: string, entry: ModelAliasPreset): void {\n  if (entry.effort !== undefined && !isEffortValidForProvider(entry.provider, entry.effort)) {\n    throw new Error(`Model binding '${name}' has an invalid effort.`);\n  }\n}\n\nexport type RunModelPresetValidationIssue =\n  | { kind: 'unknown-provider'; provider: string; field: 'provider' }\n  | { kind: 'invalid-model'; provider: string; model: string; reason: string; field: 'model' }\n  | { kind: 'unsupported-effort'; provider: string; effort: string; field: 'effort' }\n  | {\n      kind: 'invalid-effort';\n      provider: string;\n      effort: string;\n      valid: readonly string[];","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/model-validation.ts#L86-L122","documentation":"`assertValidEntry` enforces that each alias entry's `model` field is a non-empty string. The library throws this during profile construction because an alias without a concrete model identifier cannot produce a usable model binding.","triggerScenarios":"Defining an alias where `model` is missing, an empty string, or a non-string value — evaluated via `buildAiProfile` while building the resolved AI profile from layered config.","commonSituations":"YAML indentation errors leaving `model:` empty, typos like `modle:`, or moving the model id into an `effort:` or nested key by mistake.","solutions":["Set `model` to a non-empty model identifier string for the given provider","Check YAML indentation so `model:` is a direct child of the alias entry","Verify the model id is valid for the provider (run resolution once the shape is fixed)"],"exampleFix":"# before\naliases:\n  '@fast':\n    provider: openai\n    model:\n# after\naliases:\n  '@fast':\n    provider: openai\n    model: gpt-4o-mini","handlingStrategy":"validation","validationCode":"// Shape-check alias entries before profile build.\nfunction hasValidModel(entry: unknown): entry is { provider: string; model: string } {\n  return typeof entry === 'object' && entry !== null &&\n    typeof (entry as any).model === 'string' && (entry as any).model.length > 0;\n}","typeGuard":"function hasNonEmptyString<K extends string>(obj: unknown, key: K): obj is Record<K, string> {\n  return typeof obj === 'object' && obj !== null &&\n    typeof (obj as Record<string, unknown>)[key] === 'string' &&\n    ((obj as Record<string, unknown>)[key] as string).length > 0;\n}","tryCatchPattern":"try {\n  const profile = buildAiProfile(rawConfig);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('invalid model')) {\n    const alias = err.message.match(/Alias '([^']+)'/)?.[1];\n    throw new Error(`Alias ${alias} in config needs a non-empty model: value`, { cause: err });\n  }\n  throw err;\n}","preventionTips":["Set both provider and model together when defining an alias","Check YAML indentation puts model: directly under the alias entry","Use a YAML/JSON schema for the aliases config to catch empty fields","Smoke-test profile construction after every config edit"],"tags":["config","model-alias","validation","yaml"],"backgroundTag":"invalid-config-value","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}