eyaltoledano/claude-task-master · warning
Warning: Invalid fallback provider "${config.models.fallback
Error message
Warning: Invalid fallback provider "${config.models.fallback.provider}" in ${configPath}. Fallback model configuration will be ignored. What it means
Task Master validates model providers in the user's .taskmaster/config.json during config load. If models.fallback.provider names a provider unknown to validateProvider (not one of the supported AI providers), the entire fallback model configuration is discarded with this warning and defaults are used instead of the invalid entry. It is a non-fatal warning; the CLI keeps running without a fallback model.
Source
Thrown at scripts/modules/config-manager.js:199
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;
}
if (config.claudeCode && !isEmpty(config.claudeCode)) {
config.claudeCode = validateClaudeCodeSettings(config.claudeCode);
}
if (config.codexCli && !isEmpty(config.codexCli)) {
config.codexCli = validateCodexCliSettings(config.codexCli);
}
} catch (error) {
// Use console.error for actual errors during parsing
console.error(
chalk.red(
`Error reading or parsing ${configPath}: ${error.message}. Using default configuration.`View on GitHub (pinned to c0c98d367c)
Solutions
- Run 'task-master models --setup' to pick the fallback provider/model from the validated list.
- Open .taskmaster/config.json and correct models.fallback.provider to a supported value (e.g. 'anthropic', 'openai', 'google', 'openrouter', 'perplexity', 'xai', 'ollama', 'bedrock', 'azure').
- If no fallback is wanted, remove the models.fallback.provider/modelId fields so validation is skipped entirely.
Example fix
// before (.taskmaster/config.json)
"fallback": { "provider": "anthropicc", "modelId": "claude-sonnet-4" }
// after
"fallback": { "provider": "anthropic", "modelId": "claude-sonnet-4-20250514" } Defensive patterns
Strategy: validation
Validate before calling
const { validateProvider } = require('./scripts/modules/config-manager.js');
const cfg = JSON.parse(fs.readFileSync('.taskmaster/config.json', 'utf8'));
const p = cfg?.models?.fallback?.provider;
if (p && !validateProvider(p)) {
console.warn(`Fix fallback provider "${p}" before running task-master`);
} Type guard
function isValidProvider(p) {
return typeof p === 'string' && ['anthropic','openai','google','openrouter','perplexity','xai','ollama','bedrock','azure'].includes(p);
} Prevention
- Always change providers via 'task-master models --setup' instead of hand-editing config.json.
- Keep .taskmaster/config.json in version control to spot unintended edits.
- After editing config, run a cheap command (e.g. task-master models) to validate early.
When it happens
Trigger: Running any task-master command after _loadAndValidateConfig (via newConfig) reads a config whose models.fallback.provider is a non-empty string that fails validateProvider (e.g. a typo like 'anthropicc' or a manually hand-edited config).
Common situations: Hand-editing .taskmaster/config.json and misspelling a provider name; copying a config from an older version that supported a provider since removed; renaming providers (e.g. 'openrouter' vs 'azure') without running 'task-master models --setup'.
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
- ${this.name} Model ID is required
- Invalid value for ${mapping.env}: ${value}
- Warning: Invalid main provider "${config.models.main.provide
- Warning: Invalid research provider "${config.models.research
- Invalid subtask count determined (${finalSubtaskCount}), def
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/6ab398d0c73bef11.
Report an issue: GitHub.