{"record":{"id":"fde8b916202ff0ce","repo":"continuedev/continue","slug":"model-modelname-not-found-in-assistant-configur","errorCode":null,"errorMessage":"Model ${modelName} not found in assistant configuration","messagePattern":"Model (.+?) not found in assistant configuration","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/continue-sdk/typescript/src/Assistant.ts","lineNumber":49,"sourceCode":"\n    if (!this.config.models || !firstModel) {\n      throw new Error(\"No models available in assistant configuration\");\n    }\n\n    if (!modelName) {\n      return firstModel.model;\n    }\n\n    // Look for a model matching the provided name\n    const model = this.config.models.find(\n      (m) =>\n        m?.model === modelName ||\n        m?.model.includes(modelName) ||\n        m?.model.endsWith(`/${modelName}`),\n    );\n\n    if (!model) {\n      throw new Error(\n        `Model ${modelName} not found in assistant configuration`,\n      );\n    }\n\n    return model.model;\n  }\n\n  /**\n   * Get the system message from the assistant rules\n   *\n   * @returns The concatenated rules as a single string\n   */\n  get systemMessage(): string {\n    if (!this.config.rules || !Array.isArray(this.config.rules)) {\n      return \"\";\n    }\n\n    return this.config.rules","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/continue-sdk/typescript/src/Assistant.ts#L31-L67","documentation":"Assistant.getModel(modelName) throws when no entry in config.models matches by exact model string, substring inclusion, or '/'+name suffix.","triggerScenarios":"Calling getModel('gpt-4o') when config.models contains no model whose 'model' field equals, includes, or ends with '/gpt-4o'.","commonSituations":"Typos or wrong casing in the model name, referencing a model the assistant doesn't bundle, or version drift where the assistant config renamed models.","solutions":["List assistant.config.models and use an exact 'model' value from it","Fix typos/case in the requested name","Use the bare model name without provider prefix (or vice versa) since matching is exact/substring/suffix","Call getModel() with no argument to use the first configured model"],"exampleFix":"// before\nconst m = assistant.getModel('gpt4o');\n\n// after\nconst m = assistant.getModel('gpt-4o');","handlingStrategy":"validation","validationCode":"const names = assistant.config.models.map(m => m.model); const ok = names.some(n => n === q || n.includes(q) || n.endsWith('/' + q));","typeGuard":"function modelExists(models: { model: string }[], name: string): boolean { return models.some(m => m.model === name || m.model.includes(name) || m.model.endsWith(`/${name}`)); }","tryCatchPattern":"try { return assistant.getModel(name); } catch (e) { if (/not found/.test(e.message)) throw new Error(`Available: ${assistant.config.models.map(m=>m.model).join(', ')}`); throw e; }","preventionTips":["Source model names from assistant.config.models","Avoid hand-typed model strings","Handle empty-name case with getModel() for the default"],"tags":["continue-sdk","assistant","models","lookup"],"backgroundTag":"model-not-found","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}