{"record":{"id":"da17db7dd737b065","repo":"nanocoai/nanoclaw","slug":"unknown-provider-name-registered-known","errorCode":null,"errorMessage":"Unknown provider: ${name}. Registered: ${known}","messagePattern":"Unknown provider: (.+?)\\. Registered: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"container/agent-runner/src/providers/provider-registry.ts","lineNumber":26,"sourceCode":" */\nimport type { AgentProvider, ProviderOptions } from './types.js';\n\nexport type ProviderFactory = (options: ProviderOptions) => AgentProvider;\n\nconst registry = new Map<string, ProviderFactory>();\n\nexport function registerProvider(name: string, factory: ProviderFactory): void {\n  if (registry.has(name)) {\n    throw new Error(`Provider already registered: ${name}`);\n  }\n  registry.set(name, factory);\n}\n\nexport function getProviderFactory(name: string): ProviderFactory {\n  const factory = registry.get(name);\n  if (!factory) {\n    const known = [...registry.keys()].join(', ') || '(none)';\n    throw new Error(`Unknown provider: ${name}. Registered: ${known}`);\n  }\n  return factory;\n}\n\nexport function listProviderNames(): string[] {\n  return [...registry.keys()];\n}\n","sourceCodeStart":8,"sourceCodeEnd":34,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/container/agent-runner/src/providers/provider-registry.ts#L8-L34","documentation":"parseTemplate throws when the directory passed to it does not exist on disk. This is the first check before any plugin content is read.","triggerScenarios":"Calling parseTemplate with a typo'd path, a template that was never fetched, or a path from stale config after the template was deleted/moved.","commonSituations":"Template library not cloned; path stored in DB/config points at a removed directory; relative path resolved from the wrong cwd.","solutions":["Verify the path exists: ls the printed directory","Re-fetch/install the template from the template library","If relative, ensure you're running from the expected cwd or use an absolute path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!fs.existsSync(dir)) {\n  // fetch/install the template or fail with a friendly message before parseTemplate\n}","typeGuard":"function dirExists(p: string): boolean { try { return fs.statSync(p).isDirectory(); } catch { return false; } }","tryCatchPattern":"try { parseTemplate(dir); } catch (e) { if (e instanceof Error && e.message.startsWith('Template folder not found')) { /* trigger install flow */ } else throw e; }","preventionTips":["Resolve template paths to absolute form at config-load time and assert existence early","Keep template installation idempotent so a missing dir self-heals"],"tags":["templates","filesystem","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}