fix: implement subtask status update functionality#1248
fix: implement subtask status update functionality#1248Crunchyman-ralph merged 8 commits intomainfrom
Conversation
- Add updateSubtaskStatus method in TaskService to handle subtask IDs like '21.1' - Parse parent task ID and subtask ID from dotted notation - Find and update specific subtask within parent task structure - Save updated parent task back to storage (works with both file and API storage) - Fix regression introduced in v0.27.0 where subtask updates were blocked - Resolves issue #1247 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 9b44d6a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughTaskService.updateTaskStatus now delegates all task and subtask status updates to storage.updateTaskStatus. The storage interface adds UpdateStatusResult and updateTaskStatus; ApiStorage and FileStorage implement it (FileStorage handles subtask/parent propagation). TaskService maps storage failures to STORAGE_ERROR with contextual details. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant TaskService
participant Storage
rect rgba(46,125,50,0.06)
Caller->>TaskService: updateTaskStatus(taskId, newStatus, tag?)
TaskService->>Storage: updateTaskStatus(taskId, newStatus, tag?)
alt storage succeeds
Storage->>Storage: load/validate/update (parse subtask id if needed)
Storage-->>TaskService: UpdateStatusResult{success, oldStatus, newStatus, taskId}
TaskService-->>Caller: return result
else storage error
Storage-->>TaskService: error
TaskService-->>Caller: throw STORAGE_ERROR (operation/resource/taskId/newStatus/tag)
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/tm-core/src/services/task-service.ts (1)
479-512: Regular task update: add updatedAt, early-return if no change, and catch write errorsThis prevents unnecessary writes, records audit time, and surfaces storage failures.
Apply this diff:
- const oldStatus = currentTask.status; - - // Simple, direct update - just change the status - await this.storage.updateTask(taskIdStr, { status: newStatus }, activeTag); + const oldStatus = currentTask.status; + if (oldStatus === newStatus) { + return { success: true, oldStatus, newStatus, taskId: taskIdStr }; + } + const now = new Date().toISOString(); + try { + await this.storage.updateTask( + taskIdStr, + { status: newStatus, updatedAt: now }, + activeTag + ); + } catch (error) { + throw new TaskMasterError( + `Failed to update task ${taskIdStr}`, + ERROR_CODES.STORAGE_ERROR, + { taskId: taskIdStr, oldStatus, newStatus, tag: activeTag }, + error as Error + ); + }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
packages/tm-core/src/services/task-service.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.claude/commands/taskmaster-complete.md : Create .claude/commands/taskmaster-complete.md with steps to review task, verify, run tests, set status done, and show next task
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Document testing setup and progress in TaskMaster subtasks using task-master update-subtask commands
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dev_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:12.881Z
Learning: Log detailed implementation plans and progress for each subtask using `update_subtask`, including file paths, line numbers, diffs, reasoning, and challenges.
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Allow filtering tasks by status within the current tag context, handle subtask display in lists, and use consistent table formats.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use AI to generate detailed subtasks within the current tag context, considering complexity analysis for subtask counts and ensuring proper IDs for newly created subtasks.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Document testing setup and progress in TaskMaster subtasks using task-master update-subtask commands
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tagged task system aware functions for task finding and manipulation, handle both task and subtask operations, and validate task IDs before operations.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent formatting for task files, include all task properties in text files, and format dependencies with status indicators.
Applied to files:
packages/tm-core/src/services/task-service.ts
🧬 Code graph analysis (1)
packages/tm-core/src/services/task-service.ts (3)
packages/tm-core/src/types/index.ts (2)
TaskStatus(20-28)Task(57-76)packages/tm-core/src/errors/index.ts (2)
TaskMasterError(8-8)ERROR_CODES(9-9)packages/tm-core/src/errors/task-master-error.ts (2)
TaskMasterError(129-328)ERROR_CODES(9-55)
🪛 GitHub Actions: CI
packages/tm-core/src/services/task-service.ts
[error] 577-581: Formatter would have reformatted code. biome format detected formatting issues in the file; run 'npm run format-check' / 'biome format .' to fix.
🔇 Additional comments (2)
packages/tm-core/src/services/task-service.ts (2)
474-477: Subtask ID detection path: LGTMDelegating dotted IDs to a dedicated handler is the right split.
581-592: Optimize subtask update in TaskService.updateSubtask
- Return early when
oldStatus === newStatus- Patch parent via
storage.updateTask(parentId, { subtasks: parentTask.subtasks, updatedAt: now }, activeTag)inside a try/catch that throws a TaskMasterError on failure- Verify all IStorage implementations correctly support partial updates of nested subtasks and parent.updatedAt
There was a problem hiding this comment.
Actionable comments posted: 7
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
packages/tm-core/src/interfaces/storage.interface.ts(3 hunks)packages/tm-core/src/services/task-service.ts(2 hunks)packages/tm-core/src/storage/api-storage.ts(2 hunks)packages/tm-core/src/storage/file-storage/file-storage.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.claude/commands/taskmaster-complete.md : Create .claude/commands/taskmaster-complete.md with steps to review task, verify, run tests, set status done, and show next task
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Document testing setup and progress in TaskMaster subtasks using task-master update-subtask commands
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Applied to files:
packages/tm-core/src/interfaces/storage.interface.tspackages/tm-core/src/storage/file-storage/file-storage.tspackages/tm-core/src/storage/api-storage.tspackages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Allow filtering tasks by status within the current tag context, handle subtask display in lists, and use consistent table formats.
Applied to files:
packages/tm-core/src/interfaces/storage.interface.tspackages/tm-core/src/storage/file-storage/file-storage.tspackages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Tasks must be accessed and updated through the tag resolution layer using getTasksForTag(data, tagName) and setTasksForTag(data, tagName, tasks); direct manipulation of the tagged structure in core functions is not allowed.
Applied to files:
packages/tm-core/src/interfaces/storage.interface.tspackages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent formatting for task files, include all task properties in text files, and format dependencies with status indicators.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.tspackages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Subtasks must use consistent properties, maintain simple numeric IDs unique within the parent task, and must not duplicate parent task properties.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Use string IDs with dot notation (e.g., "1.2") for subtask references
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Use numeric IDs for direct task references
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use AI to generate detailed subtasks within the current tag context, considering complexity analysis for subtask counts and ensuring proper IDs for newly created subtasks.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection
Applied to files:
packages/tm-core/src/services/task-service.ts
🧬 Code graph analysis (4)
packages/tm-core/src/interfaces/storage.interface.ts (1)
packages/tm-core/src/types/index.ts (1)
TaskStatus(20-28)
packages/tm-core/src/storage/file-storage/file-storage.ts (1)
packages/tm-core/src/types/index.ts (2)
TaskStatus(20-28)Task(57-76)
packages/tm-core/src/storage/api-storage.ts (3)
packages/tm-core/src/types/index.ts (1)
TaskStatus(20-28)packages/tm-core/src/errors/index.ts (2)
TaskMasterError(8-8)ERROR_CODES(9-9)packages/tm-core/src/errors/task-master-error.ts (2)
TaskMasterError(129-328)ERROR_CODES(9-55)
packages/tm-core/src/services/task-service.ts (2)
packages/tm-core/src/errors/index.ts (2)
TaskMasterError(8-8)ERROR_CODES(9-9)packages/tm-core/src/errors/task-master-error.ts (2)
TaskMasterError(129-328)ERROR_CODES(9-55)
🪛 GitHub Actions: CI
packages/tm-core/src/storage/api-storage.ts
[error] 10-15: Biome format check failed: formatting would require multi-line import. Expected to format as: import type { Task, TaskMetadata, TaskTag, TaskStatus } from '../types/index.js';
🔇 Additional comments (4)
packages/tm-core/src/services/task-service.ts (1)
449-449: Docstring update aligns with storage delegation.Accurately reflects the new behavior.
packages/tm-core/src/storage/file-storage/file-storage.ts (2)
5-5: Type import looks correct.Importing TaskStatus is needed for the new API.
391-400: Confirm and normalize ‘completed’ to ‘done’
I couldn’t find any ‘completed’ values in TaskStatus—please verify whether ‘completed’ is a valid status and, if so, normalize it to ‘done’ in the parent‐status logic.packages/tm-core/src/interfaces/storage.interface.ts (1)
6-6: Adding TaskStatus to public imports is appropriate.
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
.changeset/spotty-moments-trade.md(1 hunks)packages/tm-core/src/interfaces/storage.interface.ts(3 hunks)packages/tm-core/src/services/task-service.ts(2 hunks)packages/tm-core/src/storage/api-storage.ts(2 hunks)packages/tm-core/src/storage/file-storage/file-storage.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
.changeset/*.md
📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)
.changeset/*.md: When runningnpm run changesetornpx changeset add, provide a concise summary of the changes for theCHANGELOG.mdin imperative mood, typically a single line, and not a detailed Git commit message.
The changeset summary should be user-facing, describing what changed in the released version that is relevant to users or consumers of the package.
Do not use your detailed Git commit message body as the changeset summary.
Files:
.changeset/spotty-moments-trade.md
.changeset/*
📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)
Create appropriate changesets for new features, use semantic versioning, include tagged system information in release notes, and document breaking changes if any.
Files:
.changeset/spotty-moments-trade.md
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.claude/commands/taskmaster-complete.md : Create .claude/commands/taskmaster-complete.md with steps to review task, verify, run tests, set status done, and show next task
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Document testing setup and progress in TaskMaster subtasks using task-master update-subtask commands
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Applied to files:
packages/tm-core/src/services/task-service.ts.changeset/spotty-moments-trade.mdpackages/tm-core/src/interfaces/storage.interface.tspackages/tm-core/src/storage/file-storage/file-storage.tspackages/tm-core/src/storage/api-storage.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent
Applied to files:
packages/tm-core/src/services/task-service.tspackages/tm-core/src/storage/file-storage/file-storage.tspackages/tm-core/src/storage/api-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Subtasks must use consistent properties, maintain simple numeric IDs unique within the parent task, and must not duplicate parent task properties.
Applied to files:
packages/tm-core/src/services/task-service.tspackages/tm-core/src/storage/file-storage/file-storage.tspackages/tm-core/src/storage/api-storage.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Use string IDs with dot notation (e.g., "1.2") for subtask references
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Use numeric IDs for direct task references
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use AI to generate detailed subtasks within the current tag context, considering complexity analysis for subtask counts and ensuring proper IDs for newly created subtasks.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent formatting for task files, include all task properties in text files, and format dependencies with status indicators.
Applied to files:
packages/tm-core/src/services/task-service.tspackages/tm-core/src/interfaces/storage.interface.tspackages/tm-core/src/storage/file-storage/file-storage.tspackages/tm-core/src/storage/api-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Allow filtering tasks by status within the current tag context, handle subtask display in lists, and use consistent table formats.
Applied to files:
packages/tm-core/src/services/task-service.ts.changeset/spotty-moments-trade.mdpackages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Tasks must be accessed and updated through the tag resolution layer using getTasksForTag(data, tagName) and setTasksForTag(data, tagName, tasks); direct manipulation of the tagged structure in core functions is not allowed.
Applied to files:
packages/tm-core/src/services/task-service.ts
📚 Learning: 2025-09-24T15:12:12.658Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-09-24T15:12:12.658Z
Learning: Use standardized task statuses: pending, done, deferred (custom values allowed) and set via task-master set-status
Applied to files:
.changeset/spotty-moments-trade.md
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Verify modifications on the in-memory task objects passed to writeJSON.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Caching should generally be applied to read-only operations that don't modify the tasks.json state. Commands like set-status, add-task, update-task, parse-prd, add-dependency should not be cached.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tagged task system aware functions for task finding and manipulation, handle both task and subtask operations, and validate task IDs before operations.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-09-25T22:08:11.063Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1248
File: packages/tm-core/src/storage/api-storage.ts:509-0
Timestamp: 2025-09-25T22:08:11.063Z
Learning: In API storage backend, subtasks have unique IDs (like "HAM-21") and use a separate parent_id column to establish parent-child relationships, rather than using dotted notation like file storage (e.g., "21.1").
Applied to files:
packages/tm-core/src/storage/api-storage.ts
📚 Learning: 2025-08-03T12:13:33.875Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Document testing setup and progress in TaskMaster subtasks using task-master update-subtask commands
Applied to files:
packages/tm-core/src/storage/api-storage.ts
📚 Learning: 2025-09-24T15:12:58.855Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.claude/commands/taskmaster-complete.md : Create .claude/commands/taskmaster-complete.md with steps to review task, verify, run tests, set status done, and show next task
Applied to files:
packages/tm-core/src/storage/api-storage.ts
📚 Learning: 2025-08-11T12:30:23.843Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-11T12:30:23.843Z
Learning: Import Task Master's development workflow commands and guidelines; treat the contents of ./.taskmaster/CLAUDE.md as if included in the main CLAUDE.md
Applied to files:
packages/tm-core/src/storage/api-storage.ts
🧬 Code graph analysis (4)
packages/tm-core/src/services/task-service.ts (2)
packages/tm-core/src/errors/index.ts (2)
TaskMasterError(8-8)ERROR_CODES(9-9)packages/tm-core/src/errors/task-master-error.ts (2)
TaskMasterError(129-328)ERROR_CODES(9-55)
packages/tm-core/src/interfaces/storage.interface.ts (1)
packages/tm-core/src/types/index.ts (1)
TaskStatus(20-28)
packages/tm-core/src/storage/file-storage/file-storage.ts (2)
packages/tm-core/src/types/index.ts (2)
TaskStatus(20-28)Task(57-76)packages/tm-core/src/interfaces/storage.interface.ts (1)
UpdateStatusResult(11-16)
packages/tm-core/src/storage/api-storage.ts (4)
packages/tm-core/src/types/index.ts (1)
TaskStatus(20-28)packages/tm-core/src/interfaces/storage.interface.ts (1)
UpdateStatusResult(11-16)packages/tm-core/src/errors/index.ts (2)
TaskMasterError(8-8)ERROR_CODES(9-9)packages/tm-core/src/errors/task-master-error.ts (2)
TaskMasterError(129-328)ERROR_CODES(9-55)
🪛 markdownlint-cli2 (0.18.1)
.changeset/spotty-moments-trade.md
5-5: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
🔇 Additional comments (9)
packages/tm-core/src/services/task-service.ts (2)
473-479: LGTM: delegate to storage with correct argsDelegation and tag resolution are correct.
482-490: LGTM: enriched error contextIncludes operation/resource/taskId/newStatus/tag; consistent with error handling elsewhere.
packages/tm-core/src/storage/api-storage.ts (2)
494-501: LGTM: new API method signature and typesMethod shape aligns with IStorage and UpdateStatusResult.
505-512: Handle dotted subtask IDs in API storage’s updateTaskStatus
In packages/tm-core/src/storage/api-storage.ts updateTaskStatus, splittaskIdon.; when dotted, fetch the parent task via the first segment, locate the subtask record by itsparent_idand real subtask ID, then callrepository.updateTaskwith that subtask’s true ID. Otherwise passing “21.1” will always throw.packages/tm-core/src/interfaces/storage.interface.ts (3)
11-16: LGTM: shared UpdateStatusResult typeCentralizing the return type improves consistency across implementations.
74-79: LGTM: IStorage.updateTaskStatus uses shared result typeSignature aligns with interface docs and usage.
217-221: Approve change; verify updateTaskStatus return shape
Automated checks didn’t confirm that ApiStorage and FileStorage return a full UpdateStatusResult (success, oldStatus, newStatus, taskId); please verify manually.packages/tm-core/src/storage/file-storage/file-storage.ts (2)
295-315: LGTM: task-level status update with early-returnHandles not-found, no-op short-circuit, updatedAt, and persistence correctly.
371-373: LGTM: robust subtask ID comparisonHandles numeric and string subtask IDs to avoid false “not found”.
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
packages/tm-core/src/storage/file-storage/file-storage.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.claude/commands/taskmaster-complete.md : Create .claude/commands/taskmaster-complete.md with steps to review task, verify, run tests, set status done, and show next task
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Document testing setup and progress in TaskMaster subtasks using task-master update-subtask commands
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent formatting for task files, include all task properties in text files, and format dependencies with status indicators.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Verify modifications on the in-memory task objects passed to writeJSON.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Caching should generally be applied to read-only operations that don't modify the tasks.json state. Commands like set-status, add-task, update-task, parse-prd, add-dependency should not be cached.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Subtasks must use consistent properties, maintain simple numeric IDs unique within the parent task, and must not duplicate parent task properties.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Allow filtering tasks by status within the current tag context, handle subtask display in lists, and use consistent table formats.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: When removing tasks or subtasks, use the remove-task or remove-subtask commands with caution, as this operation cannot be undone. Consider using 'blocked', 'cancelled', or 'deferred' status instead if you want to keep the task for reference.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tagged task system aware functions for task finding and manipulation, handle both task and subtask operations, and validate task IDs before operations.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
🧬 Code graph analysis (1)
packages/tm-core/src/storage/file-storage/file-storage.ts (2)
packages/tm-core/src/types/index.ts (2)
TaskStatus(20-28)Task(57-76)packages/tm-core/src/interfaces/storage.interface.ts (1)
UpdateStatusResult(11-16)
🔇 Additional comments (3)
packages/tm-core/src/storage/file-storage/file-storage.ts (3)
5-10: LGTM: imports updated for TaskStatus/UpdateStatusResult.Types align with the new updateTaskStatus API.
333-349: LGTM: subtask-id parsing gate.Format check and error messages are clear.
285-331: CLI enforces valid statuses before storage call –set-statusrejects any status not inVALID_TASK_STATUSES, andTaskService.updateTaskStatus(newStatus: TaskStatus)then delegates directly to storage. No further action needed.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
packages/tm-core/src/storage/file-storage/file-storage.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/AGENTS.md:0-0
Timestamp: 2025-09-24T15:12:58.855Z
Learning: Applies to assets/.claude/commands/taskmaster-complete.md : Create .claude/commands/taskmaster-complete.md with steps to review task, verify, run tests, set status done, and show next task
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-08-03T12:13:33.875Z
Learning: Document testing setup and progress in TaskMaster subtasks using task-master update-subtask commands
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1248
File: packages/tm-core/src/storage/api-storage.ts:509-0
Timestamp: 2025-09-25T22:08:11.063Z
Learning: In API storage backend, subtasks have unique IDs (like "HAM-21") and use a separate parent_id column to establish parent-child relationships, rather than using dotted notation like file storage (e.g., "21.1").
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Provide functions for updating task status within the current tag context, handling both individual tasks and subtasks, and considering subtask status when updating parent tasks.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Allow filtering tasks by status within the current tag context, handle subtask display in lists, and use consistent table formats.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent formatting for task files, include all task properties in text files, and format dependencies with status indicators.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to **/*.test.js : Verify modifications on the in-memory task objects passed to writeJSON.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:11:36.732Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/mcp.mdc:0-0
Timestamp: 2025-07-18T17:11:36.732Z
Learning: Applies to mcp-server/src/core/direct-functions/*.js : Caching should generally be applied to read-only operations that don't modify the tasks.json state. Commands like set-status, add-task, update-task, parse-prd, add-dependency should not be cached.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:14:29.399Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-07-18T17:14:29.399Z
Learning: Applies to scripts/modules/task-manager.js : Subtasks must use consistent properties, maintain simple numeric IDs unique within the parent task, and must not duplicate parent task properties.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-31T22:08:16.039Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/taskmaster.mdc:0-0
Timestamp: 2025-07-31T22:08:16.039Z
Learning: When removing tasks or subtasks, use the remove-task or remove-subtask commands with caution, as this operation cannot be undone. Consider using 'blocked', 'cancelled', or 'deferred' status instead if you want to keep the task for reference.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Use numeric IDs for direct task references
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:09:45.690Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:45.690Z
Learning: Applies to scripts/modules/dependency-manager.js : Use string IDs with dot notation (e.g., "1.2") for subtask references
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:12:57.903Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-07-18T17:12:57.903Z
Learning: Applies to scripts/modules/*.js : Use consistent file naming conventions: 'task_${id.toString().padStart(3, '0')}.txt', use path.join for composing file paths, and use appropriate file extensions (.txt for tasks, .json for data).
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tagged task system aware functions for task finding and manipulation, handle both task and subtask operations, and validate task IDs before operations.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:16:13.793Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-07-18T17:16:13.793Z
Learning: Applies to tests/{unit,integration,e2e}/**/*.test.js : Use sample task fixtures for consistent test data, mock file system operations, and test both success and error paths for task operations.
Applied to files:
packages/tm-core/src/storage/file-storage/file-storage.ts
🧬 Code graph analysis (1)
packages/tm-core/src/storage/file-storage/file-storage.ts (2)
packages/tm-core/src/types/index.ts (2)
TaskStatus(20-28)Task(57-76)packages/tm-core/src/interfaces/storage.interface.ts (1)
UpdateStatusResult(11-16)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
| // Auto-adjust parent status based on subtask statuses | ||
| const subs = parentTask.subtasks; | ||
| let parentNewStatus = parentTask.status; | ||
| if (subs.length > 0) { | ||
| const norm = (s: any) => s.status || 'pending'; | ||
| const isDoneLike = (s: any) => { | ||
| const st = norm(s); | ||
| return st === 'done' || st === 'completed'; | ||
| }; | ||
| const allDone = subs.every(isDoneLike); | ||
| const anyInProgress = subs.some((s) => norm(s) === 'in-progress'); | ||
| const anyDone = subs.some(isDoneLike); | ||
| if (allDone) parentNewStatus = 'done'; | ||
| else if (anyInProgress || anyDone) parentNewStatus = 'in-progress'; | ||
| } |
There was a problem hiding this comment.
Parent task never reverts to pending when all subtasks reset
If every subtask moves back to pending, anyInProgress and anyDone are both false, so we fall through and keep whatever the parent’s previous status was. That leaves a parent stuck at done (or in-progress) even though every subtask is pending, which breaks the status model the CLI relies on. We need an explicit branch that puts the parent back into pending when all subtasks are pending.
- if (subs.length > 0) {
- const norm = (s: any) => s.status || 'pending';
- const isDoneLike = (s: any) => {
- const st = norm(s);
- return st === 'done' || st === 'completed';
- };
- const allDone = subs.every(isDoneLike);
- const anyInProgress = subs.some((s) => norm(s) === 'in-progress');
- const anyDone = subs.some(isDoneLike);
- if (allDone) parentNewStatus = 'done';
- else if (anyInProgress || anyDone) parentNewStatus = 'in-progress';
- }
+ if (subs.length > 0) {
+ const norm = (s: any) => s.status || 'pending';
+ const isDoneLike = (s: any) => {
+ const st = norm(s);
+ return st === 'done' || st === 'completed';
+ };
+ 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';
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Auto-adjust parent status based on subtask statuses | |
| const subs = parentTask.subtasks; | |
| let parentNewStatus = parentTask.status; | |
| if (subs.length > 0) { | |
| const norm = (s: any) => s.status || 'pending'; | |
| const isDoneLike = (s: any) => { | |
| const st = norm(s); | |
| return st === 'done' || st === 'completed'; | |
| }; | |
| const allDone = subs.every(isDoneLike); | |
| const anyInProgress = subs.some((s) => norm(s) === 'in-progress'); | |
| const anyDone = subs.some(isDoneLike); | |
| if (allDone) parentNewStatus = 'done'; | |
| else if (anyInProgress || anyDone) parentNewStatus = 'in-progress'; | |
| } | |
| // Auto-adjust parent status based on subtask statuses | |
| const subs = parentTask.subtasks; | |
| let parentNewStatus = parentTask.status; | |
| if (subs.length > 0) { | |
| const norm = (s: any) => s.status || 'pending'; | |
| const isDoneLike = (s: any) => { | |
| const st = norm(s); | |
| return st === 'done' || st === 'completed'; | |
| }; | |
| 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'; | |
| } |
🤖 Prompt for AI Agents
In packages/tm-core/src/storage/file-storage/file-storage.ts around lines
400-414 the parent status logic never moves the parent back to "pending" when
every subtask is pending, leaving parents stuck at "done" or "in-progress".
Update the branch inside the subs.length > 0 block to detect allPending (e.g.,
const allPending = subs.every(s => norm(s) === 'pending')) and add an explicit
branch that sets parentNewStatus = 'pending' when allPending; otherwise keep the
existing checks (allDone -> 'done', else if anyInProgress||anyDone ->
'in-progress'). Ensure norm is reused for the pending check and preserve
existing behavior when there are no subtasks.
Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Fixes #1247 - Subtask status updates not working in v0.27.0+
Changes
Testing
The fix allows users to successfully run:
Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes