Skip to content

Feature: Enable parallel task execution with git worktrees in main extension panel #5640

@Drilmo

Description

@Drilmo

Summary

Currently, the main Kilo Code sidebar panel (ClineProvider) executes tasks strictly sequentially. Users must wait for one task to complete before starting another. While the Agent Manager already supports parallel execution with git worktrees, this capability is not available in the main extension panel.

This feature request proposes bringing parallel task execution with git worktrees to the main extension panel.

Current Behavior

Main Extension Panel (ClineProvider)

  • Single task at a time: Only one task can be active (clineStack LIFO structure)
  • Sequential subtasks: Parent tasks are suspended when child tasks run via orchestrator
  • No worktree support: All work happens in the main workspace
  • Blocking workflow: Users must wait for task completion before starting new work

Agent Manager (existing capability)

  • Parallel sessions: Multiple agent sessions can run simultaneously
  • Git worktrees: Each session runs in an isolated worktree (.kilocode/worktrees/)
  • Process isolation: RuntimeProcessHandler forks separate agent-runtime processes
  • Branch-based workflow: Changes are committed to separate branches for later merge

Proposed Feature

Enable the main extension panel to:

  1. Run multiple tasks in parallel using git worktrees for isolation
  2. Continue working while background tasks execute
  3. Switch between active tasks without losing context
  4. Merge results from parallel branches when tasks complete

Technical Context

Relevant Files (Main Panel)

  • src/core/webview/ClineProvider.ts - Task stack management, single-task enforcement
  • src/core/task/Task.ts - Task execution loop, delegation logic

Relevant Files (Agent Manager - reference implementation)

  • src/core/kilocode/agent-manager/WorktreeManager.ts - Git worktree operations
  • src/core/kilocode/agent-manager/RuntimeProcessHandler.ts - Process forking
  • src/core/kilocode/agent-manager/AgentRegistry.ts - Session tracking

Key Considerations

  • Rate limiting is already global (Task.lastGlobalApiRequestTime) - would need per-session handling
  • UI would need to show multiple active tasks and allow switching
  • Worktree cleanup on task completion/cancellation
  • Session persistence for recovery after extension restart

Use Cases

  1. Multi-bug fixing: Work on multiple unrelated bugs simultaneously
  2. Exploration: Let one task explore an approach while manually working on another
  3. Review while waiting: Start a new task while reviewing results from a previous one
  4. Parallel refactoring: Run multiple refactoring tasks on different parts of codebase

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Intake

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions