{"record":{"id":"1a7d16899fbe952b","repo":"eyaltoledano/claude-task-master","slug":"task-task-id-has-unexpected-status-task-stat","errorCode":null,"errorMessage":"Task ${task.id} has unexpected status \"${task.status}\". Valid statuses are: ${TASK_STATUSES.join(', ')}","messagePattern":"Task (.+?) has unexpected status \"(.+?)\"\\. Valid statuses are: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/tm-core/src/modules/tasks/utils/task-filters.ts","lineNumber":130,"sourceCode":" *   { id: '1', status: 'done', dependencies: [], blocks: ['2'] },\n *   { id: '2', status: 'pending', dependencies: ['1'], blocks: [] },\n *   { id: '3', status: 'pending', dependencies: ['2'], blocks: [] }\n * ];\n * const readyTasks = filterReadyTasks(tasks);\n * // Returns only task 2: status is actionable and dependency '1' is done\n * // Task 3 is not ready because dependency '2' is still pending\n * ```\n */\nexport function filterReadyTasks(tasks: TaskWithBlocks[]): TaskWithBlocks[] {\n\t// Build set of completed task IDs for dependency checking\n\tconst completedIds = new Set<string>(\n\t\ttasks.filter((t) => isTaskComplete(t.status)).map((t) => String(t.id))\n\t);\n\n\treturn tasks.filter((task) => {\n\t\t// Validate status is a known value\n\t\tif (!TASK_STATUSES.includes(task.status)) {\n\t\t\tlogger.warn(\n\t\t\t\t`Task ${task.id} has unexpected status \"${task.status}\". Valid statuses are: ${TASK_STATUSES.join(', ')}`\n\t\t\t);\n\t\t}\n\n\t\t// Must be in an actionable status (excludes deferred, blocked, done, cancelled)\n\t\tif (!ACTIONABLE_STATUSES.includes(task.status)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Ready if no dependencies or all dependencies are completed\n\t\tconst deps = task.dependencies ?? [];\n\t\treturn deps.every((depId) => completedIds.has(String(depId)));\n\t});\n}\n\n/**\n * Filter to only tasks that block other tasks\n * These are tasks that have at least one other task depending on them","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/tasks/utils/task-filters.ts#L112-L148","documentation":"task-filters.ts filterReadyTasks() validates each task's status against the known TASK_STATUSES list. An unknown status logs this warning (the task isn't rejected for it) and then the status is checked against ACTIONABLE_STATUSES as usual, so unknown statuses typically get filtered out as non-actionable.","triggerScenarios":"filterReadyTasks() (reached via getTasks/readyTasks/tasksToAdd) encounters a task whose status string isn't one of TASK_STATUSES — e.g. legacy statuses like 'review' or 'pending' from older data files, or hand-edited tasks.json.","commonSituations":"tasks.json created by an older Task Master version before a status rename/migration, manual edits introducing typos ('in-progres'), data merged from other tools with different status vocabularies.","solutions":["Update the task's status in tasks.json to a valid value (pending, in-progress, done, deferred, cancelled, blocked, etc. per TASK_STATUSES)","Re-run the version's status migration if the file came from an older release","Fix typos in manually edited status fields","Extend TASK_STATUSES only if you genuinely maintain custom statuses upstream"],"exampleFix":"// before\n\"status\": \"in review\"\n// after\n\"status\": \"pending\"","handlingStrategy":"type-guard","validationCode":"import { TASK_STATUSES } from './task-failsafe.js';\nconst bad = tasks.filter(t => !TASK_STATUSES.includes(t.status));\nif (bad.length) console.warn('Tasks with unknown status:', bad.map(t => `${t.id}=${t.status}`));","typeGuard":"function hasKnownStatus(t: Task): boolean {\n  return (TASK_STATUSES as readonly string[]).includes(t.status);\n}","tryCatchPattern":null,"preventionTips":["Only set statuses from the documented TASK_STATUSES enum","Run the status migration when upgrading versions","Schema-validate tasks.json (status enum) in CI","Avoid free-text statuses in manual edits and external imports"],"tags":["tasks","status","validation","data-migration"],"backgroundTag":"invalid-enum-status-value","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}