{"record":{"id":"ffe381f2faff4d1f","repo":"coleam00/Archon","slug":"model-override-targetname-has-an-empty-model","errorCode":null,"errorMessage":"Model override '${targetName}' has an empty model id.","messagePattern":"Model override '(.+?)' has an empty model id\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/model-validation.ts","lineNumber":357,"sourceCode":"  if (isTierName(spec) || spec.startsWith('@')) {\n    const resolved = resolveModelSpec(profile, spec);\n    if (isLiteralSpec(resolved)) {\n      throw new Error(`Model override '${targetName}' could not resolve '${spec}'.`);\n    }\n    return normalizeRunOverridePreset(targetName, { ...resolved });\n  }\n\n  const slash = spec.indexOf('/');\n  if (slash === -1) {\n    const target = presetForOverrideTarget(profile, targetName);\n    return normalizeRunOverridePreset(targetName, { provider: target.provider, model: spec });\n  }\n\n  const prefix = spec.slice(0, slash);\n  const remainder = spec.slice(slash + 1);\n  if (isRegisteredProvider(prefix)) {\n    if (remainder.length === 0) {\n      throw new Error(`Model override '${targetName}' has an empty model id.`);\n    }\n    if (prefix === 'pi' && !parsePiModelRef(remainder)) {\n      throw new Error(\n        `Model override '${targetName}' has invalid Pi model '${remainder}'. ` +\n          \"Pi overrides need a vendor prefix, e.g. 'pi/minimax/minimax-m3'.\"\n      );\n    }\n    return normalizeRunOverridePreset(targetName, { provider: prefix, model: remainder });\n  }\n\n  if (!parsePiModelRef(spec)) {\n    throw new Error(\n      `Model override '${targetName}' has invalid model '${spec}'. Expected <agent>/<model> or <vendor>/<model>.`\n    );\n  }\n  return normalizeRunOverridePreset(targetName, { provider: 'pi', model: spec });\n}\n","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/model-validation.ts#L339-L375","documentation":"Thrown by resolveRunOverrideSpec when a model override spec like 'provider/' specifies a registered provider but no model id after the slash. The library cannot resolve an override whose model portion is empty, so it fails fast with a targeted message naming the override.","triggerScenarios":"Calling resolveRunModelOverrides (or resolveRunOverrideSpec directly) with a spec string of the form '<registered-provider>/' e.g. 'openai/' or 'pi/' — the first '/' yields an empty remainder.","commonSituations":"Hand-edited config files or CLI flags where the model after the slash was deleted or never filled in; templated YAML where a model variable expanded to empty; trailing-slash typos.","solutions":["Provide a model id after the provider prefix, e.g. 'openai/gpt-4o' instead of 'openai/'.","If the spec came from a variable/interpolation, log the raw value to find why it expanded empty.","For Pi alias entries keep a vendor segment, e.g. 'pi/minimax/minimax-m3'.","Strip accidental trailing slashes from user/config supplied specs before calling the API."],"exampleFix":"// before\n--model large=openai/\n// after\n--model large=openai/gpt-4o","handlingStrategy":"validation","validationCode":"function isValidOverrideSpec(spec: string, isRegistered: (p: string) => boolean): boolean {\n  const slash = spec.indexOf('/');\n  if (slash <= 0) return false;\n  const prefix = spec.slice(0, slash);\n  if (isRegistered(prefix)) return spec.slice(slash + 1).length > 0;\n  return true;\n}","typeGuard":"function hasNonEmptyModelId(spec: string): spec is `${string}/${string}` {\n  const slash = spec.indexOf('/');\n  return slash > 0 && slash < spec.length - 1;\n}","tryCatchPattern":"try {\n  resolveRunModelOverrides(assignments);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('empty model id')) {\n    throw new Error(`Config error: fill in the model after the provider slash (${err.message})`);\n  }\n  throw err;\n}","preventionTips":["Always write overrides as <provider>/<model> with both parts non-empty.","Trim and sanitize spec strings read from env vars, YAML, or CLI input.","Add a config-lint step that rejects specs ending in '/'.","Keep a tested example of a valid override in your project docs."],"tags":["config","validation","model-override"],"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"}