{"record":{"id":"ec3fe30975ca3b7c","repo":"eyaltoledano/claude-task-master","slug":"invalid-provider-hint-received-providerhint","errorCode":null,"errorMessage":"Invalid provider hint received: ${providerHint}","messagePattern":"Invalid provider hint received: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/modules/task-manager/models.js","lineNumber":678,"sourceCode":"\t\t\t\t\t// Only preserve baseURL if we're already using OPENAI_COMPATIBLE\n\t\t\t\t\tconst existingBaseURL =\n\t\t\t\t\t\tcurrentProvider === CUSTOM_PROVIDERS.OPENAI_COMPATIBLE\n\t\t\t\t\t\t\t? getBaseUrlForRole(role, projectRoot)\n\t\t\t\t\t\t\t: null;\n\n\t\t\t\t\tconst resolvedBaseURL = baseURL || existingBaseURL;\n\t\t\t\t\tif (!resolvedBaseURL) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Base URL is required for OpenAI-compatible providers. Please provide a baseURL.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\twarningMessage = `Warning: Custom OpenAI-compatible model '${modelId}' set with base URL '${resolvedBaseURL}'. Taskmaster cannot guarantee compatibility. Ensure your API endpoint follows the OpenAI API specification.`;\n\t\t\t\t\treport('warn', warningMessage);\n\t\t\t\t\t// Store the computed baseURL so it gets saved in config\n\t\t\t\t\tcomputedBaseURL = resolvedBaseURL;\n\t\t\t\t} else {\n\t\t\t\t\t// Invalid provider hint - should not happen with our constants\n\t\t\t\t\tthrow new Error(`Invalid provider hint received: ${providerHint}`);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// No hint provided (flags not used)\n\t\t\tif (modelData) {\n\t\t\t\t// Found internally, use the provider from the internal list\n\t\t\t\tdeterminedProvider = modelData.provider;\n\t\t\t\treport(\n\t\t\t\t\t'info',\n\t\t\t\t\t`Model ${modelId} found internally with provider ${determinedProvider}.`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Model not found and no provider hint was given\n\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.`","sourceCodeStart":660,"sourceCodeEnd":696,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/models.js#L660-L696","documentation":"A defensive guard in setModel reached when a providerHint string was supplied but matches none of the CUSTOM_PROVIDERS constants (OPENAI_COMPATIBLE, LMSTUDIO, CODEX_CLI, GEMINI_CLI, etc.). The message claims this 'should not happen with our constants' — it fires when an unrecognized/misspelled hint is passed programmatically or a CLI flag maps to an unknown value.","triggerScenarios":"Calling setModel internally with a providerHint value that is not one of the CUSTOM_PROVIDERS constants — e.g. passing 'custom', 'openai', a typo like 'openai_compatable', or a stale constant from an older version.","commonSituations":"Plugin/script integration calling the API directly with a hand-written hint string; version mismatch where old code passes hints removed from CUSTOM_PROVIDERS; mixing up provider names ('openai-compatible' vs 'openai').","solutions":["Use only exported CUSTOM_PROVIDERS constants as hints, never raw strings","Check the spelling/exact value of the providerHint against CUSTOM_PROVIDERS (e.g. CUSTOM_PROVIDERS.OPENAI_COMPATIBLE)","Update the package if an older version is passing a hint constant that was renamed/removed","If the model is from a known provider, drop the hint and let setModel resolve the provider from its internal supported-models list"],"exampleFix":"// before\nawait setModel(projectRoot, 'main', 'my-model', { providerHint: 'openai' });\n// after\nimport { CUSTOM_PROVIDERS } from './constants.js';\nawait setModel(projectRoot, 'main', 'my-model', { providerHint: CUSTOM_PROVIDERS.OPENAI_COMPATIBLE });","handlingStrategy":"validation","validationCode":"import { CUSTOM_PROVIDERS } from './constants.js';\nfunction assertValidHint(hint) {\n  const valid = Object.values(CUSTOM_PROVIDERS);\n  if (hint != null && !valid.includes(hint)) {\n    throw new Error(`providerHint must be one of: ${valid.join(', ')}; got \"${hint}\"`);\n  }\n}","typeGuard":"const isProviderHint = (v) => v == null || Object.values(CUSTOM_PROVIDERS).includes(v);","tryCatchPattern":"try {\n  await setModel(projectRoot, role, modelId, { providerHint: hint });\n} catch (err) {\n  if (/Invalid provider hint/.test(err.message)) {\n    console.error(`Hint \"${hint}\" unknown. Use a CUSTOM_PROVIDERS constant.`);\n  } else throw err;\n}","preventionTips":["Never pass hand-written strings as provider hints; import CUSTOM_PROVIDERS","Diff hint constants against the installed package version after upgrades","Prefer omitting the hint for models in the internal supported list","Log the hint value before calling setModel in integrations"],"tags":["configuration","provider","invalid-argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}