{"record":{"id":"bdaa844175795b20","repo":"coleam00/Archon","slug":"pi-model-not-found-provider-parsed-provider","errorCode":null,"errorMessage":"Pi model not found: provider='${parsed.provider}' model='${parsed.modelId}'. The model was not found in the static catalog or via any installed extension. Ensure the provider extension is installed (e.g. `pi install npm:pi-provider-kiro`) and `enableExtensions: true` is set in .archon/config.yaml.","messagePattern":"Pi model not found: provider='(.+?)' model='(.+?)'\\. The model was not found in the static catalog or via any installed extension\\. Ensure the provider extension is installed \\(e\\.g\\. `pi install npm:pi-provider-kiro`\\) and `enableExtensions: true` is set in \\.archon/config\\.yaml\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/providers/src/community/pi/provider.ts","lineNumber":911,"sourceCode":"\n    // 4f. Bind UI context or fire session_start with no UI. Must run after flag pass-through above.\n    //     Extension providers register their models during bindExtensions() — this is the trigger\n    //     for LOOKUP-2: they call registerProvider() on our modelRegistry during session_start.\n    const uiBridge = interactive ? createArchonUIBridge() : undefined;\n    if (uiBridge) {\n      const uiContext = createArchonUIContext(uiBridge);\n      await session.bindExtensions({ uiContext });\n    } else if (enableExtensions) {\n      await session.bindExtensions({});\n    }\n\n    // 4g. [LOOKUP-2] Re-check the registry after bindExtensions() for extension-registered models.\n    //     Safe to call session.setModel() here — no prompt has been sent yet.\n    if (!model) {\n      model = modelRegistry.find(parsed.provider, parsed.modelId);\n      if (!model) {\n        session.dispose();\n        throw new Error(\n          `Pi model not found: provider='${parsed.provider}' model='${parsed.modelId}'. ` +\n            'The model was not found in the static catalog or via any installed extension. ' +\n            'Ensure the provider extension is installed (e.g. `pi install npm:pi-provider-kiro`) ' +\n            'and `enableExtensions: true` is set in .archon/config.yaml.'\n        );\n      }\n      try {\n        await session.setModel(model);\n      } catch (err) {\n        session.dispose();\n        throw err;\n      }\n    }\n\n    // 5. Structured output (best-effort). Pi has no SDK-level JSON schema\n    //    mode the way Claude and Codex do, so we implement it via prompt\n    //    engineering: append the schema + \"JSON only, no fences\" instruction,\n    //    and have the bridge parse the accumulated assistant text on","sourceCodeStart":893,"sourceCodeEnd":929,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/providers/src/community/pi/provider.ts#L893-L929","documentation":"After bindExtensions(), sendQuery re-checks the ModelRegistry ([LOOKUP-2]); if neither the static catalog nor any extension registered '<provider>/<modelId>', the session is disposed and this error thrown. It usually means the model comes from a provider extension that is not installed or not enabled.","triggerScenarios":"sendQuery with a model ref whose provider is not in Pi's static model catalog and no installed extension registers it — e.g. 'kiro/...' without the pi-provider-kiro extension, or extensions disabled via enableExtensions: false.","commonSituations":"Using a third-party/custom provider model ref without `pi install npm:pi-provider-<name>`, config where assistants.pi.enableExtensions is false, a typo in provider or model id, or an extension installed in ~/.pi/agent/extensions but not loaded.","solutions":["Install the provider extension, e.g. `pi install npm:pi-provider-kiro`","Set assistants.pi.enableExtensions: true in .archon/config.yaml","Verify the exact provider and model id (run `pi` to list available models); fix typos","Check ~/.pi/agent/extensions/ (and repo .pi/) contains the expected extension"],"exampleFix":"// before (.archon/config.yaml)\nassistants:\n  pi:\n    model: 'kiro/claude-sonnet-4'\n    enableExtensions: false\n// after\nassistants:\n  pi:\n    model: 'kiro/claude-sonnet-4'\n    enableExtensions: true","handlingStrategy":"validation","validationCode":"function isStaticCatalogModel(provider: string, modelId: string, catalog: string[]): boolean {\n  return catalog.includes(`${provider}/${modelId}`);\n}\n// before sendQuery, if not in catalog, assert the extension is installed+enabled:\nif (!isStaticCatalogModel(p, m, staticCatalog) && !config.assistants.pi.enableExtensions) {\n  throw new Error(`${p}/${m} needs a provider extension; install it and set enableExtensions: true`);\n}","typeGuard":"function isKnownModelRef(ref: string, catalog: readonly string[]): boolean {\n  return catalog.includes(ref);\n}","tryCatchPattern":"try {\n  await sendQuery(q);\n} catch (err) {\n  if (err.message.startsWith('Pi model not found')) {\n    console.error(err.message); // names provider/model and the extension install steps\n  }\n  throw err;\n}","preventionTips":["Install provider extensions (`pi install npm:pi-provider-<name>`) for non-catalog providers","Keep enableExtensions: true when using extension-backed providers","Validate model refs against the static catalog at config load time","Use `pi`'s model listing to confirm exact provider/model ids"],"tags":["model","extensions","configuration","pi"],"backgroundTag":"model-not-found","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}