eyaltoledano/claude-task-master · warning
Warning: Invalid Codex CLI settings in config: ${error.messa
Error message
Warning: Invalid Codex CLI settings in config: ${error.message}. Falling back to default. What it means
ConfigManager.validateCodexCliSettings validates the codexCli settings section with a dedicated SettingsSchema (Zod) and, on failure, warns with the Zod message and returns {} so defaults are used. Configuration errors never propagate as exceptions.
Source
Thrown at scripts/modules/config-manager.js:463
.optional()
});
const CommandSpecificSchema = z
.record(z.string(), BaseSettingsSchema)
.refine(
(obj) =>
Object.keys(obj || {}).every((k) => AI_COMMAND_NAMES.includes(k)),
{ message: 'Invalid command name in commandSpecific' }
);
const SettingsSchema = BaseSettingsSchema.extend({
commandSpecific: CommandSpecificSchema.optional()
});
try {
return SettingsSchema.parse(settings);
} catch (error) {
console.warn(
chalk.yellow(
`Warning: Invalid Codex CLI settings in config: ${error.message}. Falling back to default.`
)
);
return {};
}
}
// --- Claude Code Settings Getters ---
function getClaudeCodeSettings(explicitRoot = null, forceReload = false) {
const config = getConfig(explicitRoot, forceReload);
// Ensure Claude Code defaults are applied if Claude Code section is missing
return { ...DEFAULTS.claudeCode, ...(config?.claudeCode || {}) };
}
// --- Codex CLI Settings Getters ---
View on GitHub (pinned to c0c98d367c)
Solutions
- Fix the field named in the Zod error message inside the codex settings block
- Remove the codexCli section to fall back to defaults, then re-add carefully
- Check the installed version's CommandSpecificSchema/SettingsSchema for expected shapes
Example fix
// before
"codex": { "timeout": "fast" }
// after
"codex": { "timeout": 30000 } Defensive patterns
Strategy: validation
Validate before calling
const parsed = CodexSettingsSchema.safeParse(config.codexCli ?? config.codex);
if (!parsed.success) {
console.error('Invalid codex settings:', parsed.error.issues.map(i => `${i.path.join('.')}: ${i.message}`));
} Type guard
function codexSettingsAreValid(settings) {
return typeof settings === 'object' && settings !== null && CodexSettingsSchema.safeParse(settings).success;
} Try / catch
const config = configManager._loadAndValidateConfig();
const codex = config.codexCli ?? {};
if (Object.keys(codex).length === 0) {
console.warn('codex settings failed validation and defaults were applied');
} Prevention
- Match numeric/time fields to the schema's expected types (numbers, not strings)
- Diff your codex config block against the version's schema after upgrades
- Start from an empty codex section and add keys one at a time
- Lint .taskmasterconfig JSON before committing
When it happens
Trigger: Calling _loadAndValidateConfig when the codex-specific settings in .taskmasterconfig fail Zod validation — wrong value types, unexpected structure in global/commandSpecific blocks.
Common situations: Hand-edited codex config blocks; version drift where the Codex schema changed; copy-pasted config from another tool's format.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Warning: Invalid Claude Code settings in config: ${error.mes
- projectRoot is required in args to resolve project paths
- CONFIG_ERROR
- MISSING_CONFIGURATION
- CONFIG_ERROR
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/cefb57668f03903d.
Report an issue: GitHub.