{"record":{"id":"4be40eb8555c64eb","repo":"eyaltoledano/claude-task-master","slug":"could-not-determine-complete-execution-order-for-t","errorCode":null,"errorMessage":"Could not determine complete execution order for task ${task.id}","messagePattern":"Could not determine complete execution order for task (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/tm-core/src/modules/tasks/services/task-loader.service.ts","lineNumber":360,"sourceCode":"\t\t\t\t}\n\n\t\t\t\t// Check if all dependencies are completed\n\t\t\t\tconst allDepsCompleted =\n\t\t\t\t\t!subtask.dependencies ||\n\t\t\t\t\tsubtask.dependencies.length === 0 ||\n\t\t\t\t\tsubtask.dependencies.every((depId) => completed.has(String(depId)));\n\n\t\t\t\tif (allDepsCompleted) {\n\t\t\t\t\tordered.push(subtask);\n\t\t\t\t\tcompleted.add(subtaskId);\n\t\t\t\t\tadded = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Safety check to prevent infinite loop\n\t\t\tif (!added && ordered.length < task.subtasks.length) {\n\t\t\t\tlogger.warn(\n\t\t\t\t\t`Could not determine complete execution order for task ${task.id}`\n\t\t\t\t);\n\t\t\t\t// Add remaining subtasks in original order\n\t\t\t\tfor (const subtask of task.subtasks) {\n\t\t\t\t\tif (!completed.has(String(subtask.id))) {\n\t\t\t\t\t\tordered.push(subtask);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn ordered;\n\t}\n\n\t/**\n\t * Clean up resources\n\t */","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/tasks/services/task-loader.service.ts#L342-L378","documentation":"task-loader.service.ts getExecutionOrder() topologically orders subtasks by their dependencies. If a full pass adds no new subtask while some remain unadded, it logs this warning and falls back to appending the remaining subtasks in their original file order to avoid an infinite loop.","triggerScenarios":"getExecutionOrder() on a task whose subtasks have circular dependencies (e.g. subtask 1.2 depends on 1.3 and 1.3 depends on 1.2) or dependencies referencing nonexistent subtask IDs, so no valid ordering exists.","commonSituations":"Hand-edited tasks.json introducing a dependency cycle, imports/merges that created dangling dependency IDs, or a rename of subtask IDs without updating dependencies.","solutions":["Fix the dependency cycles among the task's subtasks in tasks.json (break the loop)","Remove or correct dependencies that point to subtask IDs that don't exist","Re-derive dependencies (or accept the fallback original-order execution) if ordering is not strict","Add validation of the dependency graph when creating/editing subtasks to prevent cycles"],"exampleFix":"// before\n// subtask 2: dependencies [3]; subtask 3: dependencies [2]\n// after\n// subtask 2: dependencies []; subtask 3: dependencies [2]","handlingStrategy":"validation","validationCode":"function hasCircularDeps(task: Task): boolean {\n  const ids = new Set(task.subtasks.map(s => String(s.id)));\n  const state: Record<string, 0|1|2> = {};\n  const visit = (id: string): boolean => {\n    if (state[id] === 1) return true;\n    if (state[id] === 2) return false;\n    state[id] = 1;\n    const st = task.subtasks.find(s => String(s.id) === id);\n    for (const d of st?.dependencies ?? []) if (ids.has(String(d)) && visit(String(d))) return true;\n    state[id] = 2; return false;\n  };\n  return task.subtasks.some(s => visit(String(s.id)));\n}\nif (hasCircularDeps(task)) throw new Error(`Task ${task.id}: circular subtask dependencies`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the subtask dependency graph after any manual tasks.json edit","Use dependency validation on import/merge of task data","Avoid renaming subtask IDs without updating dependencies","Keep dependencies pointing forward (lower ID depends on higher, or DAG by design)"],"tags":["tasks","dependencies","topological-sort"],"backgroundTag":"circular-dependency-detected","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}