Skip to content

fix: handle subtasks in getTask method#1254

Merged
Crunchyman-ralph merged 3 commits intomainfrom
claude/issue-1253-20250926-1724
Sep 26, 2025
Merged

fix: handle subtasks in getTask method#1254
Crunchyman-ralph merged 3 commits intomainfrom
claude/issue-1253-20250926-1724

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Sep 26, 2025

Fixes issue where 'tm show' command could not find subtasks by their dotted notation ID (e.g., '8.1').

The getTask method now checks if the task ID contains a dot and properly searches within parent task subtasks, returning a Task-like object with the full dotted ID.

This mirrors the fix already implemented in updateTaskStatus method for consistent subtask handling across the codebase.

Fixes #1253

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Subtasks can be accessed via dotted IDs (e.g., "parent.subtask") and are shown as full task entries with sensible defaults, resolved dependencies, parent context, and inherited metadata.
    • Regular task lookup for non-dotted IDs remains unchanged.
  • Bug Fixes

    • "tm show" correctly locates and displays subtasks when using dotted notation.
    • Retrieving non-existent subtasks now returns no result without affecting top-level task retrieval.

Fixes issue where 'tm show' command could not find subtasks by their
dotted notation ID (e.g., '8.1'). The getTask method now checks if
the task ID contains a dot and properly searches within parent task
subtasks, returning a Task-like object with the full dotted ID.

This mirrors the fix already implemented in updateTaskStatus method
for consistent subtask handling across the codebase.

Fixes #1253

Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com>
@changeset-bot
Copy link

changeset-bot bot commented Sep 26, 2025

🦋 Changeset detected

Latest commit: 5c9eb2e

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 26, 2025

Walkthrough

getTask now delegates to storage.loadTask and wraps storage errors in TaskMasterError; file-storage loadTask gained dotted-ID (subtask) resolution that returns composed subtask objects with resolved dependencies and parent context; a changeset documents the tm show subtask fix.

Changes

Cohort / File(s) Change Summary
Task service delegation & error handling
packages/tm-core/src/services/task-service.ts
Replaced in-method filtering with a direct call to storage.loadTask(...); on storage errors, throw TaskMasterError with operation/resource/taskId/tag details; preserves previous non-error behavior.
File storage: dotted subtask support
packages/tm-core/src/storage/file-storage/file-storage.ts
Add handling for dotted IDs (e.g., 1.2): locate parent task, find subtask by sub-id, resolve dependencies to full dotted IDs, build and return a Task-like subtask object (full id, merged/derived fields, tags, parentTask ref, isSubtask flag); existing top-level lookup unchanged.
Changeset / release note
.changeset/fix-subtask-getTask.md
Add patch-level changeset describing the bugfix: tm show now finds and returns subtask details when using dotted IDs.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Caller (e.g., CLI)
  participant TS as TaskService.getTask
  participant Storage as Storage.loadTask (FileStorage)

  C->>TS: getTask(taskId, opts?)
  TS->>Storage: loadTask(taskId, tag?)
  alt Storage error
    Storage-->>TS: throws/Error
    TS-->>C: throws TaskMasterError(operation:"loadTask", resource:"task", taskId, tag)
  else Storage returns
    alt taskId contains "."
      Storage-->>TS: returns composed subtask object (dotted id, merged fields, dependencies resolved, parentTask ref)
      TS-->>C: return subtask
    else
      Storage-->>TS: returns task
      TS-->>C: return task
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • eyaltoledano

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately summarizes the core update by stating that the getTask method now supports subtasks, which directly corresponds to the changes in both the service layer and storage layer implementing dotted ID handling for subtasks.
Linked Issues Check ✅ Passed The modifications in file-storage and task-service introduce logic to detect dotted task IDs, locate parent tasks and subtasks, and return a Task object for subtasks, which directly addresses the inability of tm show to display subtasks as described in issue #1253.
Out of Scope Changes Check ✅ Passed All code changes are focused on subtask retrieval and error handling enhancements in getTask and file-storage, with no unrelated features or functionality introduced outside the scope of the linked issue.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/issue-1253-20250926-1724

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 118eadf and 5c9eb2e.

📒 Files selected for processing (3)
  • .changeset/fix-subtask-getTask.md (1 hunks)
  • packages/tm-core/src/services/task-service.ts (1 hunks)
  • packages/tm-core/src/storage/file-storage/file-storage.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
.changeset/*.md

📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)

.changeset/*.md: When running npm run changeset or npx changeset add, provide a concise summary of the changes for the CHANGELOG.md in 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/fix-subtask-getTask.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/fix-subtask-getTask.md
🧠 Learnings (23)
📓 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: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1232
File: packages/build-config/package.json:14-15
Timestamp: 2025-09-22T19:45:13.323Z
Learning: In the eyaltoledano/claude-task-master repository, Crunchyman-ralph intentionally omits version fields from internal packages (like tm/build-config) to prevent changesets from releasing new versions for these packages. This is the desired behavior for internal tooling packages that should not be published or versioned independently.
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-09-24T15:12:12.658Z
Learning: View task details with task-master show <id> (supports dot notation for subtasks) before implementation
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 : 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-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 tag resolution functions to maintain backward compatibility, returning legacy format to core functions and not exposing the tagged structure to existing core logic.

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/task-manager/**/*.js : Do not call AI-specific getters (like `getMainModelId`, `getMainMaxTokens`) from core logic functions in `scripts/modules/task-manager/*`; instead, pass the `role` to the unified AI service.

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
  • .changeset/fix-subtask-getTask.md
  • 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/services/task-service.ts
  • .changeset/fix-subtask-getTask.md
  • packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
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
  • 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 : Format task and dependency IDs consistently when adding dependencies

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: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
  • .changeset/fix-subtask-getTask.md
📚 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
  • packages/tm-core/src/storage/file-storage/file-storage.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: View task details with task-master show <id> (supports dot notation for subtasks) before implementation

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 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:

  • .changeset/fix-subtask-getTask.md
  • packages/tm-core/src/storage/file-storage/file-storage.ts
📚 Learning: 2025-07-18T17:07:53.100Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/changeset.mdc:0-0
Timestamp: 2025-07-18T17:07:53.100Z
Learning: Applies to .changeset/*.md : When running `npm run changeset` or `npx changeset add`, provide a concise summary of the changes for the `CHANGELOG.md` in imperative mood, typically a single line, and not a detailed Git commit message.

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 Learning: 2025-08-06T21:14:23.071Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1091
File: .changeset/wide-actors-report.md:0-0
Timestamp: 2025-08-06T21:14:23.071Z
Learning: For changeset files (.changeset/*.md), the first line after the frontmatter must be a plain, unstyled summary line that gets integrated directly into the changelog. Do not add markdown headings or styling as this would interfere with the changelog generation process. Ignore markdownlint MD041 rule for these files.

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 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: Write changesets as user-facing summaries that state what the end user gains or what was fixed, avoiding internal code specifics

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 Learning: 2025-07-18T17:10:31.810Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-07-18T17:10:31.810Z
Learning: Subtask commit messages must follow the format: feat(task-X): Complete subtask X.Y - [Subtask Title] with a detailed body describing implementation, key changes, and notes

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 Learning: 2025-07-18T17:07:53.100Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/changeset.mdc:0-0
Timestamp: 2025-07-18T17:07:53.100Z
Learning: Applies to .changeset/*.md : Do not use your detailed Git commit message body as the changeset summary.

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 Learning: 2025-07-18T17:07:53.100Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/changeset.mdc:0-0
Timestamp: 2025-07-18T17:07:53.100Z
Learning: Applies to .changeset/*.md : The changeset summary should be user-facing, describing what changed in the released version that is relevant to users or consumers of the package.

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 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:

  • .changeset/fix-subtask-getTask.md
📚 Learning: 2025-07-18T17:10:12.881Z
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: Use the Taskmaster command set (`task-master` CLI or MCP tools) for all task management operations: listing, expanding, updating, tagging, and status changes.

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 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/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 : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results.

Applied to files:

  • packages/tm-core/src/storage/file-storage/file-storage.ts
🧬 Code graph analysis (2)
packages/tm-core/src/services/task-service.ts (3)
packages/tm-core/src/types/index.ts (1)
  • 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)
packages/tm-core/src/storage/file-storage/file-storage.ts (2)
packages/tm-core/src/types/index.ts (1)
  • Task (57-76)
scripts/modules/task-manager/find-next-task.js (1)
  • toFullSubId (28-35)
🪛 markdownlint-cli2 (0.18.1)
.changeset/fix-subtask-getTask.md

5-5: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


7-7: Files should end with a single newline character

(MD047, single-trailing-newline)

⏰ 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 (3)
packages/tm-core/src/storage/file-storage/file-storage.ts (1)

139-161: Thanks for mirroring the subtask payload shape from utils.js

The dotted ID assignment, dependency normalization, and timestamp fallbacks bring the storage result in line with the CLI helpers, so downstream consumers shouldn’t see mismatched subtask shapes anymore. Nice work keeping that logic centralized.

packages/tm-core/src/services/task-service.ts (1)

145-158: Appreciate the storage delegation and richer error context

Deferring to storage.loadTask keeps all dotted-ID resolution in one layer, and the wrapped TaskMasterError metadata will make failures around tm show much easier to diagnose.

.changeset/fix-subtask-getTask.md (1)

5-7: Rewrite the changeset summary to follow the repo convention

Please collapse the body to a single, imperative, user-facing line, drop the bullet list, strip the trailing whitespace, and add the terminating newline so the automation passes.

--- a/.changeset/fix-subtask-getTask.md
+++ b/.changeset/fix-subtask-getTask.md
@@
 "task-master-ai": patch
 ---
-
-Fixed issue where `tm show` command could not find subtasks using dotted notation IDs (e.g., '8.1'). 
-
-- The command now properly searches within parent task subtasks and returns the correct subtask information.
+Fix tm show handling of dotted subtask IDs
+

As per coding guidelines.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Crunchyman-ralph
Copy link
Collaborator Author

@claude don't forget to add your changeset inside .changesets, its task-master-ai patch

@claude
Copy link
Contributor

claude bot commented Sep 26, 2025

Claude finished @Crunchyman-ralph's task —— View job


Adding Changeset for Subtask Fix ✅

Successfully added the required changeset for the subtask handling fix in getTask method.

Tasks:

  • Read repository guidelines for changesets
  • Create changeset file in .changesets directory
  • Commit and push the changeset
  • Update comment with completion status

What was completed:

  • Created .changeset/fix-subtask-getTask.md with patch-level change for task-master-ai package
  • Added user-facing description explaining the fix for tm show command with dotted notation IDs
  • Committed and pushed the changeset to the PR branch

The changeset follows the repository guidelines by focusing on the user-facing impact (fixing the tm show command for subtasks) rather than technical implementation details.


Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7f32ea and d465e93.

📒 Files selected for processing (1)
  • packages/tm-core/src/services/task-service.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: assets/.windsurfrules:0-0
Timestamp: 2025-09-24T15:12:12.658Z
Learning: View task details with task-master show <id> (supports dot notation for subtasks) before implementation
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/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
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent
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 : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results.
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: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 : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results.

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 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 : Use string IDs with dot notation (e.g., "1.2") for subtask references

Applied to files:

  • packages/tm-core/src/services/task-service.ts
🪛 GitHub Actions: CI
packages/tm-core/src/services/task-service.ts

[error] 148-156: Biome format check failed: detected formatting issues that require changes (the formatter would have printed updated content). Please run the formatter to fix the code. Command: 'biome format .'

Comment on lines 160 to 176
// Return a Task-like object for the subtask with the full dotted ID
return {
id: taskId,
title: subtask.title || `Subtask ${subtaskId}`,
description: subtask.description || '',
status: subtask.status || 'pending',
priority: subtask.priority || parentTask.priority || 'medium',
dependencies: subtask.dependencies || [],
details: subtask.details || '',
testStrategy: subtask.testStrategy || '',
subtasks: [],
tags: parentTask.tags || [],
assignee: subtask.assignee || parentTask.assignee,
complexity: subtask.complexity || parentTask.complexity,
createdAt: parentTask.createdAt,
updatedAt: parentTask.updatedAt
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Ensure subtask dependencies are returned with full dotted IDs

When we surface a subtask via tm show, its dependencies still come back in their raw storage form (e.g., ["2"]). Because consumers expect the canonical dotted notation ("8.2" in this example), the current logic yields ambiguous/incorrect dependency references that can’t be resolved or acted upon. This regresses behavior the rest of the codebase (e.g., getNextTask) already normalizes. Please normalize the dependency IDs before returning the subtask.

Apply this diff to normalize the dependency IDs:

-			const subtask = parentTask.subtasks.find((st) => String(st.id) === subtaskId);
+			const subtask = parentTask.subtasks.find((st) => String(st.id) === subtaskId);
 			if (!subtask) {
 				return null;
 			}
 
+			const toFullSubId = (maybeDotId: string | number): string => {
+				const depId = String(maybeDotId);
+				return depId.includes('.') ? depId : `${parentTask.id}.${depId}`;
+			};
+			const resolvedDependencies =
+				subtask.dependencies?.map((dep) => toFullSubId(dep)) ?? [];
+
 			// Return a Task-like object for the subtask with the full dotted ID
 			return {
 				id: taskId,
 				title: subtask.title || `Subtask ${subtaskId}`,
 				description: subtask.description || '',
 				status: subtask.status || 'pending',
-				priority: subtask.priority || parentTask.priority || 'medium',
-				dependencies: subtask.dependencies || [],
+				priority: subtask.priority || parentTask.priority || 'medium',
+				dependencies: resolvedDependencies,
🤖 Prompt for AI Agents
packages/tm-core/src/services/task-service.ts around lines 160 to 176: subtask
dependency IDs are returned in raw form (e.g., "2") instead of canonical dotted
IDs (e.g., "8.2"); normalize them by mapping subtask.dependencies (or []) to
full dotted IDs before returning—if an entry already contains a dot leave it
as-is, otherwise prefix it with the parent task id (parentTask.id + '.' + dep);
replace the current dependencies assignment in the returned object with this
mapped/normalized array.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d465e93 and 118eadf.

📒 Files selected for processing (1)
  • .changeset/fix-subtask-getTask.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
.changeset/*.md

📄 CodeRabbit inference engine (.cursor/rules/changeset.mdc)

.changeset/*.md: When running npm run changeset or npx changeset add, provide a concise summary of the changes for the CHANGELOG.md in 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/fix-subtask-getTask.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/fix-subtask-getTask.md
🧠 Learnings (6)
📓 Common learnings
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-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: View task details with task-master show <id> (supports dot notation for subtasks) before implementation

Applied to files:

  • .changeset/fix-subtask-getTask.md
📚 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:

  • .changeset/fix-subtask-getTask.md
📚 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:

  • .changeset/fix-subtask-getTask.md
📚 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:

  • .changeset/fix-subtask-getTask.md
📚 Learning: 2025-07-18T17:10:12.881Z
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: Use the Taskmaster command set (`task-master` CLI or MCP tools) for all task management operations: listing, expanding, updating, tagging, and status changes.

Applied to files:

  • .changeset/fix-subtask-getTask.md
🪛 markdownlint-cli2 (0.18.1)
.changeset/fix-subtask-getTask.md

5-5: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


5-5: Files should end with a single newline character

(MD047, single-trailing-newline)

@Crunchyman-ralph Crunchyman-ralph merged commit af53525 into main Sep 26, 2025
8 checks passed
@Crunchyman-ralph Crunchyman-ralph deleted the claude/issue-1253-20250926-1724 branch September 26, 2025 18:58
sfc-gh-dflippo pushed a commit to sfc-gh-dflippo/task-master-ai that referenced this pull request Dec 4, 2025
Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: could not found subtask

2 participants