{"record":{"id":"13ea1bd662057a18","repo":"continuedev/continue","slug":"no-model-selected","errorCode":null,"errorMessage":"No model selected","messagePattern":"No model selected","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/core.ts","lineNumber":757,"sourceCode":"\n    on(\"streamDiffLines\", async (msg) => {\n      const { config } = await this.configHandler.loadConfig();\n      if (!config) {\n        throw new Error(\"Failed to load config\");\n      }\n\n      const { data } = msg;\n\n      // Title can be an edit, chat, or apply model\n      // Fall back to chat\n      const llm =\n        config.modelsByRole.edit.find((m) => m.title === data.modelTitle) ??\n        config.modelsByRole.apply.find((m) => m.title === data.modelTitle) ??\n        config.modelsByRole.chat.find((m) => m.title === data.modelTitle) ??\n        config.selectedModelByRole.chat;\n\n      if (!llm) {\n        throw new Error(\"No model selected\");\n      }\n\n      const abortManager = ApplyAbortManager.getInstance();\n      const abortController = abortManager.get(\n        data.fileUri ?? \"current-file-stream\",\n      ); // not super important since currently cancelling apply will cancel all streams it's one file at a time\n\n      return streamDiffLines(\n        data,\n        llm,\n        abortController,\n        undefined,\n        data.includeRulesInSystemMessage ? config.rules : undefined,\n      );\n    });\n\n    on(\"getDiffLines\", (msg) => {\n      return myersDiff(msg.data.oldContent, msg.data.newContent);","sourceCodeStart":739,"sourceCodeEnd":775,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/core.ts#L739-L775","documentation":"streamDiffLines resolves the model by title across edit/apply/chat roles with a fallback to the selected chat model; if none match and no chat default exists, llm is undefined and it throws 'No model selected'.","triggerScenarios":"Passing a modelTitle in the streamDiffLines payload that matches no configured model, while also having no default chat model.","commonSituations":"Stale model title from a saved session after the model was renamed/removed; config pruned; UI sends title of a deleted model.","solutions":["Re-select a valid model in the apply/edit UI so a fresh title is sent","Ensure the referenced modelTitle exists in config.modelsByRole","Set a default chat model as fallback"],"exampleFix":"// before\nsend(\"streamDiffLines\", { data: { modelTitle: \"old-model\" } });\n// after\nconst ok = config.modelsByRole.chat.some(m => m.title === title);\nsend(\"streamDiffLines\", { data: { modelTitle: ok ? title : undefined } });","handlingStrategy":"type-guard","validationCode":"const titles = new Set([...config.modelsByRole.edit, ...config.modelsByRole.apply, ...config.modelsByRole.chat].map(m => m.title));\nif (data.modelTitle && !titles.has(data.modelTitle)) delete data.modelTitle;","typeGuard":"const modelExists = (t: string, c: Config) =>\n  c.modelsByRole.edit.concat(c.modelsByRole.apply, c.modelsByRole.chat).some(m => m.title === t);","tryCatchPattern":"catch (e) { if (e.message === 'No model selected') { retryWithDefaultChatModel(data); } }","preventionTips":["Send modelTitle only from currently-configured models","Always configure a default chat model as fallback"],"tags":["config","model-resolution","diff-streaming"],"backgroundTag":"model-not-found","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}