Fix swarm not tracking dynamically added workers (gt-qd9p0)
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 <noreply@anthropic.com>
This commit is contained in:
@@ -228,12 +228,13 @@ func (m *Manager) loadTasksFromBeads(epicID string) ([]SwarmTask, error) {
|
|||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Dependencies []struct {
|
Dependents []struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
Assignee string `json:"assignee"`
|
||||||
DependencyType string `json:"dependency_type"`
|
DependencyType string `json:"dependency_type"`
|
||||||
} `json:"dependencies"`
|
} `json:"dependents"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal(stdout.Bytes(), &issues); err != nil {
|
if err := json.Unmarshal(stdout.Bytes(), &issues); err != nil {
|
||||||
@@ -244,17 +245,17 @@ func (m *Manager) loadTasksFromBeads(epicID string) ([]SwarmTask, error) {
|
|||||||
return nil, fmt.Errorf("epic not found: %s", epicID)
|
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
|
// Accept both "parent-child" and "blocks" relationships
|
||||||
var tasks []SwarmTask
|
var tasks []SwarmTask
|
||||||
for _, dep := range issues[0].Dependencies {
|
for _, dep := range issues[0].Dependents {
|
||||||
if dep.DependencyType != "parent-child" && dep.DependencyType != "blocks" {
|
if dep.DependencyType != "parent-child" && dep.DependencyType != "blocks" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
state := TaskPending
|
state := TaskPending
|
||||||
switch dep.Status {
|
switch dep.Status {
|
||||||
case "in_progress":
|
case "in_progress", "hooked":
|
||||||
state = TaskInProgress
|
state = TaskInProgress
|
||||||
case "closed":
|
case "closed":
|
||||||
state = TaskMerged
|
state = TaskMerged
|
||||||
@@ -264,6 +265,7 @@ func (m *Manager) loadTasksFromBeads(epicID string) ([]SwarmTask, error) {
|
|||||||
IssueID: dep.ID,
|
IssueID: dep.ID,
|
||||||
Title: dep.Title,
|
Title: dep.Title,
|
||||||
State: state,
|
State: state,
|
||||||
|
Assignee: dep.Assignee,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user