{"record":{"id":"ddf71a07aa8f9cc2","repo":"eyaltoledano/claude-task-master","slug":"this-name-model-id-is-required","errorCode":null,"errorMessage":"${this.name} Model ID is required","messagePattern":"(.+?) Model ID is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/ai-providers/base-provider.js","lineNumber":206,"sourceCode":"\t\treturn (url, options = {}) => {\n\t\t\treturn fetch(url, {\n\t\t\t\t...options,\n\t\t\t\tdispatcher: this._proxyAgent\n\t\t\t});\n\t\t};\n\t}\n\n\t/**\n\t * Validates common parameters across all methods\n\t * @param {object} params - Parameters to validate\n\t */\n\tvalidateParams(params) {\n\t\t// Validate authentication (can be overridden by providers)\n\t\tthis.validateAuth(params);\n\n\t\t// Validate required model ID\n\t\tif (!params.modelId) {\n\t\t\tthrow new Error(`${this.name} Model ID is required`);\n\t\t}\n\n\t\t// Validate optional parameters\n\t\tthis.validateOptionalParams(params);\n\t}\n\n\t/**\n\t * Validates optional parameters like temperature and maxTokens\n\t * @param {object} params - Parameters to validate\n\t */\n\tvalidateOptionalParams(params) {\n\t\tif (\n\t\t\tparams.temperature !== undefined &&\n\t\t\t(params.temperature < 0 || params.temperature > 1)\n\t\t) {\n\t\t\tthrow new Error('Temperature must be between 0 and 1');\n\t\t}\n\t\tif (params.maxTokens !== undefined) {","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/ai-providers/base-provider.js#L188-L224","documentation":"validateParams() runs before every generation call (generateText, streamText, streamObject, generateObject) and requires params.modelId. Every provider call must name a specific model/deployment, so a missing modelId is rejected before any network request is made.","triggerScenarios":"Calling a generation method without modelId in params — e.g., direct provider use with { apiKey, messages } but no modelId, or a models config where the role's modelId field is missing.","commonSituations":"Custom scripts instantiating providers directly and omitting modelId; corrupted/incomplete .taskmasterconfig models section; migrating configs where modelId was renamed.","solutions":["Pass modelId in params (e.g., modelId: 'gpt-4o')","Ensure the active role in models config has a modelId set","Run `tm models --set-main <model>` to configure the main model"],"exampleFix":"// before\nawait provider.generateText({ apiKey, messages });\n// after\nawait provider.generateText({ apiKey, modelId: 'gpt-4o', messages });","handlingStrategy":"validation","validationCode":"if (!params?.modelId) throw new Error('modelId is required: pass params.modelId or set the model for the active role via `tm models --set-main`');","typeGuard":"function hasModelId(params) { return typeof params?.modelId === 'string' && params.modelId.trim().length > 0; }","tryCatchPattern":"try {\n  await provider.generateText(params);\n} catch (err) {\n  if (err.message.endsWith('Model ID is required')) {\n    console.error('Set modelId in params or configure the role model');\n  } else throw err;\n}","preventionTips":["Always include modelId when calling providers directly","Validate the models config section at startup","Use `tm models` to confirm the active role has a model set"],"tags":["model-id","validation","configuration","provider"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}