Skip to content

Duplicate leaf task names in included taskfiles break tree grouping #228

@joeblew999

Description

@joeblew999

Problem

When using Taskfile includes with namespaced taskfiles, tasks that share the same leaf name across different included files (e.g. install, health, shell) are hoisted to the root level in the VS Code tree view instead of staying nested under their namespace.

Expected behavior

duckdb:install and restish:install should each appear under their respective namespace folders (duckdb and restish) in the tree view — the same way task --list-all shows them as fully qualified names on the CLI.

Actual behavior

When multiple included taskfiles contain a task with the same name (e.g. both duckdb.yml and restish.yml have an install: task), those tasks appear at the root level of the tree view to disambiguate, breaking the namespace grouping.

Workaround

Prefix every task name inside included files to ensure global uniqueness (e.g. duckdb-install: instead of install: inside duckdb.yml). This works but produces redundant fully-qualified names like duckdb:duckdb-install.

Reproduction

Taskfile.yml:

version: "3"

includes:
  duckdb:
    taskfile: taskfiles/duckdb.yml
  restish:
    taskfile: taskfiles/restish.yml

tasks:
  default:
    desc: Show tasks
    cmds:
      - task --list

taskfiles/duckdb.yml:

version: "3"
tasks:
  install:
    desc: Install DuckDB
    cmds:
      - echo "installing duckdb"

taskfiles/restish.yml:

version: "3"
tasks:
  install:
    desc: Install restish
    cmds:
      - echo "installing restish"

Both install tasks appear at root instead of under duckdb and restish folders.

Environment

  • VS Code extension: task.vscode-task
  • Task CLI: v3.x
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions