{"record":{"id":"8025d23d67c4a624","repo":"continuedev/continue","slug":"no-chat-model-selected","errorCode":null,"errorMessage":"No chat model selected","messagePattern":"No chat model selected","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/core.ts","lineNumber":578,"sourceCode":"      };\n    });\n\n    on(\"llm/streamChat\", (msg) => {\n      const abortController = this.addMessageAbortController(msg.messageId);\n      return llmStreamChat(\n        this.configHandler,\n        abortController,\n        msg,\n        this.ide,\n        this.messenger,\n      );\n    });\n\n    on(\"llm/complete\", async (msg) => {\n      const { config } = await this.configHandler.loadConfig();\n      const model = config?.selectedModelByRole.chat;\n      if (!model) {\n        throw new Error(\"No chat model selected\");\n      }\n      const abortController = this.addMessageAbortController(msg.messageId);\n\n      const completion = await model.complete(\n        msg.data.prompt,\n        abortController.signal,\n        msg.data.completionOptions,\n      );\n      return completion;\n    });\n    on(\"llm/listModels\", this.handleListModels.bind(this));\n\n    on(\"llm/compileChat\", async (msg) => {\n      const { messages, options } = msg.data;\n      const model = (await this.configHandler.loadConfig()).config\n        ?.selectedModelByRole.chat;\n\n      if (!model) {","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/core.ts#L560-L596","documentation":"Thrown by the 'llm/complete' IPC handler when the loaded config has no chat model set (config.selectedModelByRole.chat is undefined). The messenger route refuses to run a completion because there is no model to send the prompt to.","triggerScenarios":"Sending an 'llm/complete' message from the GUI while config.json has no default chat model (e.g. fresh install, models array empty, or selectedModelByRole.chat was never populated).","commonSituations":"First-run setup without selecting a model; config.json deleted or corrupted; model entry removed but role mapping not updated; headless/programmatic use before initialization.","solutions":["Open config and select a chat model (set models[].roles to include 'chat' or set the default chat model in the GUI)","Verify config.json parses and contains at least one model","If programmatic, ensure initialization/config-writing runs before llm/complete"],"exampleFix":"// before\nawait messenger.send(\"llm/complete\", { messageId, data: { prompt } });\n// after\nconst { config } = await configHandler.loadConfig();\nif (!config?.selectedModelByRole.chat) throw new Error(\"configure a chat model first\");\nawait messenger.send(\"llm/complete\", { messageId, data: { prompt } });","handlingStrategy":"validation","validationCode":"const { config } = await configHandler.loadConfig();\nif (!config?.selectedModelByRole.chat) {\n  throw new Error('Configure a chat model before llm/complete');\n}","typeGuard":"const hasChatModel = (c?: Config): c is Config & { selectedModelByRole: { chat: ILLM } } =>\n  !!c?.selectedModelByRole?.chat;","tryCatchPattern":"try { await send('llm/complete', msg); } catch (e) { if ((e as Error).message === 'No chat model selected') { promptUserToSelectModel(); } else throw e; }","preventionTips":["Run a config readiness check on startup before enabling chat actions","Disable chat-triggering UI until a chat model is selected"],"tags":["config","llm","ipc","chat-model"],"backgroundTag":"missing-config-value","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}