{"record":{"id":"765c94d8e46b4f58","repo":"coleam00/Archon","slug":"model-override-targetname-has-invalid-model","errorCode":null,"errorMessage":"Model override '${targetName}' has invalid model '${spec}'. Expected <agent>/<model> or <vendor>/<model>.","messagePattern":"Model override '(.+?)' has invalid model '(.+?)'\\. Expected <agent>/<model> or <vendor>/<model>\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflows/src/model-validation.ts","lineNumber":369,"sourceCode":"  }\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\n/**\n * Resolve one invocation's string mappings against the already-layered lower\n * profile. This is the only transport-to-profile boundary used by CLI and HTTP.\n */\nexport function resolveRunModelOverrides(\n  profile: ResolvedAiProfile,\n  overrides: RunModelOverrides | undefined\n): ResolvedRunModelOverrides {\n  if (!overrides) return {};\n\n  const tiers: RawTiersConfig = {};\n  for (const [name, spec] of Object.entries(overrides.tiers ?? {})) {","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/workflows/src/model-validation.ts#L351-L387","documentation":"Thrown by resolveRunOverrideSpec when a spec is neither '<registered-provider>/<model>' nor a parseable Pi model ref. This is the fallback rejection for any override string the resolver cannot interpret.","triggerScenarios":"resolveRunModelOverrides with a spec whose prefix is not a registered provider AND whose whole string fails parsePiModelRef, e.g. 'gpt-4o' (no slash), 'myagent/', or 'foo/bar' with unknown provider 'foo'.","commonSituations":"Passing a bare model name instead of the required <agent>/<model> or <vendor>/<model> form; typos in the provider/agent name; older configs written for a version that accepted bare model ids.","solutions":["Write the override as <agent>/<model> or <vendor>/<model>, e.g. 'openai/gpt-4o' or 'pi/minimax/minimax-m3'.","Verify the prefix against the registered provider list (isRegisteredProvider).","If the model is only reachable via Pi, prefix it with 'pi/' and a vendor segment.","Run the spec through parsePiModelRef or resolveRunOverrideSpec in a quick script to confirm the accepted form."],"exampleFix":"// before\n--model large=gpt-4o\n// after\n--model large=openai/gpt-4o","handlingStrategy":"validation","validationCode":"function looksLikeOverrideSpec(spec: string, registered: string[]): boolean {\n  const slash = spec.indexOf('/');\n  if (slash > 0 && registered.includes(spec.slice(0, slash))) {\n    return spec.slice(slash + 1).length > 0;\n  }\n  return slash > 0; // plausible <agent>/<model> / <vendor>/<model>\n}","typeGuard":"function isPrefixedModelSpec(spec: string): spec is `${string}/${string}` {\n  return spec.includes('/') && !spec.startsWith('/') && !spec.endsWith('/');\n}","tryCatchPattern":"try {\n  resolveRunModelOverrides(assignments);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('has invalid model')) {\n    throw new Error(`Use <agent>/<model> or <vendor>/<model> form (${err.message})`);\n  }\n  throw err;\n}","preventionTips":["Never pass a bare model id; always include an agent or vendor prefix.","Keep the registered-provider list handy (or import isRegisteredProvider) when generating specs.","Add a unit test that feeds each configured override through resolveRunOverrideSpec.","Centralize override construction in one helper instead of scattering string concatenation."],"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"}