eyaltoledano/claude-task-master · error
ANALYZE_CORE_ERROR
ANALYZE_CORE_ERROR
Error message
Error running core complexity analysis: ${error.message} What it means
When the underlying core complexity analysis (the function this direct wrapper delegates to) throws — e.g. AI provider failure, malformed tasks.json, model/API errors — the wrapper catches it and re-raises as a structured ANALYZE_CORE_ERROR wrapping the original error message.
Source
Thrown at mcp-server/src/core/direct-functions/analyze-task-complexity.js:134
mcpLog: logWrapper,
commandName: 'analyze-complexity',
outputType: 'mcp',
projectRoot,
tag
});
report = coreResult.report;
} catch (error) {
log.error(
`Error in analyzeTaskComplexity core function: ${error.message}`
);
// Restore logging if we changed it
if (!wasSilent && isSilentMode()) {
disableSilentMode();
}
return {
success: false,
error: {
code: 'ANALYZE_CORE_ERROR',
message: `Error running core complexity analysis: ${error.message}`
}
};
} finally {
// Always restore normal logging in finally block if we enabled silent mode
if (!wasSilent && isSilentMode()) {
disableSilentMode();
}
}
// --- Result Handling (remains largely the same) ---
// Verify the report file was created (core function writes it)
if (!fs.existsSync(resolvedOutputPath)) {
return {
success: false,
error: {
code: 'ANALYZE_REPORT_MISSING', // Specific code
message:View on GitHub (pinned to c0c98d367c)
Solutions
- Read the embedded error.message in the response to identify the root cause
- Validate tasks.json parses as JSON and tasks are well-formed before analyzing
- Check AI provider credentials (API key env vars) and network/provider status, then retry
Example fix
// before // tasks.json hand-edited, trailing comma // after JSON.parse(fs.readFileSync(tasksJsonPath)); // fix syntax errors, then re-run analysis
Defensive patterns
Strategy: try-catch
Validate before calling
try {
JSON.parse(fs.readFileSync(args.tasksJsonPath, 'utf8'));
} catch (e) {
throw new Error(`tasks.json invalid before analysis: ${e.message}`);
}
if (!process.env.ANTHROPIC_API_KEY && !process.env.OPENAI_API_KEY) {
throw new Error('No AI provider API key configured');
} Type guard
function isCoreError(res) {
return typeof res === 'object' && res !== null && res.success === false && res.error?.code === 'ANALYZE_CORE_ERROR';
} Try / catch
const res = await analyzeTaskComplexityDirect(args);
if (isCoreError(res)) {
console.error('Root cause:', res.error.message); // e.g. API key / JSON parse issue
// fix credentials or tasks.json, then retry with backoff
} Prevention
- Validate tasks.json syntax before analysis
- Keep AI provider API keys set and rotated
- Rate-limit and retry LLM-dependent analysis with exponential backoff
- Pin task-master versions so core/direct function contracts match
When it happens
Trigger: Any exception thrown by the core analyzeTaskComplexity call: invalid tasks.json content, AI service/API failure, missing API key, or an unexpected internal error.
Common situations: Expired or missing AI provider API keys; corrupted or hand-edited tasks.json; rate limits from the LLM provider; network outage during analysis.
Related errors
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/76ec1c4d8cc4abd3.
Report an issue: GitHub.