Bug - delegate command causes file conflict with multiple tasks #126

Closed
opened 2026-04-03 13:40:04 +02:00 by shoko · 0 comments
Owner

Bug Description

delegate command doesn't properly isolate tasks to their respective worktrees, causing file conflicts when multiple tasks exist.

Details

  • start creates the correct worktree for a new task
  • continue works correctly with multiple worktrees
  • delegate reuses an existing worktree instead of switching to the per-issue worktree
  • Result: File conflicts when delegating multiple tasks to different issues

Expected behavior

  • kugetsu delegate "work on #14" should use the worktree for issue #14
  • kugetsu delegate "work on #15" should use the worktree for issue #15
  • Each task should have isolated worktree

Root Cause (Research Needed)

  • Does delegate properly resolve issue ref to worktree?
  • Is the worktree path passed correctly to the forked session?
  • Is there a race condition between delegate and start?

Fix Approach

  1. Research how delegate currently resolves worktree for a task
  2. Compare with how start/continue successfully isolate worktrees
  3. Apply same worktree resolution logic to delegate
  4. Test with multiple concurrent tasks

Acceptance Criteria

  • delegate "work on #14" uses worktree for issue #14
  • delegate "work on #15" uses worktree for issue #15
  • No file conflicts when delegating multiple tasks
  • Existing single-task delegate behavior unchanged
## Bug Description `delegate` command doesn't properly isolate tasks to their respective worktrees, causing file conflicts when multiple tasks exist. ## Details - `start` creates the correct worktree for a new task - `continue` works correctly with multiple worktrees - `delegate` reuses an existing worktree instead of switching to the per-issue worktree - Result: File conflicts when delegating multiple tasks to different issues ## Expected behavior - `kugetsu delegate "work on #14"` should use the worktree for issue #14 - `kugetsu delegate "work on #15"` should use the worktree for issue #15 - Each task should have isolated worktree ## Root Cause (Research Needed) - Does delegate properly resolve issue ref to worktree? - Is the worktree path passed correctly to the forked session? - Is there a race condition between delegate and start? ## Fix Approach 1. Research how delegate currently resolves worktree for a task 2. Compare with how start/continue successfully isolate worktrees 3. Apply same worktree resolution logic to delegate 4. Test with multiple concurrent tasks ## Acceptance Criteria - [ ] `delegate "work on #14"` uses worktree for issue #14 - [ ] `delegate "work on #15"` uses worktree for issue #15 - [ ] No file conflicts when delegating multiple tasks - [ ] Existing single-task delegate behavior unchanged
shoko closed this issue 2026-04-05 09:06:03 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#126