From 10e797895a1e7e93f3fbd623a5047f0fa6e1a0d7 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 29 Dec 2025 21:56:29 -0800 Subject: [PATCH] Fix swarm not tracking dynamically added workers (gt-qd9p0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs fixed in loadTasksFromBeads(): 1. JSON field name mismatch: code parsed dependencies but bd show returns dependents - meant worker discovery always failed 2. Missing Assignee field: even if field name was correct, assignees were not being extracted from the bd show output Also added hooked status to TaskInProgress mapping since workers with hooked beads are actively working. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/swarm/manager.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/internal/swarm/manager.go b/internal/swarm/manager.go index bba99339..af106a9f 100644 --- a/internal/swarm/manager.go +++ b/internal/swarm/manager.go @@ -225,15 +225,16 @@ func (m *Manager) loadTasksFromBeads(epicID string) ([]SwarmTask, error) { // Parse JSON output - bd show returns an array var issues []struct { - ID string `json:"id"` - Title string `json:"title"` - Status string `json:"status"` - Dependencies []struct { + ID string `json:"id"` + Title string `json:"title"` + Status string `json:"status"` + Dependents []struct { ID string `json:"id"` Title string `json:"title"` Status string `json:"status"` + Assignee string `json:"assignee"` DependencyType string `json:"dependency_type"` - } `json:"dependencies"` + } `json:"dependents"` } if err := json.Unmarshal(stdout.Bytes(), &issues); err != nil { @@ -244,26 +245,27 @@ func (m *Manager) loadTasksFromBeads(epicID string) ([]SwarmTask, error) { return nil, fmt.Errorf("epic not found: %s", epicID) } - // Extract dependencies as tasks (issues that depend on/are blocked by this epic) + // Extract dependents as tasks (issues that depend on/are blocked by this epic) // Accept both "parent-child" and "blocks" relationships var tasks []SwarmTask - for _, dep := range issues[0].Dependencies { + for _, dep := range issues[0].Dependents { if dep.DependencyType != "parent-child" && dep.DependencyType != "blocks" { continue } state := TaskPending switch dep.Status { - case "in_progress": + case "in_progress", "hooked": state = TaskInProgress case "closed": state = TaskMerged } tasks = append(tasks, SwarmTask{ - IssueID: dep.ID, - Title: dep.Title, - State: state, + IssueID: dep.ID, + Title: dep.Title, + State: state, + Assignee: dep.Assignee, }) }