Skip to content

feat(mcp): dispatch_tasks should support worktree spawning #98

Description

@alxjrvs

Problem

`spawn_agent` has a full `worktree` flag that creates a git worktree,
sets up a fresh workspace, and launches an agent with a startup command.
`dispatch_tasks` is a batch tool meant for kicking off multiple agents
at once, but it doesn't expose the `worktree` parameter at all.

An orchestrator that wants N agents in N worktrees must currently call
`spawn_agent` N times sequentially instead of using `dispatch_tasks`.

Proposed solution

Add a `worktree` boolean and the associated worktree parameters
(`base`, `branch`, `repo_path`, etc.) to each task item in
`dispatch_tasks`, mirroring the `spawn_agent` interface.

The implementation can delegate to the same `spawnAgentInWorktree`
helper already used by `spawn_agent`.

Acceptance criteria

  • `dispatch_tasks` accepts `worktree: true` per task item
  • Each task item supports `base`, `branch`, `repo_path`, `group_id`
  • Behavior is identical to calling `spawn_agent` individually per item
  • Existing non-worktree `dispatch_tasks` behavior is unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    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