eyaltoledano/claude-task-master · warning

Warning: Invalid research provider "${config.models.research

Error message

Warning: Invalid research provider "${config.models.research.provider}" in ${configPath}. Falling back to default.

What it means

Same validation as the main provider, applied to models.research.provider. An unrecognized research provider triggers a warning and config.models.research is reset to defaults for the session.

Source

Thrown at scripts/modules/config-manager.js:188

				console.warn(
					chalk.yellow(
						`⚠️  DEPRECATION WARNING: Found configuration in legacy location '${configPath}'. Please migrate to .taskmaster/config.json. Run 'task-master migrate' to automatically migrate your project.`
					)
				);
			}

			// --- Validation (Warn if file content is invalid) ---
			// Use log.warn for consistency
			if (!validateProvider(config.models.main.provider)) {
				console.warn(
					chalk.yellow(
						`Warning: Invalid main provider "${config.models.main.provider}" in ${configPath}. Falling back to default.`
					)
				);
				config.models.main = { ...defaults.models.main };
			}
			if (!validateProvider(config.models.research.provider)) {
				console.warn(
					chalk.yellow(
						`Warning: Invalid research provider "${config.models.research.provider}" in ${configPath}. Falling back to default.`
					)
				);
				config.models.research = { ...defaults.models.research };
			}
			if (
				config.models.fallback?.provider &&
				!validateProvider(config.models.fallback.provider)
			) {
				console.warn(
					chalk.yellow(
						`Warning: Invalid fallback provider "${config.models.fallback.provider}" in ${configPath}. Fallback model configuration will be ignored.`
					)
				);
				config.models.fallback.provider = undefined;
				config.models.fallback.modelId = undefined;
			}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Correct models.research.provider to a valid value or use `task-master models --set-research <model>`
  2. Run `task-master models` to list valid providers
  3. Delete/restore the config file to regenerate valid defaults
  4. Upgrade task-master if the provider is newly supported

Example fix

// before (.taskmaster/config.json)
"models": { "research": { "provider": "anthropic-cli", "modelId": "claude-opus-4" } }
// after
"models": { "research": { "provider": "anthropic", "modelId": "claude-opus-4" } }
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'fs';
const VALID_PROVIDERS = ['openai','anthropic','google','perplexity','ollama','openrouter','groq','zai'];
const cfg = JSON.parse(fs.readFileSync('.taskmaster/config.json','utf8'));
if (!VALID_PROVIDERS.includes(cfg.models?.research?.provider)) {
  console.warn('Invalid research provider; fix before running task-master');
}

Type guard

const isValidResearchProvider = (cfg) =>
  typeof cfg?.models?.research?.provider === 'string' && cfg.models.research.provider.length > 0;

Try / catch

try {
  const config = loadConfig();
} catch (e) {
  console.error('Config invalid, regenerating defaults:', e.message);
  resetToDefaultConfig();
}

Prevention

When it happens

Trigger: A .taskmaster/config.json where models.research.provider is misspelled, empty, or unsupported, loaded by newConfig()/_loadAndValidateConfig.

Common situations: Manual edits to the research model section; stale configs after provider renames; copy-paste from old docs.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/198b28eb3d11a362. Report an issue: GitHub.