feat(kugetsu): cmd_delegate should call cmd_start directly for parallelization #75

Closed
opened 2026-04-01 11:22:32 +02:00 by shoko · 4 comments
Owner

Problem

Currently kugetsu delegate sends a message to the PM session, which then needs to call kugetsu start to create a dev agent. This has issues:

  1. PM can deviate and do work directly instead of delegating
  2. Multiple delegations spawn multiple PM processes working concurrently
  3. Concurrent PM processes conflict on same worktrees
  4. Blocks parallelization

Solution

Make cmd_delegate call cmd_start directly:

cmd_delegate() {
    local message="$1"
    # Parse issue ref from message or detect from context
    # Call cmd_start directly - creates dev agent immediately
    cmd_start "$issue_ref" "$message"
}

Benefits

  • kugetsu delegate creates dev agent immediately
  • Multiple delegations → multiple dev agents in parallel
  • PM is bypassed for simple tasks
  • Enables true parallelization
  • Simpler flow: delegate → start → done

Tasks

  1. Modify cmd_delegate to call cmd_start directly
  2. Extract issue ref from delegation message
  3. Handle case where issue ref is not in message
  4. Ensure MAX_CONCURRENT_AGENTS limit is respected
  5. Test parallel delegation

Notes

PM (issue #56) can be updated later to only handle complex coordination.
Simple tasks go direct via cmd_start.

## Problem Currently `kugetsu delegate` sends a message to the PM session, which then needs to call `kugetsu start` to create a dev agent. This has issues: 1. PM can deviate and do work directly instead of delegating 2. Multiple delegations spawn multiple PM processes working concurrently 3. Concurrent PM processes conflict on same worktrees 4. Blocks parallelization ## Solution Make `cmd_delegate` call `cmd_start` directly: ```bash cmd_delegate() { local message="$1" # Parse issue ref from message or detect from context # Call cmd_start directly - creates dev agent immediately cmd_start "$issue_ref" "$message" } ``` ## Benefits - `kugetsu delegate` creates dev agent immediately - Multiple delegations → multiple dev agents in parallel - PM is bypassed for simple tasks - Enables true parallelization - Simpler flow: delegate → start → done ## Tasks 1. Modify cmd_delegate to call cmd_start directly 2. Extract issue ref from delegation message 3. Handle case where issue ref is not in message 4. Ensure MAX_CONCURRENT_AGENTS limit is respected 5. Test parallel delegation ## Notes PM (issue #56) can be updated later to only handle complex coordination. Simple tasks go direct via cmd_start.
Author
Owner

PR created: #77

Changes:

  • Added extract_issue_ref_from_message() to parse issue ref from delegation message
  • Modified cmd_delegate to call cmd_start directly when issue ref is found
  • Falls back to PM agent if no issue ref can be extracted
  • Issue ref can be extracted from full URLs, short refs (github.com/user/repo#123), or simple refs (#123)
PR created: https://git.fbrns.co/shoko/kugetsu/pulls/77 Changes: - Added `extract_issue_ref_from_message()` to parse issue ref from delegation message - Modified `cmd_delegate` to call `cmd_start` directly when issue ref is found - Falls back to PM agent if no issue ref can be extracted - Issue ref can be extracted from full URLs, short refs (github.com/user/repo#123), or simple refs (#123)
shoko closed this issue 2026-04-02 00:23:05 +02:00
Author
Owner

PR created: #110

Changes:

  • Added extract_issue_ref_from_message() to parse issue ref from delegation message
  • Modified cmd_delegate to call cmd_start directly when issue ref is found
  • Falls back to PM agent if no issue ref can be extracted
  • Issue ref can be extracted from full URLs, short refs (github.com/user/repo#123), or simple refs (#123)
PR created: https://git.fbrns.co/shoko/kugetsu/pulls/110 Changes: - Added `extract_issue_ref_from_message()` to parse issue ref from delegation message - Modified `cmd_delegate` to call `cmd_start` directly when issue ref is found - Falls back to PM agent if no issue ref can be extracted - Issue ref can be extracted from full URLs, short refs (github.com/user/repo#123), or simple refs (#123)
Author
Owner

PR created (v2): #111

Changes:

  • Added extract_issue_ref_from_message() to parse issue ref from delegation message
  • Modified cmd_delegate to call cmd_start directly when issue ref is found
  • Falls back to PM agent if no issue ref can be extracted
PR created (v2): https://git.fbrns.co/shoko/kugetsu/pulls/111 Changes: - Added `extract_issue_ref_from_message()` to parse issue ref from delegation message - Modified `cmd_delegate` to call `cmd_start` directly when issue ref is found - Falls back to PM agent if no issue ref can be extracted
Author
Owner

Updated PR: #111

Changes:

  • Added extract_issue_ref_from_message() function
  • Modified cmd_delegate to call cmd_start directly when issue ref is found
  • Falls back to PM agent if no issue ref can be extracted
Updated PR: https://git.fbrns.co/shoko/kugetsu/pulls/111 Changes: - Added `extract_issue_ref_from_message()` function - Modified `cmd_delegate` to call `cmd_start` directly when issue ref is found - Falls back to PM agent if no issue ref can be extracted
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#75