fix: Correct JSON field name for swarm task loading (gt-552hb)
The loadTasksFromBeads() function was reading 'dependents' from bd show output, but the actual JSON field is 'dependencies'. This caused swarms to have empty task lists, requiring manual dispatch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -292,15 +292,15 @@ func (m *Manager) loadTasksFromBeads(epicID string) ([]SwarmTask, error) {
|
|||||||
|
|
||||||
// Parse JSON output - bd show returns an array
|
// Parse JSON output - bd show returns an array
|
||||||
var issues []struct {
|
var issues []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"`
|
||||||
Dependents []struct {
|
Dependencies []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"`
|
||||||
DependencyType string `json:"dependency_type"`
|
DependencyType string `json:"dependency_type"`
|
||||||
} `json:"dependents"`
|
} `json:"dependencies"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal(stdout.Bytes(), &issues); err != nil {
|
if err := json.Unmarshal(stdout.Bytes(), &issues); err != nil {
|
||||||
@@ -311,10 +311,10 @@ 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 dependents as tasks (issues that depend on/are blocked by this epic)
|
// Extract dependencies 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].Dependents {
|
for _, dep := range issues[0].Dependencies {
|
||||||
if dep.DependencyType != "parent-child" && dep.DependencyType != "blocks" {
|
if dep.DependencyType != "parent-child" && dep.DependencyType != "blocks" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user