{"record":{"id":"8b7b301216e2b6aa","repo":"can1357/oh-my-pi","slug":"no-models-available-in-the-bundled-catalog","errorCode":null,"errorMessage":"No models available in the bundled catalog","messagePattern":"No models available in the bundled catalog","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/coding-agent/src/cli/render-cli.ts","lineNumber":198,"sourceCode":"\tconst workingCopy = path.join(tempDir.path(), path.basename(sourcePath));\n\n\tconst width = args.width ?? (process.stdout.isTTY ? process.stdout.columns : undefined) ?? 120;\n\tconst height = args.height ?? (process.stdout.isTTY ? process.stdout.rows : undefined) ?? 40;\n\n\tlet session: AgentSession | undefined;\n\tlet mode: InteractiveMode | undefined;\n\ttry {\n\t\tawait fs.copyFile(sourcePath, workingCopy);\n\t\tconst openStart = performance.now();\n\t\tconst sessionManager = await SessionManager.open(workingCopy, undefined, undefined, {\n\t\t\tsuppressBreadcrumb: true,\n\t\t});\n\t\tconst openMs = performance.now() - openStart;\n\n\t\tconst authStorage = new AuthStorage(new SqliteAuthCredentialStore(new Database(\":memory:\")));\n\t\tconst modelRegistry = new ModelRegistry(authStorage);\n\t\tconst model = modelRegistry.getAll()[0];\n\t\tif (!model) throw new Error(\"No models available in the bundled catalog\");\n\n\t\tsession = new AgentSession({\n\t\t\tagent: new Agent({ initialState: { model, systemPrompt: [], tools: [], messages: [] } }),\n\t\t\tsessionManager,\n\t\t\tsettings,\n\t\t\tmodelRegistry,\n\t\t});\n\t\tconst terminal = new SinkTerminal(width, height);\n\t\tconst scheduler = new DrainScheduler();\n\t\tconst composer = new Composer({\n\t\t\tterminal,\n\t\t\ttuiOptions: { renderScheduler: scheduler },\n\t\t\tpreferences: { quiet: true },\n\t\t});\n\t\tmode = new InteractiveMode(session, VERSION, undefined, undefined, undefined, undefined, undefined, composer);\n\t\tawait mode.init({ suppressWelcomeIntro: true });\n\t\tscheduler.drain();\n","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/render-cli.ts#L180-L216","documentation":"`runRenderCommand` builds an offline AgentSession using the bundled model catalog via `ModelRegistry.getAll()`. If the first model lookup returns nothing — the bundled catalog is empty/unavailable — the command cannot proceed and throws. This is a hard invariant: rendering requires at least one known model.","triggerScenarios":"`modelRegistry.getAll()[0]` is undefined because the bundled models.json failed to load, the catalog resource is missing from the build, or an AuthStorage/registry misconfiguration filters everything out.","commonSituations":"Corrupted or stripped install where the bundled catalog asset is absent; a broken build of the package; future catalog format change making all entries unparsable.","solutions":["Reinstall/upgrade the omp package so the bundled models.json is present","Check that your build/packaging step isn't excluding the catalog JSON asset","Report the issue if a fresh install still shows an empty catalog — likely a catalog generation bug","Verify with a minimal script that `new ModelRegistry(auth).getAll()` returns entries"],"exampleFix":"// before\nconst model = modelRegistry.getAll()[0];\nif (!model) throw new Error(\"No models available in the bundled catalog\");\n// after\nconst models = modelRegistry.getAll();\nconst model = models[0];\nif (!model) throw new Error(`No models available in the bundled catalog (${models.length} entries; check installation)`);","handlingStrategy":"fallback","validationCode":"const models = modelRegistry.getAll();\nif (models.length === 0) {\n  console.error(\"Bundled model catalog is empty — reinstall the package.\");\n  process.exit(1);\n}","typeGuard":"function hasModels(registry: ModelRegistry): boolean {\n  return registry.getAll().length > 0;\n}","tryCatchPattern":"try {\n  const model = modelRegistry.getAll()[0];\n  if (!model) throw new Error(\"No models available in the bundled catalog\");\n} catch (err) {\n  console.error(`${err instanceof Error ? err.message : err} — reinstall/upgrade omp`);\n  process.exit(1);\n}","preventionTips":["Verify the bundled models.json asset exists after custom builds","Reinstall the package if the catalog is empty on a standard install","Smoke-test catalog availability before shipping a custom distribution"],"tags":["catalog","models","configuration"],"backgroundTag":"empty-model-catalog","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}