From 0b2c6967c4605c33a100cff16f6ce8ff09ad06f0 Mon Sep 17 00:00:00 2001 From: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:04:38 +0200 Subject: [PATCH] fix: improve subtask & parent task management (#1251) --- .changeset/curvy-weeks-flow.md | 5 +++++ packages/tm-core/src/storage/file-storage/file-storage.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/curvy-weeks-flow.md diff --git a/.changeset/curvy-weeks-flow.md b/.changeset/curvy-weeks-flow.md new file mode 100644 index 00000000..028194c7 --- /dev/null +++ b/.changeset/curvy-weeks-flow.md @@ -0,0 +1,5 @@ +--- +"task-master-ai": patch +--- + +Change parent task back to "pending" when all subtasks are in "pending" state diff --git a/packages/tm-core/src/storage/file-storage/file-storage.ts b/packages/tm-core/src/storage/file-storage/file-storage.ts index a0486e41..858543d1 100644 --- a/packages/tm-core/src/storage/file-storage/file-storage.ts +++ b/packages/tm-core/src/storage/file-storage/file-storage.ts @@ -409,8 +409,11 @@ export class FileStorage implements IStorage { const allDone = subs.every(isDoneLike); const anyInProgress = subs.some((s) => norm(s) === 'in-progress'); const anyDone = subs.some(isDoneLike); + const allPending = subs.every((s) => norm(s) === 'pending'); + if (allDone) parentNewStatus = 'done'; else if (anyInProgress || anyDone) parentNewStatus = 'in-progress'; + else if (allPending) parentNewStatus = 'pending'; } // Always bump updatedAt; update status only if changed