{"record":{"id":"d55b853033d3d9ad","repo":"KeygraphHQ/shannon","slug":"model-not-found-in-pi-registry-provider-provid","errorCode":null,"errorMessage":"Model not found in pi registry: provider=\"${providerId}\" model=\"${modelId}\". Browse valid providers and models at ${PI_CATALOG_URL}.","messagePattern":"Model not found in pi registry: provider=\"(.+?)\" model=\"(.+?)\"\\. Browse valid providers and models at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/worker/src/ai/models.ts","lineNumber":331,"sourceCode":"    );\n  }\n  return configured;\n}\n\n/**\n * Resolve SHANNON_AI_MODEL, build a ModelRuntime primed with the provider's\n * credential, and look the model up in it.\n */\nexport async function resolveModelSelection(): Promise<ModelSelection> {\n  const { providerId, modelId } = resolveModelSpec();\n  const credentials = resolveProviderCredentials(providerId);\n  const format = resolveGatewayFormat(providerId, credentials.baseUrl);\n\n  const modelRuntime = await createModelRuntime(providerId, credentials.apiKey);\n\n  const model = resolveModel(modelRuntime, providerId, modelId, credentials.baseUrl, format);\n  if (!model) {\n    throw new Error(\n      `Model not found in pi registry: provider=\"${providerId}\" model=\"${modelId}\". Browse valid providers and models at ${PI_CATALOG_URL}.`,\n    );\n  }\n\n  return {\n    model,\n    modelRuntime,\n    modelId,\n    providerId,\n  };\n}\n","sourceCodeStart":313,"sourceCodeEnd":343,"githubUrl":"https://github.com/KeygraphHQ/shannon/blob/1ae0a142f8525410a688f0309fd003cc5b1d92de/apps/worker/src/ai/models.ts#L313-L343","documentation":"resolveModelSelection rejects when resolveModel returns undefined: the named model id is not in pi's offline registry for that provider AND no SHANNON_AI_BASE_URL gateway is configured to pass unknown ids through. The browsable catalogue at pi.dev/models is the source of valid ids; allowModelNetwork is false so the registry is never refreshed at runtime.","triggerScenarios":"SHANNON_AI_MODEL='provider:model' where 'model' is unknown to pi's bundled catalogue and SHANNON_AI_BASE_URL is unset; or a provider pi carries no models for at all. Also triggered by a typo in the model id.","commonSituations":"Typo ('claude-sonet-4-6'); a model renamed/removed after a pi upgrade; using a vendor's own id instead of pi's; referencing a brand-new model before bumping pi.","solutions":["Verify the exact id at https://pi.dev/models and correct the typo.","If the model exists only behind a custom endpoint, set SHANNON_AI_BASE_URL so the id passes through (cost/context figures will be approximate).","Upgrade @earendil-works/pi-coding-agent (and rebuild) so the bundled catalogue lists the model."],"exampleFix":"# before\nexport SHANNON_AI_MODEL=anthropic:claude-sonet-4-6   # typo\n\n# after\nexport SHANNON_AI_MODEL=anthropic:claude-sonnet-4-6","handlingStrategy":"try-catch","validationCode":"import { resolveModelSpec } from './models';\nconst { providerId, modelId } = resolveModelSpec();\nconsole.log(`Resolving provider=\"${providerId}\" model=\"${modelId}\". Verify at https://pi.dev/models before launch.`);","typeGuard":null,"tryCatchPattern":"try {\n  const selection = await resolveModelSelection();\n} catch (error) {\n  if (error instanceof Error && error.message.startsWith('Model not found in pi registry')) {\n    // surface the catalogue URL from the message, then exit non-zero\n    console.error(error.message);\n    process.exit(2);\n  }\n  throw error;\n}","preventionTips":["Confirm the provider:model id at https://pi.dev/models before setting SHANNON_AI_MODEL.","If the model is only available behind a gateway, set SHANNON_AI_BASE_URL so unknown ids pass through.","Keep @earendil-works/pi-coding-agent current so the bundled offline catalogue lists new models."],"tags":["config","model-selection","registry","pi"],"backgroundTag":null,"analyzedSha":"1ae0a142f8525410a688f0309fd003cc5b1d92de","analyzedAt":"2026-08-12T17:40:03.583Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}