{"record":{"id":"f196c554761b9169","repo":"coleam00/Archon","slug":"provider-did-not-accept-the-model","errorCode":null,"errorMessage":"provider did not accept the model","messagePattern":"provider did not accept the model","errorType":"validation","errorClass":"InvalidProviderRunConfigError","httpStatus":null,"severity":"error","filePath":"packages/providers/src/registry.ts","lineNumber":93,"sourceCode":"  if (!entry) {\n    throw new UnknownProviderError(id, [...registry.keys()]);\n  }\n  return entry;\n}\n\n/**\n * Get provider capabilities without instantiating a provider.\n * @throws UnknownProviderError if not registered\n */\nexport function getProviderCapabilities(id: string): ProviderCapabilities {\n  return getRegistration(id).capabilities;\n}\n\n/** Validate and normalize a run-owned model through the provider's strict parser. */\nexport function parseProviderRunModel(id: string, model: string): string {\n  const parsed = getRegistration(id).parseRunConfig({ model });\n  if (typeof parsed.model !== 'string' || parsed.model.trim().length === 0) {\n    throw new InvalidProviderRunConfigError('model', 'provider did not accept the model');\n  }\n  return parsed.model;\n}\n\n/**\n * Get all registered providers.\n */\nexport function getRegisteredProviders(): ProviderRegistration[] {\n  return [...registry.values()];\n}\n\n/**\n * Get API-safe provider info (excludes the factory).\n */\nexport function getProviderInfoList(): ProviderInfo[] {\n  return getRegisteredProviders().map(({ id, displayName, capabilities, builtIn }) => ({\n    id,\n    displayName,","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/providers/src/registry.ts#L75-L111","documentation":"parseProviderRunModel validates a run-owned model string by routing it through the provider's strict parseRunConfig. If the provider accepts the input but the parsed result has no non-blank model, the provider effectively rejected the model, so this throws InvalidProviderRunConfigError for the 'model' field. It catches models a provider silently drops rather than passing an empty model downstream.","triggerScenarios":"parseProviderRunModel(id, model) where getRegistration(id).parseRunConfig({ model }) returns an object whose .model is undefined, empty, or whitespace-only — e.g. the provider's parser strips/normalizes an unsupported alias to nothing.","commonSituations":"Model alias not recognized by the installed provider version; passing a provider-prefixed model ('claude/x') to a parser that expects a bare ID; empty or whitespace model string slipping through earlier validation; model renamed/deprecated upstream.","solutions":["Use a model identifier the provider's parser accepts (check the provider's supported model list/presets)","Strip provider prefixes and pass the bare model ID the parser expects","Log/inspect the raw input — an empty or blank model reaching this function indicates earlier validation is missing"],"exampleFix":"// before\nconst model = parseProviderRunModel('claude', 'anthropic/claude-sonnet-4');\n// after\nconst model = parseProviderRunModel('claude', 'claude-sonnet-4');","handlingStrategy":"validation","validationCode":"if (typeof model !== 'string' || model.trim().length === 0) {\n  throw new Error('model must be a non-blank string before parseProviderRunModel');\n}","typeGuard":"function isNonBlankString(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"import { InvalidProviderRunConfigError } from '@archon/providers';\ntry {\n  model = parseProviderRunModel(providerId, rawModel);\n} catch (err) {\n  if (err instanceof InvalidProviderRunConfigError && err.fieldPath === 'model') {\n    console.error(`Provider '${providerId}' rejected model '${rawModel}'; use a supported model`);\n  }\n  throw err;\n}","preventionTips":["Use model IDs from the provider's own supported/preset list","Strip provider prefixes before passing the model","Validate non-blank model strings before calling the parser"],"tags":["run-config","model-validation","providers"],"backgroundTag":"invalid-model-identifier","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}