{"record":{"id":"564b8f96597682d3","repo":"eyaltoledano/claude-task-master","slug":"provider-undetermined","errorCode":"PROVIDER_UNDETERMINED","errorMessage":"Could not determine the provider for model ID \"${modelId}\".","messagePattern":"Could not determine the provider for model ID \"(.+?)\"\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/modules/task-manager/models.js","lineNumber":710,"sourceCode":"\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: 'MODEL_NOT_FOUND_NO_HINT',\n\t\t\t\t\t\tmessage: `Model ID \"${modelId}\" not found in Taskmaster's supported models. If this is a custom model, please specify the provider using --openrouter, --ollama, --bedrock, --azure, --vertex, --lmstudio, --openai-compatible, --gemini-cli, or --codex-cli.`\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// --- End of Revised Logic --- //\n\n\t\t// At this point, we should have a determinedProvider if the model is valid (internally or custom)\n\t\tif (!determinedProvider) {\n\t\t\t// This case acts as a safeguard\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'PROVIDER_UNDETERMINED',\n\t\t\t\t\tmessage: `Could not determine the provider for model ID \"${modelId}\".`\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Update configuration\n\t\tcurrentConfig.models[role] = {\n\t\t\t...currentConfig.models[role], // Keep existing params like temperature\n\t\t\tprovider: determinedProvider,\n\t\t\tmodelId: modelId\n\t\t};\n\n\t\t// Handle baseURL for providers that support it\n\t\tif (\n\t\t\tcomputedBaseURL &&\n\t\t\t(determinedProvider === CUSTOM_PROVIDERS.OPENAI_COMPATIBLE ||\n\t\t\t\tdeterminedProvider === CUSTOM_PROVIDERS.LMSTUDIO ||\n\t\t\t\tdeterminedProvider === CUSTOM_PROVIDERS.OLLAMA ||","sourceCodeStart":692,"sourceCodeEnd":728,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/models.js#L692-L728","documentation":"A safeguard inside setModel(): after internal lookup and custom-model handling, the resolved provider was still null when the code reached the configuration-update step. This should be unreachable via normal flags and usually indicates an internal inconsistency — a model matched internally without a provider field, or a custom-hint path that failed to set the provider.","triggerScenarios":"setModel(modelId, role, root) where providerHint resolves but is later dropped/overwritten, or where an internally-known model entry has no provider property; custom flows that bypass the providerHint assignment; race/pathologies from monkey-patched or outdated config modules.","commonSituations":"Patched or forked task-master code where the internal MODEL_MAP entries lost their provider field; mixing versions where config helpers (getConfig/writeConfig) come from a different install; unusual provider aliases not covered by the hint mapping.","solutions":["Re-run the command with an explicit provider flag (--openrouter/--ollama/--bedrock/...) so determinedProvider is set directly from the hint.","Reinstall task-master to rule out a corrupted/forked models.js or mismatched internal model list.","Update to the latest version; if it persists, report the model id + role combination as a bug since this path is a defensive fallback."],"exampleFix":"// before (internal entry lacks provider — patched map)\n'my-model': { maxTokens: 128000 }\n// after\n'my-model': { maxTokens: 128000, provider: 'openai-compatible' }","handlingStrategy":"try-catch","validationCode":"// Ensure the target model resolves to a provider before calling setModel\nconst cfg = JSON.parse(fs.readFileSync('.taskmaster/config.json', 'utf8'));\nif (!cfg.models?.[role]) console.warn(`Role \"${role}\" missing from config — provider resolution may fail`);","typeGuard":null,"tryCatchPattern":"const res = await setModel(modelId, role, projectRoot, options);\nif (!res.success && res.error?.code === 'PROVIDER_UNDETERMINED') {\n  // safeguard path: retry with an explicit provider hint\n  return setModel(modelId, role, projectRoot, { providerHint: 'openrouter' });\n}","preventionTips":["Always pass an explicit provider hint rather than relying on internal inference.","Keep the stock task-master installation (no patched model maps) so every entry carries a provider.","Align all task-master package versions in monorepos to avoid mismatched config helpers.","If reproducible, report the model id + role to maintainers — this code path is a defensive fallback that should be unreachable."],"tags":["internal-error","provider","configuration"],"backgroundTag":"provider-undetermined","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}